moo.sdk.objects.create
- moo.sdk.objects.create(name, *a, **kw)
Creates and returns a new object whose parents are parents and whose owner is as described below. Provided parents are valid Objects with derive permission, otherwise
PermissionErroris raised. After the new object is created, its initialize verb, if any, is called with no arguments.The owner of the new object is either the programmer (if owner is not provided), or the provided owner, if the caller has permission to entrust the object.
If the intended owner of the new object has a property named ownership_quota and the value of that property is an integer, then create() treats that value as a quota. If the quota is less than or equal to zero, then the quota is considered to be exhausted and create() raises
QuotaErrorinstead of creating an object. Otherwise, the quota is decremented and stored back into the ownership_quota property as a part of the creation of the new object.- Parameters:
- Returns:
the new object
- Return type:
- Raises:
PermissionError – if the caller is not allowed to derive from the parent
QuotaError – if the caller has a quota and it has been exceeded