endi.forms.project package¶
Submodules¶
endi.forms.project.business module¶
- class endi.forms.project.business.APIBusinessListSchema(*args, **kw)¶
Bases :
BaseListsSchema
- endi.forms.project.business.get_business_edit_schema()¶
Build the businedd edition schema
- Type renvoyé:
colander.Schema
- endi.forms.project.business.get_list_schema()¶
Return the schema for the project search form :rtype: colander.Schema
Module contents¶
Form schemas for project edition
- class endi.forms.project.APIBusinessListSchema(*args, **kw)¶
Bases :
BaseListsSchema
- class endi.forms.project.APIProjectListSchema(*args, **kw)¶
Bases :
BaseListsSchema
- class endi.forms.project.PhaseSchema(*args, **kw)¶
Bases :
SchemaSchema for phase
- class endi.forms.project.ProjectListSchema(*args, **kw)¶
Bases :
BaseListsSchema
- endi.forms.project.build_project_values(projects)¶
Build human understandable customer labels allowing efficient discrimination
- endi.forms.project.check_begin_end_date(form, value)¶
Check the project beginning date preceeds the end date
- endi.forms.project.customer_dictify(obj)¶
Return a representation of the current model, used to fill the associated form node
- endi.forms.project.customer_objectify(id_)¶
Objectify the associated form node schema (an id schemanode)
Return the customer object with the given id_
- Note :
colanderalchemy schemanode is to a model and provides a objectify methodused to convert an appstruct to the appropriate model. For the project->customer relationship, we need to be able to configure only existing elements. Since we didn’t found a clear way to do it with colanderalchemy, we add the node manually and fit the colanderalchemy way of working by implementing usefull methods (namely objectify and dictify)
- endi.forms.project.get_add_project_schema()¶
Build a schema for project add
- endi.forms.project.get_add_step2_project_schema()¶
Build a schema for the second step of project add
- endi.forms.project.get_business_type_options(request)¶
collect business types accessible for the current user
- endi.forms.project.get_compute_modes(request, project: Optional[Project] = None) list¶
Return the list of available compute modes
- Paramètres:
project – _description_, defaults to None
- Renvoie:
list of available compute mode options
- endi.forms.project.get_deferred_project_select(query_func=<function get_projects_from_request>, default_option=None, **widget_options)¶
Dynamically build a deferred project select with (or without) a void default value
- endi.forms.project.get_deferred_project_select_validator(query_func=<function get_projects_from_request>)¶
- endi.forms.project.get_edit_project_schema()¶
Return the project Edition/add form schema
- endi.forms.project.get_full_add_project_schema() SQLAlchemySchemaNode¶
Build an add project schema with all creation fields Used in the REST Api for adding project from js based UIs
- endi.forms.project.get_list_schema()¶
Return the schema for the project search form :rtype: colander.Schema
- endi.forms.project.get_project_type_options(request)¶
collect project type options
- endi.forms.project.get_projects_from_request(request)¶
Extract a projects list from the request object
- Paramètres:
request (obj) – The pyramid request object
- Renvoie:
A list of projects
- Type renvoyé:
- endi.forms.project.project_add_data_integrity(form, appstruct)¶
Check that the submitted data are compatible with each others
- endi.forms.project.project_node_factory(**kw)¶
Shortcut used to build a colander schema node
all arguments are optionnal
Allow following options :
any key under kw
colander.SchemaNode options :
title,
description,
default,
missing
…
widget_options
deform.widget.Select2Widget options as a dict
query_func
A callable expecting the request parameter and returning the current customer that should be selected
e.g:
>>> get_projects_from_request( title="Project", query_func=get_projects_list, default=get_current_project, widget_options={} )