endi.forms.third_party package¶
Submodules¶
endi.forms.third_party.base module¶
Third party handling forms schemas and related widgets
- endi.forms.third_party.base.build_admin_third_party_options(query)¶
Format options for admin third_party select widget
- Paramètres:
query (obj) – The Sqlalchemy query
- Renvoie:
A list of deform.widget.OptGroup
- endi.forms.third_party.base.build_third_party_values(third_parties)¶
Build human understandable third_party labels allowing efficient discrimination
- Paramètres:
third_parties (obj) – Iterable (list or Sqlalchemy query)
- Renvoie:
A list of 2-uples
- endi.forms.third_party.base.customize_third_party_schema(schema)¶
Add common widgets configuration for the third parties forms schema
- Paramètres:
schema (obj) – The ThirdParty form schema
- endi.forms.third_party.base.third_party_after_bind(node, kw)¶
After bind method for the third_party model schema
removes nodes if the user have no rights to edit them
- Paramètres:
node (obj) – SchemaNode corresponding to the ThirdParty
kw (dict) – The bind parameters
- endi.forms.third_party.base.tva_intracomm_validator(node, values)¶
validator for VAT number. Raise a colander.Invalid exception when the value is not a valid vat number.
endi.forms.third_party.customer module¶
Customer handling forms schemas and related widgets
- class endi.forms.third_party.customer.CustomerAddToProjectSchema(*args, **kw)¶
Bases :
SchemaSchema for project
- endi.forms.third_party.customer.company_employees_validator(node, company_id)¶
- endi.forms.third_party.customer.company_query_for_internal_customer(request)¶
Build a query to collect the company ids that we propose in the internal customer form
excludes already used company ids and current’s company id
- Renvoie:
a Sqlalchemy Query
- endi.forms.third_party.customer.get_add_edit_customer_schema(excludes=None, includes=None)¶
Build a generic add edit customer schema
- endi.forms.third_party.customer.get_company_customer_schema()¶
return the schema for user add/edit regarding the current user’s role
- endi.forms.third_party.customer.get_company_customers_from_request(request)¶
Extract a customers list from the request object
- Paramètres:
request (obj) – The pyramid request object
- Renvoie:
A list of customers
- Type renvoyé:
- endi.forms.third_party.customer.get_current_customer_id_from_request(request)¶
Return the current customer from the request object
- Paramètres:
request (obj) – The current pyramid request object
- endi.forms.third_party.customer.get_deferred_customer_select(query_func=<function get_company_customers_from_request>, item_builder=<function build_third_party_values>, default_option=None, **widget_options)¶
Dynamically build a deferred customer select with (or without) a void default value
- Paramètres:
query_func (function) – The query builder to get the customers (gets
request as argument) :param function item_builder: a function user :param 2-uple default_option: A default option to insert in the select options
- Renvoie:
A deferred customer Select2Widget
- endi.forms.third_party.customer.get_deferred_customer_select_validator(query_func=<function get_company_customers_from_request>, multiple=False)¶
- endi.forms.third_party.customer.get_deferred_default_customer(query_func)¶
- endi.forms.third_party.customer.get_individual_customer_schema() SQLAlchemySchemaNode¶
Build an individual customer form schema
- Renvoie:
The schema
- endi.forms.third_party.customer.get_internal_customer_addschema()¶
Build a schema to add an internal customer
- endi.forms.third_party.customer.get_internal_customer_editschema()¶
- endi.forms.third_party.customer.get_internal_customer_schema(edit=False)¶
- endi.forms.third_party.customer.get_list_schema()¶
Return the schema for the customer search list
endi.forms.third_party.supplier module¶
Supplier handling forms schemas and related widgets
- endi.forms.third_party.supplier.get_add_edit_supplier_schema(excludes=None, includes=None)¶
Build a generic add edit supplier schema
- endi.forms.third_party.supplier.get_company_suppliers_from_request(request)¶
Extract a suppliers list from the request object
- Paramètres:
request (obj) – The pyramid request object
- Renvoie:
A list of suppliers
- Type renvoyé:
- endi.forms.third_party.supplier.get_current_supplier_id_from_request(request)¶
Return the current supplier from the request object
- Paramètres:
request (obj) – The current pyramid request object
- endi.forms.third_party.supplier.get_deferred_default_supplier(query_func)¶
- endi.forms.third_party.supplier.get_deferred_supplier_select(query_func=<function get_company_suppliers_from_request>, item_builder=<function build_third_party_values>, default_option=None, **widget_options)¶
Dynamically build a deferred supplier select with (or without) a void default value
- Paramètres:
query_func (function) – The query builder to get the suppliers (gets
request as argument) :param function item_builder: a function user :param 2-uple default_option: A default option to insert in the select options
- Renvoie:
A deferred supplier Select2Widget
- endi.forms.third_party.supplier.get_deferred_supplier_select_validator(query_func=<function get_company_suppliers_from_request>)¶
- endi.forms.third_party.supplier.get_edit_internal_supplier_schema()¶
- endi.forms.third_party.supplier.get_list_schema()¶
Return the schema for the supplier search list
- endi.forms.third_party.supplier.get_supplier_schema()¶
return the schema for user add/edit regarding the current user’s role