Bases: type
Metaclass used to register a controller and get a controller associated to a type (see get_controller()).
See How to add a controller for more explanations.
dict<type_name(str) : Controller(like PLMObjectController)>
Returns the controller (subclass of PLMObjectController) associated to type_name (a string).
For example, get_controller("Part") will return the class PartController.
shortcut for MetaController.get_controller()
Decorator for methods of PLMObjectController which raises PermissionError if PLMObjectController._user has not the role role
Bases: object
Object used to manage a PLMObject and store his modification in a history
Attributes : | |
---|---|
Parameters: |
alias of AbstractHistory
Saves object and records its history in the database. If with_history is False, the history is not recorded.
Returns a verbose name for attr_name.
Example:
>>> ctrl.get_verbose_name("ctime")
u'date of creation'
Updates object from data of form
Raises : | ValueError if form is invalid. |
---|---|
Raises : | PermissionError if _user is not the owner of object. |
Raises : | PermissionError if object is not editable. |
This method checks if _user has permissions implied by role. For example, role can be owner or notified.
If the check succeeds, True is returned. Otherwise, if raise_ is True (the default), a PermissionError is raised and if raise_ is False, False is returned.
Implementation details
This method keeps a cache, so that you dont have to worry about multiple calls to this method.
This method checks if user is a contributor. If not, it raises PermissionError.
If user is None (the default), _user is used.
Blocks mails sending. Call unblock_mails() to send blocked mails.