This modules is an interface declaration which only purpose is to document them. This code is never executed neither serves to enforce compliance to the interface by implementators.
It is useful if you plan to extend rum.
Returns an initialized product of this factory for the give arguments.
Returns True if this factory knows how to create product for certains arguments.
Returns an appropiate class for the factory to use to build its products.
Register target_cls for resources that match the given predicate. Both type-tuple based dispatch and full predicate dispatch are supported
Returns a Controller instance to be used to handle resource, optionally related to parent when prefix is prefix.
Returns a Controller class to be used to handle resource, optionally related to parent when prefix is prefix. args is a dict that can be used to place arguments that will be used to instatiate the controller. This method is called by __call__() and it is designed to be extended using generic functions to handle arbitrary resources
Returns a repository instance to be used to handle resource, optionally related to parent when related attribute is remote_name.
Liberate request-local resources if any. This method on the ‘on_end_request’ event and it is passed the active app instance.
Returns a list of rum.fields.Field for a resource or a rum.fields.Field for attribute attr of resource if attr is not None.
Returns a repository class to be used to handle resource, optionally related to parent when related attribute is remote_name. args is a dict that can be used to place arguments that will be used to instatiate the repository.
Returns a string representing the id for this object. This expression should always be True repository.get(repository.get_id(obj)) == obj
This method is a shortcut for self(obj.__class__).get_id(obj)
Return (singular, plural) names for resource.
Registers the singular and plural names for obj and its instances.
See IDataManager.
See IDataManager.
Create a persistent new instance from data and return it. Data is a map keyed by attribute names with coerced and validated values from the View.
Delete obj from the data store so it is no longer persistent.
Returns a resource instance by id. Id could be a tuple for composite keys in a relational database or a string as received from the routes. It is the responsability of the repository to convert this string to something meaninful, including parsing it to extract a composite key and not opening any security whole on the attempt.
If the id is malformed, raise a rum.exceptions.BadId.
Returns a string representing the id for this object. This expression should always be True repository.get(repository.get_id(obj)) == obj
Save obj in the data store so it is persisted.
Returns an iterable that yields all resource instances that match the criteria in query. If query is None it should yield all possible instances.
See IDataManager.
See IDataManager.
See IDataManager.
See IDataManager.
See IDataManager.
Update obj with data. Data is a map keyed by attribute names with coerced and validated values from the View.
Return a IView instance suitable for displaying obj or attribute remote_name from obj in action action.
Note that there’s no requirement on the type of these parameters as long as get_view() is extended (via generic functions) to handle them.
Returns a class implementing IView for viewing obj (or attribute remote_name of obj if remote_name is None) in action action.
Depending on the action (update,create,preview) I should return IValidator implementations.
args is a dictionary with keyword arguments that will be used to initialize the View in __call__(). This is useful to write before or after methods that have a chance to alter them depending on the obj, remote_name and/or action they’re being called with.
Manually connect a controller class (passed as the controller keyword argument) to a URL specification. See Routes manual for more info.
Match PATH_INFO and possibly REQUEST_METHOD.
Try to match url against registered resources and return a routes dict if succesful.
Register resource, optinally attached to parent at attribute remote_name. prefix will be pre-pended to the URL endpoint so a resource can be regsitered at multiple end points to be handled by different IController
Generate a URL for the routes whose dict most closely resembles kw. raise a RoutesException if no url could be generated.
An object used to render a given template(s) using data.
Arguments
- search_path
- A list of locations in the filesystem where the template loader should look for templates.
- auto_reload
- Should the loader automatically reload a template if it is modified? Note that not all loaders might support this feature. If it doesn’t then it will have no effect.
- cache_dir
- A directory where the template loader may save compiled templates
Return a rendered template with variables from data
possible_tempplates is a list of relative to templates which will be looked up in the current search_path. The resulting list of absolute paths is the cartesian product of search_path and possible_templates.