endi.views.third_party.customer package¶
Submodules¶
endi.views.third_party.customer.base module¶
- endi.views.third_party.customer.base.get_customer_url(request, customer=None, _query={}, suffix='', api=False, _anchor=None, absolute=False)¶
- endi.views.third_party.customer.base.get_edit_btn(customer_id)¶
- endi.views.third_party.customer.base.get_list_view_btn(id_)¶
- endi.views.third_party.customer.base.get_view_btn(customer_id)¶
populate the actionmenu for the different views (list/add/edit …)
endi.views.third_party.customer.controller module¶
- class endi.views.third_party.customer.controller.CustomerAddEditController(request, edit=False)¶
Bases :
BaseAddEditController- get_company_schema() SQLAlchemySchemaNode¶
- get_default_type() str¶
Find the default customer type to provide by default
- Renvoie:
The name of the type
- Type renvoyé:
- get_individual_schema() SQLAlchemySchemaNode¶
- get_internal_schema() SQLAlchemySchemaNode¶
alias de
CustomerRelatedAttrManager
- class endi.views.third_party.customer.controller.CustomerRelatedAttrManager(request)¶
Bases :
RelatedAttrManager
endi.views.third_party.customer.lists module¶
Customer views
- class endi.views.third_party.customer.lists.CustomersCsv(*args, **kwargs)¶
Bases :
CustomersListTools,BaseCsvViewCustomer csv view
- dbsession: DBSESSION¶
- property filename¶
To be implemented by the subclass
- query()¶
The main query, should be overrided by a subclass
- request: Request¶
- session: ISession¶
- class endi.views.third_party.customer.lists.CustomersListTools¶
Bases :
objectCustomer list tools
- default_direction = 'desc'¶
- default_sort = 'created_at'¶
- filter_archived(query, appstruct)¶
- filter_name_or_contact(records, appstruct)¶
Filter the records by customer name or contact lastname
- filter_type(query, appstruct)¶
- query()¶
- schema = <endi.forms.lists.BaseListsSchema object at 140624255045392 (named )>¶
- sort_columns = {'code': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'created_at': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'lastname': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}¶
- title = 'Liste des clients'¶
- class endi.views.third_party.customer.lists.CustomersListView(*args, **kwargs)¶
Bases :
CustomersListTools,BaseListView,TreeMixinCustomer listing view
- add_template_vars = ('stream_actions', 'title', 'stream_main_actions', 'stream_more_actions')¶
- children = []¶
- item_route_name = 'customer'¶
- route_name = '/companies/{id}/customers'¶
- stream_actions(customer)¶
Return action buttons with permission handling
- stream_main_actions()¶
- stream_more_actions()¶
- property tree_url¶
Compile the url to be used in the breadcrumb for this view
The context can be either :
A Company
A Customer
A Task
- endi.views.third_party.customer.lists.includeme(config)¶
endi.views.third_party.customer.rest_api module¶
- class endi.views.third_party.customer.rest_api.CustomerRestView(context, request=None)¶
Bases :
RestListMixinClass,CustomersListTools,BaseRestViewCustomer rest view
collection : context Root
GET : return list of customers (company_id should be provided)
- controller_class¶
alias de
CustomerAddEditController
- dbsession: DBSESSION¶
- default_customer_type() str¶
Collect the default user type
- Renvoie:
One of the available customer type (company/individual)
- Type renvoyé:
- form_config()¶
- format_collection(query)¶
Format the collection returned to the end user
result of HTTP GET call on the collection endpoint
- format_item_result(model)¶
Build the data to be returned by the api endpoint
- Paramètres:
item – The current sqlalchemy Model
- Renvoie:
An object with a __json__ method or a dict that can be json serialized
- get_schema(submitted: dict) Schema¶
Build the colander schema to be used
- Paramètres:
submitted – Data submitted to the api endpoint
- Renvoie:
A form schema used to validate the submitted data
- list_schema = <endi.forms.lists.BaseListsSchema object at 140624254640464 (named )>¶
- post_format(entry, edit, attributes)¶
Associate a newly created element to the parent company
- query()¶
The main query, should be overrided by a subclass
- request: Request¶
- session: ISession¶
- endi.views.third_party.customer.rest_api.includeme(config)¶
endi.views.third_party.customer.routes module¶
- endi.views.third_party.customer.routes.includeme(config)¶
endi.views.third_party.customer.views module¶
Module contents¶
- endi.views.third_party.customer.includeme(config)¶