onadata.libs.models package

Submodules

onadata.libs.models.base_model module

class onadata.libs.models.base_model.BaseModel(*args, **kwargs)

Bases: django.db.models.base.Model

class Meta

Bases: object

abstract = False

onadata.libs.models.clone_xform module

class onadata.libs.models.clone_xform.CloneXForm(xform, username, project=None)

Bases: object

save(**kwargs)
user

onadata.libs.models.share_project module

class onadata.libs.models.share_project.ShareProject(project, username, role, remove=False)

Bases: object

save(**kwargs)
user
onadata.libs.models.share_project.remove_dataview_permissions(project, user, role)
onadata.libs.models.share_project.remove_xform_permissions(project, user, role)

onadata.libs.models.share_team_project module

class onadata.libs.models.share_team_project.ShareTeamProject(team, project, role, remove=False)

Bases: object

remove_team()
save(**kwargs)

onadata.libs.models.share_xform module

class onadata.libs.models.share_xform.ShareXForm(xform, username, role)

Bases: object

save(**kwargs)
user

onadata.libs.models.signals module

onadata.libs.models.signals.add_tags_to_xform_instances(sender, **kwargs)
onadata.libs.models.signals.delete_tag_from_xform_instances(sender, **kwargs)

onadata.libs.models.sorting module

onadata.libs.models.sorting.json_order_by(sort_list)
onadata.libs.models.sorting.json_order_by_params(sort_list)
onadata.libs.models.sorting.sort_from_mongo_sort_str(sort_str)

onadata.libs.models.textit_service module

TextItService model: sets up all properties for interaction with TextIt or RapidPro.

class onadata.libs.models.textit_service.TextItService(xform, service_url=None, name=None, auth_token=None, flow_uuid=None, contacts=None, pk=None)

Bases: object

TextItService model: access/create/update RestService and MetaData objects with all properties for TextIt or RapidPro like services.

retrieve()

Sets the textit or rapidpro properties from the MetaData object. The properties are:

  • auth_token
  • flow_uuid
  • contacts
save()

Creates and updates RestService and MetaData objects with textit or rapidpro service properties.

Module contents