flask_restful_dbbase package¶
Subpackages¶
- flask_restful_dbbase.resources package
- Submodules
- flask_restful_dbbase.resources.collection_model_resource module
- flask_restful_dbbase.resources.dbbase_resource module
DBBaseResource
DBBaseResource.model_class
DBBaseResource.url_prefix
DBBaseResource.url_name
DBBaseResource.use_date_conversions
DBBaseResource.serial_fields
DBBaseResource.serial_field_relations
DBBaseResource.before_commit
DBBaseResource.after_commit
DBBaseResource.default_sort
DBBaseResource.requires_parameter
DBBaseResource.fields
DBBaseResource.meta_doc
DBBaseResource.model_name
DBBaseResource.get_key_names()
DBBaseResource.get_obj_params()
DBBaseResource.format_key()
DBBaseResource.get_urls()
DBBaseResource.get_meta()
DBBaseResource.is_collection()
DBBaseResource.create_url()
DBBaseResource.screen_data()
- flask_restful_dbbase.resources.meta_resource module
- flask_restful_dbbase.resources.model_resource module
- Module contents
Submodules¶
flask_restful_dbbase.generator module¶
This module implements a technique for creating resources with specific methods.
A customized resource can be created from a resource, but with some of the default HTTP methods removed, but with customized resource modifications applied to make a unique resource.
- flask_restful_dbbase.generator.create_resource(name, resource_class, model_class=None, methods=None, url_prefix=None, url_name=None, class_vars=None)[source]¶
This function creates a resource based on a source model class and a seed resource.
- Parameters:
name – (str) : This will be the name stored with the new class.
resource_class – (obj) : This is the ModelResource class that will be used as the basis of the new class.
methods – (list) : This the list of HTTP methods that should be transferred to the new class.
url_prefix – (str) : This is url_prefix that can be used in place of the default url_prefix that comes with the resource class.
url_name – (str) : This the url_name that can be used in place of the default url_name that comes with the resource.
class_vars – (dict) : This is a dictionary of variables and values that will be transferred to the new resource. These are set in place last, so it is here that additional customization of the new resource can be made.
- Returns:
(obj) – The new resource class