backend.globaleaks.handlers.admin.field

Module Contents

Functions

fieldtree_ancestors(session, field_id) Transaction to extract the parents of a field
db_create_option_trigger(session, option_id, type, object_id, sufficient) Transaction for creating an option trigger
db_reset_option_triggers(session, type, object_id) Transaction for resetting every option trigger set on the specified object
db_update_fieldoption(session, field_id, fieldoption_id, option_dict, language, idx) Transaction to update a field option
db_update_fieldoptions(session, field_id, options, language) Transaction to update a set of options at once
db_update_fieldattr(session, field_id, attr_name, attr_dict, language) Transaction for updating a fieldattr
db_update_fieldattrs(session, field_id, field_attrs, language) Transaction to update a set of fieldattrs at once
check_field_association(session, tid, request) Transaction to check consistency of field association
db_create_field(session, tid, request, language) Transaction for creating a field
create_field(session, tid, request, language) Transaction for creating a field
db_update_field(session, tid, field_id, request, language) Transaction for updating a field
update_field(session, tid, field_id, field, language) Transaction for updating a field
delete_field(session, tid, field_id) Transaction to delete a field
get_fieldtemplate_list(session, tid, language) Transaction to retrieve the list of the field templates defined on a tenant
backend.globaleaks.handlers.admin.field.fieldtree_ancestors(session, field_id)[source]

Transaction to extract the parents of a field

Parameters:
  • session – An ORM session
  • field_id – The field ID
backend.globaleaks.handlers.admin.field.db_create_option_trigger(session, option_id, type, object_id, sufficient)[source]

Transaction for creating an option trigger

Parameters:
  • session – An ORM session
  • option_id – The option id
  • type – The trigger type
  • object_id – The object to be connected to the trigger
  • sufficient – A boolean indicating if the condition is sufficient
backend.globaleaks.handlers.admin.field.db_reset_option_triggers(session, type, object_id)[source]

Transaction for resetting every option trigger set on the specified object

Parameters:
  • session – An ORM session
  • type – The type of trigger to be reset
  • object_id – The object on which reset the triggers
backend.globaleaks.handlers.admin.field.db_update_fieldoption(session, field_id, fieldoption_id, option_dict, language, idx)[source]

Transaction to update a field option

Parameters:
  • session – An ORM session
  • field_id – The field ID of the field on which the option is set
  • fieldoption_id – The option ID
  • option_dict – The option configuration
  • language – The language of the request
  • idx – The order index with reference to the other options set
Returns:

The serialized descriptor of the option

backend.globaleaks.handlers.admin.field.db_update_fieldoptions(session, field_id, options, language)[source]

Transaction to update a set of options at once

Parameters:
  • session – An ORM session
  • field_id – The field on which the options are set
  • options – The list of options to be updated
  • language – The language of the request
backend.globaleaks.handlers.admin.field.db_update_fieldattr(session, field_id, attr_name, attr_dict, language)[source]

Transaction for updating a fieldattr

Parameters:
  • session – An ORM session
  • field_id – The field on which the attribute is configured
  • attr_name – The attribute name
  • attr_dict – The attribute configuration
  • language – The language of the request
Returns:

The ID of the attribute

backend.globaleaks.handlers.admin.field.db_update_fieldattrs(session, field_id, field_attrs, language)[source]

Transaction to update a set of fieldattrs at once

Parameters:
  • session – An ORM session
  • field_id – The field on which the fieldattrs are set
  • field_attrs – The list of fieldattrs to be updated
  • language – The language of the request
backend.globaleaks.handlers.admin.field.check_field_association(session, tid, request)[source]

Transaction to check consistency of field association

Parameters:
  • session – The ORM session
  • tid – The tenant ID
  • request – The request data to be verified
backend.globaleaks.handlers.admin.field.db_create_field(session, tid, request, language)[source]

Transaction for creating a field

Parameters:
  • session – An ORM session
  • tid – The tenant ID
  • request – The request data
  • language – The language of the request
Returns:

The created field

backend.globaleaks.handlers.admin.field.create_field(session, tid, request, language)[source]

Transaction for creating a field

Parameters:
  • session – An ORM session
  • tid – The tenant ID
  • request – The request data
  • language – The language of the request
Returns:

The serializated descriptor of the created field

backend.globaleaks.handlers.admin.field.db_update_field(session, tid, field_id, request, language)[source]

Transaction for updating a field

Parameters:
  • session – An ORM session
  • tid – The tenant ID
  • field_id – The ID of the object to be updated
  • request – The request data
  • language – The language of the request
Returns:

The updated field

backend.globaleaks.handlers.admin.field.update_field(session, tid, field_id, field, language)[source]

Transaction for updating a field :param session: An ORM session :param tid: The tenant ID :param request: The request data :param language: The language of the request :return: The serialized descriptor of the updated field

backend.globaleaks.handlers.admin.field.delete_field(session, tid, field_id)[source]

Transaction to delete a field

Parameters:
  • session – An ORM session
  • tid – The tenant ID
  • field_id – The id of the field to be deleted
backend.globaleaks.handlers.admin.field.get_fieldtemplate_list(session, tid, language)[source]

Transaction to retrieve the list of the field templates defined on a tenant

Parameters:
  • session – An ORM session
  • tid – The tenant ID on which perform the lookup
  • language – The language of the request
Returns:

The list of serialized field template descriptors

class backend.globaleaks.handlers.admin.field.FieldTemplatesCollection[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
cache_resource = True[source]
invalidate_cache = True[source]
get(self)[source]

Return a list of all the fields templates.

post(self)[source]

Create a field template.

class backend.globaleaks.handlers.admin.field.FieldTemplateInstance[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
invalidate_cache = True[source]
put(self, field_id)[source]

Update a field template

delete(self, field_id)[source]

Delete a field template.

class backend.globaleaks.handlers.admin.field.FieldsCollection[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
cache_resource = True[source]
invalidate_cache = True[source]
post(self)[source]

Create a field.

class backend.globaleaks.handlers.admin.field.FieldInstance[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
invalidate_cache = True[source]
put(self, field_id)[source]

Update a field.

delete(self, field_id)[source]

Delete a field.