onadata.apps.main package¶
Subpackages¶
- onadata.apps.main.management package
- Subpackages
- onadata.apps.main.management.commands package
- Submodules
- onadata.apps.main.management.commands.create_enketo_express_urls module
- onadata.apps.main.management.commands.create_metadata_for_kpi_deployed_forms module
- onadata.apps.main.management.commands.export_user_emails module
- onadata.apps.main.management.commands.get_accounts_with_duplicate_id_strings module
- onadata.apps.main.management.commands.mailer module
- onadata.apps.main.management.commands.migrate_audit_log module
- onadata.apps.main.management.commands.remove_odk_prefix module
- onadata.apps.main.management.commands.send_email_w_attachment module
- onadata.apps.main.management.commands.set_media_file_hash module
- onadata.apps.main.management.commands.update_enketo_urls module
- Module contents
- onadata.apps.main.management.commands package
- Module contents
- Subpackages
- onadata.apps.main.migrations package
- Submodules
- onadata.apps.main.migrations.0001_initial module
- onadata.apps.main.migrations.0002_auto_20150717_1149 module
- onadata.apps.main.migrations.0003_auto_20151015_0822 module
- onadata.apps.main.migrations.0004_auto_20160215_0345 module
- onadata.apps.main.migrations.0005_auto_20160404_0837 module
- onadata.apps.main.migrations.0006_auto_20160408_0325 module
- onadata.apps.main.migrations.0007_auto_20160418_0525 module
- onadata.apps.main.migrations.0008_auto_20180425_0754 module
- onadata.apps.main.migrations.0009_auto_20190125_0517 module
- onadata.apps.main.migrations.0010_auto_20220425_0313 module
- onadata.apps.main.migrations.0011_auto_20220510_0907 module
- onadata.apps.main.migrations.0012_metadata_extra_data module
- onadata.apps.main.migrations.0013_passwordhistory module
- onadata.apps.main.migrations.0014_update_enketo_old_ids module
- Module contents
- onadata.apps.main.models package
- Submodules
- onadata.apps.main.models.audit module
- onadata.apps.main.models.google_oath module
- onadata.apps.main.models.meta_data module
MetaData
MetaData.DoesNotExist
MetaData.MultipleObjectsReturned
MetaData.content_object
MetaData.content_type
MetaData.content_type_id
MetaData.data_file
MetaData.data_file_type
MetaData.data_license()
MetaData.data_type
MetaData.data_value
MetaData.date_created
MetaData.date_modified
MetaData.deleted_at
MetaData.enketo_preview_url()
MetaData.enketo_single_submit_url()
MetaData.enketo_url()
MetaData.external_export()
MetaData.external_export_name
MetaData.external_export_template
MetaData.external_export_url
MetaData.extra_data
MetaData.file_hash
MetaData.form_license()
MetaData.get_google_sheet_details()
MetaData.hash
MetaData.id
MetaData.instance_csv_imported_by()
MetaData.is_linked_dataset
MetaData.mapbox_layer_upload()
MetaData.media_add_uri()
MetaData.media_upload()
MetaData.object_id
MetaData.objects
MetaData.public_link()
MetaData.published_by_formbuilder()
MetaData.restore()
MetaData.save()
MetaData.set_google_sheet_details()
MetaData.set_hash()
MetaData.soft_delete()
MetaData.source()
MetaData.submission_review()
MetaData.supporting_docs()
MetaData.textit()
MetaData.textit_flow_details()
MetaData.update_or_create_export_register()
MetaData.xform_meta_permission()
clear_cached_metadata_instance_object()
create_media()
get_default_content_type()
is_valid_url()
media_resources()
save_metadata()
type_for_form()
unique_type_for_form()
update_attached_object()
upload_to()
- onadata.apps.main.models.password_history module
PasswordHistory
PasswordHistory.DoesNotExist
PasswordHistory.MultipleObjectsReturned
PasswordHistory.changed_at
PasswordHistory.get_next_by_changed_at()
PasswordHistory.get_previous_by_changed_at()
PasswordHistory.hashed_password
PasswordHistory.id
PasswordHistory.objects
PasswordHistory.user
PasswordHistory.user_id
PasswordHistory.user_pre_save()
- onadata.apps.main.models.user_profile module
UserProfile
UserProfile.DoesNotExist
UserProfile.MultipleObjectsReturned
UserProfile.address
UserProfile.city
UserProfile.country
UserProfile.created_by
UserProfile.created_by_id
UserProfile.date_modified
UserProfile.description
UserProfile.get_country_display()
UserProfile.get_next_by_date_modified()
UserProfile.get_previous_by_date_modified()
UserProfile.gravatar
UserProfile.gravatar_exists
UserProfile.home_page
UserProfile.id
UserProfile.metadata
UserProfile.name
UserProfile.num_of_submissions
UserProfile.objects
UserProfile.organization
UserProfile.organizationprofile
UserProfile.phonenumber
UserProfile.require_auth
UserProfile.save()
UserProfile.twitter
UserProfile.twitter_clean
UserProfile.user
UserProfile.user_id
UserProfile.userprofilegroupobjectpermission_set
UserProfile.userprofileuserobjectpermission_set
UserProfileGroupObjectPermission
UserProfileGroupObjectPermission.DoesNotExist
UserProfileGroupObjectPermission.MultipleObjectsReturned
UserProfileGroupObjectPermission.content_object
UserProfileGroupObjectPermission.content_object_id
UserProfileGroupObjectPermission.group
UserProfileGroupObjectPermission.group_id
UserProfileGroupObjectPermission.id
UserProfileGroupObjectPermission.permission
UserProfileGroupObjectPermission.permission_id
UserProfileUserObjectPermission
UserProfileUserObjectPermission.DoesNotExist
UserProfileUserObjectPermission.MultipleObjectsReturned
UserProfileUserObjectPermission.content_object
UserProfileUserObjectPermission.content_object_id
UserProfileUserObjectPermission.id
UserProfileUserObjectPermission.permission
UserProfileUserObjectPermission.permission_id
UserProfileUserObjectPermission.user
UserProfileUserObjectPermission.user_id
create_auth_token()
set_kpi_formbuilder_permissions()
set_object_permissions()
- Module contents
- onadata.apps.main.templatetags package
- onadata.apps.main.tests package
- Submodules
- onadata.apps.main.tests.test_audit_log module
- onadata.apps.main.tests.test_base module
- onadata.apps.main.tests.test_csv_export module
- onadata.apps.main.tests.test_custom_context_processors module
- onadata.apps.main.tests.test_form_api module
TestFormAPI
TestFormAPI.setUp()
TestFormAPI.test_api()
TestFormAPI.test_api_column_select()
TestFormAPI.test_api_cors_options()
TestFormAPI.test_api_count()
TestFormAPI.test_api_decode_from_mongo()
TestFormAPI.test_api_jsonp()
TestFormAPI.test_api_query_no_records()
TestFormAPI.test_api_with_or_query()
TestFormAPI.test_api_with_query()
TestFormAPI.test_api_with_query_invalid_start_limit()
TestFormAPI.test_api_with_query_start_limit()
TestFormAPI.test_handle_bad_json()
- onadata.apps.main.tests.test_form_api_delete module
- onadata.apps.main.tests.test_form_auth module
- onadata.apps.main.tests.test_form_edit module
TestFormEdit
TestFormEdit.setUp()
TestFormEdit.test_anon_no_edit_post()
TestFormEdit.test_delete_404()
TestFormEdit.test_not_owner_no_edit_post()
TestFormEdit.test_user_data_license_edit_updates()
TestFormEdit.test_user_description_edit_updates()
TestFormEdit.test_user_form_license_edit_updates()
TestFormEdit.test_user_title_edit_updates()
TestFormEdit.test_user_toggle_data_privacy()
TestFormEdit.test_user_toggle_data_privacy_off()
TestFormEdit.test_user_toggle_form_downloadable()
TestFormEdit.test_user_toggle_form_downloadable_off()
TestFormEdit.test_user_toggle_form_privacy()
TestFormEdit.test_user_toggle_form_privacy_off()
- onadata.apps.main.tests.test_form_enter_data module
- onadata.apps.main.tests.test_form_errors module
TestFormErrors
TestFormErrors.test_bad_id_string()
TestFormErrors.test_choice_duplicate_error()
TestFormErrors.test_dl_no_xls()
TestFormErrors.test_dl_xls_not_file()
TestFormErrors.test_empty_submission()
TestFormErrors.test_nonexist_id_string()
TestFormErrors.test_spaced_xlsform()
TestFormErrors.test_submission_deactivated()
- onadata.apps.main.tests.test_form_exports module
TestFormExports
TestFormExports.setUp()
TestFormExports.test_allow_csv_export()
TestFormExports.test_allow_csv_export_for_basic_auth()
TestFormExports.test_allow_csv_export_if_shared()
TestFormExports.test_allow_export_download_for_basic_auth()
TestFormExports.test_allow_kml_export()
TestFormExports.test_allow_kml_export_for_basic_auth()
TestFormExports.test_allow_kml_export_if_shared()
TestFormExports.test_allow_xlsx_export()
TestFormExports.test_allow_xlsx_export_for_basic_auth()
TestFormExports.test_allow_xlsx_export_if_shared()
TestFormExports.test_allow_zip_export()
TestFormExports.test_allow_zip_export_for_basic_auth()
TestFormExports.test_allow_zip_export_if_shared()
TestFormExports.test_csv_raw_export_name()
TestFormExports.test_filter_by_date_csv()
TestFormExports.test_filter_by_date_xls()
TestFormExports.test_restrict_csv_export_if_not_shared()
TestFormExports.test_restrict_kml_export_if_not_shared()
TestFormExports.test_restrict_xlsx_export_if_not_shared()
TestFormExports.test_restrict_zip_export_if_not_shared()
TestFormExports.test_xls_raw_export_name()
TestFormExports.test_zip_raw_export_name()
- onadata.apps.main.tests.test_form_gallery module
- onadata.apps.main.tests.test_form_metadata module
TestFormMetadata
TestFormMetadata.setUp()
TestFormMetadata.test_add_media_url()
TestFormMetadata.test_adds_mapbox_layer_on_submit()
TestFormMetadata.test_adds_supporting_doc_on_submit()
TestFormMetadata.test_adds_supporting_media_on_submit()
TestFormMetadata.test_anon_delete_mapbox_layer()
TestFormMetadata.test_delete_cached_xform_metadata_object_on_save()
TestFormMetadata.test_delete_mapbox_layer()
TestFormMetadata.test_delete_supporting_doc()
TestFormMetadata.test_delete_supporting_media()
TestFormMetadata.test_download_supporting_doc()
TestFormMetadata.test_download_supporting_media()
TestFormMetadata.test_media_file_hash()
TestFormMetadata.test_no_download_supporting_doc_for_anon()
TestFormMetadata.test_shared_download_supporting_doc_for_anon()
TestFormMetadata.test_shared_download_supporting_media_for_anon()
TestFormMetadata.test_shows_mapbox_layer_after_submit()
TestFormMetadata.test_shows_supporting_doc_after_submit()
TestFormMetadata.test_shows_supporting_media_after_submit()
TestFormMetadata.test_upload_source_file()
TestFormMetadata.test_upload_source_file_keep_name()
TestFormMetadata.test_upload_source_file_set_value_to_name()
TestFormMetadata.test_user_source_edit_updates()
TestFormMetadata.test_views_with_unavailable_id_string()
TestFormMetadata.test_windows_csv_file_upload()
- onadata.apps.main.tests.test_form_permissions module
TestFormPermissions
TestFormPermissions.setUp()
TestFormPermissions.test_add_edit_to_user()
TestFormPermissions.test_add_view_permisions_to_user()
TestFormPermissions.test_add_view_to_user()
TestFormPermissions.test_allow_map()
TestFormPermissions.test_allow_map_if_shared()
TestFormPermissions.test_allow_map_if_user_given_permission()
TestFormPermissions.test_anon_reject_api()
TestFormPermissions.test_client_allow_api()
TestFormPermissions.test_disallow_map_if_user_permission_revoked()
TestFormPermissions.test_only_access_shared_link_form()
TestFormPermissions.test_private_set_link_to_share_off()
TestFormPermissions.test_private_set_link_to_share_toggle_off()
TestFormPermissions.test_public_with_link_to_share()
TestFormPermissions.test_public_with_link_to_share_toggle_on()
TestFormPermissions.test_remove_permissions_from_user()
TestFormPermissions.test_require_owner_to_add_perm()
TestFormPermissions.test_restrict_map_for_anon()
TestFormPermissions.test_restrict_map_for_not_owner()
TestFormPermissions.test_set_permissions_for_user()
TestFormPermissions.test_show_list_of_users_shared_with()
TestFormPermissions.test_view_shared_form()
- onadata.apps.main.tests.test_form_public_api module
- onadata.apps.main.tests.test_form_show module
- onadata.apps.main.tests.test_gps module
- onadata.apps.main.tests.test_http_auth module
- onadata.apps.main.tests.test_metadata module
TestMetaData
TestMetaData.setUp()
TestMetaData.test_caches_cleared()
TestMetaData.test_create_google_sheet_metadata_object()
TestMetaData.test_create_metadata()
TestMetaData.test_restore_deleted()
TestMetaData.test_saving_same_metadata_object_doesnt_trigger_integrity_error()
TestMetaData.test_unique_type_for_form()
TestMetaData.test_upload_to_with_anonymous_user()
TestMetaData.test_upload_to_with_project_and_xform_instance()
- onadata.apps.main.tests.test_password_history module
- onadata.apps.main.tests.test_past_bugs module
- onadata.apps.main.tests.test_process module
- onadata.apps.main.tests.test_service_health module
- onadata.apps.main.tests.test_signals module
- onadata.apps.main.tests.test_user_id_string_unique_together module
- onadata.apps.main.tests.test_user_login module
- onadata.apps.main.tests.test_user_profile module
TestUserProfile
TestUserProfile.setup()
TestUserProfile.test_403_if_unauthorised_user_tries_to_access_api_token_link()
TestUserProfile.test_404_if_user_does_not_exist()
TestUserProfile.test_create_user_profile_for_user()
TestUserProfile.test_create_user_with_given_name()
TestUserProfile.test_disallow_non_alpha_numeric()
TestUserProfile.test_disallow_reserved_name()
TestUserProfile.test_show_single_at_sign_in_twitter_link()
TestUserProfile.test_xlsform_error_returns_400()
- onadata.apps.main.tests.test_user_settings module
- Module contents
Submodules¶
onadata.apps.main.backends module¶
A custom ModelBackend class module.
onadata.apps.main.context_processors module¶
google_analytics and site_name context processor functions.
- onadata.apps.main.context_processors.google_analytics(request)¶
Returns Google Analytics property id, domain and site verification settings.
- onadata.apps.main.context_processors.site_name(request)¶
Returns the SITE_NAME/
onadata.apps.main.forms module¶
forms module.
- onadata.apps.main.forms.ActivateSMSSupportFom¶
alias of
ActivateSMSSupportForm
- class onadata.apps.main.forms.ActivateSMSSupportForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Enable SMS support form.
- base_fields = {'enable_sms_support': <django.forms.fields.TypedChoiceField object>, 'sms_id_string': <django.forms.fields.CharField object>}¶
- clean_sms_id_string()¶
SMS id_string validation.
- declared_fields = {'enable_sms_support': <django.forms.fields.TypedChoiceField object>, 'sms_id_string': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.DataLicenseForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
” Data license form.
- base_fields = {'value': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'value': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.ExternalExportForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
XLS reports form.
- base_fields = {'template_name': <django.forms.fields.CharField object>, 'template_token': <django.forms.fields.URLField object>}¶
- declared_fields = {'template_name': <django.forms.fields.CharField object>, 'template_token': <django.forms.fields.URLField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.FormLicenseForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Form license form.
- base_fields = {'value': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'value': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.MapboxLayerForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Mapbox layers form.
- base_fields = {'attribution': <django.forms.fields.CharField object>, 'link': <django.forms.fields.URLField object>, 'map_name': <django.forms.fields.CharField object>}¶
- declared_fields = {'attribution': <django.forms.fields.CharField object>, 'link': <django.forms.fields.URLField object>, 'map_name': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.MediaForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Media file upload form.
- base_fields = {'media': <django.forms.fields.FileField object>}¶
- clean_media()¶
Validate media upload file.
- declared_fields = {'media': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.PermissionForm(username)¶
Bases:
Form
Permission assignment form.
- base_fields = {'for_user': <django.forms.fields.CharField object>, 'perm_type': <django.forms.fields.ChoiceField object>}¶
- declared_fields = {'for_user': <django.forms.fields.CharField object>, 'perm_type': <django.forms.fields.ChoiceField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverter(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
QuickConverterFile
,QuickConverterURL
,QuickConverterDropboxURL
,QuickConverterTextXlsForm
,QuickConverterCsvFile
,QuickConverterXmlFile
,QuickConverterFloipFile
Publish XLSForm and convert to XForm.
- base_fields = {'csv_url': <django.forms.fields.URLField object>, 'dropbox_xls_url': <django.forms.fields.URLField object>, 'floip_file': <django.forms.fields.FileField object>, 'project': <django.forms.fields.IntegerField object>, 'text_xls_form': <django.forms.fields.CharField object>, 'xls_file': <django.forms.fields.FileField object>, 'xls_url': <django.forms.fields.URLField object>, 'xml_file': <django.forms.fields.FileField object>}¶
- clean_project()¶
Project validation.
- declared_fields = {'csv_url': <django.forms.fields.URLField object>, 'dropbox_xls_url': <django.forms.fields.URLField object>, 'floip_file': <django.forms.fields.FileField object>, 'project': <django.forms.fields.IntegerField object>, 'text_xls_form': <django.forms.fields.CharField object>, 'xls_file': <django.forms.fields.FileField object>, 'xls_url': <django.forms.fields.URLField object>, 'xml_file': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- publish(user, id_string=None, created_by=None)¶
Publish XLSForm.
- validate = <django.core.validators.URLValidator object>¶
- class onadata.apps.main.forms.QuickConverterCsvFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads CSV XLSForm.
- base_fields = {'csv_url': <django.forms.fields.URLField object>}¶
- declared_fields = {'csv_url': <django.forms.fields.URLField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverterDropboxURL(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads XLSForm from Dropbox.
- base_fields = {'dropbox_xls_url': <django.forms.fields.URLField object>}¶
- declared_fields = {'dropbox_xls_url': <django.forms.fields.URLField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverterFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads XLSForm form.
- base_fields = {'xls_file': <django.forms.fields.FileField object>}¶
- declared_fields = {'xls_file': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverterFloipFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads a FLOIP results data package descriptor file.
- base_fields = {'floip_file': <django.forms.fields.FileField object>}¶
- declared_fields = {'floip_file': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverterTextXlsForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads Text XLSForm.
- base_fields = {'text_xls_form': <django.forms.fields.CharField object>}¶
- declared_fields = {'text_xls_form': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverterURL(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads XLSForm from a URL.
- base_fields = {'xls_url': <django.forms.fields.URLField object>}¶
- declared_fields = {'xls_url': <django.forms.fields.URLField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.QuickConverterXmlFile(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Uploads an XForm XML.
- base_fields = {'xml_file': <django.forms.fields.FileField object>}¶
- declared_fields = {'xml_file': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.RegistrationFormUserProfile(*args, **kwargs)¶
Bases:
RegistrationFormUniqueEmail
,UserProfileFormRegister
User profile registration form.
- RESERVED_USERNAMES = ['about', 'access', 'account', 'accounts', 'add', 'address', 'adm', 'admin', 'administration', 'adult', 'advertising', 'affiliate', 'affiliates', 'afsis', 'ajax', 'anal', 'analytics', 'android', 'anon', 'anonymous', 'anus', 'api', 'app', 'apps', 'archive', 'arse', 'ass', 'atom', 'auth', 'authentication', 'avatar', 'backup', 'balls', 'ballsack', 'banner', 'banners', 'bastard', 'biatch', 'billing', 'bin', 'bitch', 'blog', 'blogs', 'bloody', 'blow', 'blowjob', 'board', 'bollock', 'bollok', 'boner', 'boob', 'bot', 'bots', 'bugger', 'bum', 'business', 'butt', 'buttplug', 'c', 'cache', 'cadastro', 'calendar', 'campaign', 'careers', 'cgi', 'chat', 'client', 'cliente', 'clients', 'clitoris', 'cock', 'code', 'comercial', 'compare', 'compras', 'config', 'connect', 'contact', 'contest', 'coon', 'crap', 'create', 'css', 'cunt', 'damn', 'dashboard', 'data', 'db', 'delete', 'demo', 'design', 'designer', 'dev', 'devel', 'dick', 'dildo', 'dir', 'directory', 'doc', 'docs', 'domain', 'download', 'downloads', 'dyke', 'ecommerce', 'edit', 'editor', 'ei', 'email', 'end', 'enketo', 'f', 'fag', 'faq', 'favorite', 'feck', 'feed', 'feedback', 'felching', 'fellate', 'fellatio', 'file', 'files', 'flange', 'flog', 'follow', 'formhub', 'forms', 'forum', 'forums', 'free', 'ftp', 'fuck', 'fudge', 'fudgepacker', 'gadget', 'gadgets', 'games', 'group', 'groups', 'guest', 'hell', 'help', 'hit', 'home', 'homepage', 'homo', 'host', 'hosting', 'hostname', 'hpg', 'html', 'http', 'httpd', 'https', 'image', 'images', 'imap', 'img', 'index', 'indice', 'info', 'information', 'intranet', 'invite', 'ipad', 'iphone', 'irc', 'java', 'javascript', 'jerk', 'jizz', 'job', 'jobs', 'js', 'k', 'knob', 'knobend', 'knowledgebase', 'labia', 'list', 'lists', 'lmao', 'lmfao', 'log', 'login', 'logout', 'logs', 'mail', 'mail1', 'mail2', 'mail3', 'mail4', 'mail5', 'mailer', 'mailing', 'manager', 'maps', 'marketing', 'master', 'me', 'media', 'message', 'members', 'messenger', 'microblog', 'microblogs', 'mine', 'mob', 'mobile', 'modilabs', 'movie', 'movies', 'mp3', 'msg', 'msn', 'muff', 'music', 'musicas', 'mvp', 'mx', 'my', 'mysql', 'name', 'named', 'net', 'network', 'new', 'news', 'newsletter', 'nick', 'nickname', 'nigga', 'nigger', 'notes', 'noticias', 'ns', 'ns1', 'ns2', 'ns3', 'ns4', 'odk', 'oidc', 'old', 'omg', 'ona', 'online', 'operator', 'order', 'orders', 'packer', 'page', 'pager', 'pages', 'panel', 'password', 'penis', 'people', 'perl', 'photo', 'photoalbum', 'photos', 'php', 'pic', 'pics', 'piss', 'plugin', 'plugins', 'poop', 'pop', 'pop3', 'post', 'postfix', 'postmaster', 'posts', 'prick', 'profile', 'project', 'projects', 'promo', 'pub', 'pube', 'public', 'pussy', 'python', 'queer', 'random', 'register', 'registration', 'root', 'rss', 'ruby', 's', 'sale', 'sales', 'sample', 'samples', 'save', 'savethechildren', 'script', 'scripts', 'scrotum', 'search', 'secure', 'security', 'send', 'service', 'setting', 'settings', 'setup', 'sex', 'sh1t', 'shit', 'shop', 'signin', 'signout', 'signup', 'site', 'sitemap', 'sites', 'slut', 'smegma', 'smtp', 'soporte', 'spunk', 'sql', 'ssh', 'stage', 'staging', 'start', 'stat', 'static', 'stats', 'status', 'store', 'stores', 'subdomain', 'submission', 'submit', 'subscribe', 'suporte', 'support', 'syntax', 'system', 'tablet', 'tablets', 'talk', 'task', 'tasks', 'tech', 'telnet', 'test', 'test1', 'test2', 'test3', 'teste', 'tests', 'theme', 'themes', 'tit', 'tmp', 'todo', 'tools', 'tosser', 'turd', 'tv', 'twat', 'u', 'unesco', 'unicef', 'unido', 'update', 'upload', 'url', 'usage', 'user', 'username', 'users', 'usuario', 'vagina', 'vendas', 'video', 'videos', 'visitor', 'wank', 'wb', 'web', 'webmail', 'webmaster', 'website', 'websites', 'wfp', 'who', 'whore', 'win', 'workshop', 'worldbank', 'worldvision', 'wtf', 'ww', 'wws', 'www', 'www1', 'www2', 'www3', 'www4', 'www5', 'www6', 'www7', 'wwws', 'wwww', 'xls2xform', 'xpg', 'xxx', 'you', 'yourdomain', 'yourname', 'yoursite', 'yourusername']¶
- base_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}¶
- clean_username()¶
Validate a new user username.
- declared_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'password1': <django.forms.fields.CharField object>, 'password2': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}¶
- legal_usernames_re = re.compile('^\\w+$')¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.SourceForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Source document form.
- base_fields = {'source': <django.forms.fields.FileField object>}¶
- declared_fields = {'source': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.SupportDocForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
Supporting document.
- base_fields = {'doc': <django.forms.fields.FileField object>}¶
- declared_fields = {'doc': <django.forms.fields.FileField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.UserProfileForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)¶
Bases:
ModelForm
User profile form base class.
- class Meta¶
Bases:
object
- exclude = ('user', 'created_by', 'num_of_submissions')¶
- model¶
alias of
UserProfile
- base_fields = {'address': <django.forms.fields.CharField object>, 'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.TypedChoiceField object>, 'description': <django.forms.fields.CharField object>, 'email': <django.forms.fields.EmailField object>, 'home_page': <django.forms.fields.CharField object>, 'metadata': <django.forms.fields.JSONField object>, 'name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'phonenumber': <django.forms.fields.CharField object>, 'require_auth': <django.forms.fields.BooleanField object>, 'twitter': <django.forms.fields.CharField object>}¶
- clean_metadata()¶
Returns an empty dict if metadata is None.
- declared_fields = {'email': <django.forms.fields.EmailField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class onadata.apps.main.forms.UserProfileFormRegister(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)¶
Bases:
Form
User profile registration form.
- base_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>}¶
- declared_fields = {'city': <django.forms.fields.CharField object>, 'country': <django.forms.fields.ChoiceField object>, 'first_name': <django.forms.fields.CharField object>, 'home_page': <django.forms.fields.CharField object>, 'last_name': <django.forms.fields.CharField object>, 'organization': <django.forms.fields.CharField object>, 'twitter': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- save_user_profile(new_user)¶
Creates and returns a new_user profile.
- onadata.apps.main.forms.get_filename(response)¶
Get filename from a Content-Desposition header.
onadata.apps.main.registration_urls module¶
URLConf for Django user registration and authentication.
Recommended usage is a call to include()
in your project’s root
URLConf to include this URLConf for any URL beginning with
/accounts/
.
onadata.apps.main.registration_views module¶
FHRegistrationView class module.
- class onadata.apps.main.registration_views.FHRegistrationView(**kwargs)¶
Bases:
RegistrationView
A custom RegistrationView.
- register(form)¶
Given a username, email address and password, register a new user account, which will initially be inactive.
Along with the new
User
object, a newregistration.models.RegistrationProfile
will be created, tied to thatUser
, containing the activation key which will be used for this account.An email will be sent to the supplied email address; this email should contain an activation link. The email will be rendered using two templates. See the documentation for
RegistrationProfile.send_activation_email()
for information about these templates and the contexts provided to them.After the
User
andRegistrationProfile
are created and the activation email is sent, the signalregistration.signals.user_registered
will be sent, with the newUser
as the keyword argumentuser
and the class of this backend as the sender.
onadata.apps.main.signals module¶
signal module.
- onadata.apps.main.signals.accept_project_invitation(sender, instance=None, created=False, **kwargs)¶
Accept project invitations that match user email
- onadata.apps.main.signals.send_activation_email(sender, instance=None, **kwargs)¶
Sends activation email to user.
- onadata.apps.main.signals.send_inactive_user_email(sender, instance=None, created=False, **kwargs)¶
Sends email to inactive user upon account creation.
- onadata.apps.main.signals.set_api_permissions(sender, instance=None, created=False, **kwargs)¶
Sets API permissions for a user.
onadata.apps.main.urls module¶
URLs path.
onadata.apps.main.views module¶
Main views.
- class onadata.apps.main.views.OnaAuthorizationView(**kwargs)¶
Bases:
AuthorizationView
Overrides the AuthorizationView provided by oauth2_provider and adds the user to the context
- get_context_data(**kwargs)¶
Adds user and request_path to context and returns the context.
- onadata.apps.main.views.about_us(request)¶
The about us page view
- onadata.apps.main.views.activity(request, username)¶
The activity/audit view for the given
username
.
- onadata.apps.main.views.activity_api(request, username)¶
Returns Audit activity data in JSON format
- onadata.apps.main.views.activity_fields(request)¶
Returns Activity/Audit fields in JSON format.
- onadata.apps.main.views.api(request, username=None, id_string=None)¶
Returns all results as JSON. If a parameter string is passed, it takes the ‘query’ parameter, converts this string to a dictionary, an that is then used as a MongoDB query string.
NOTE: only a specific set of operators are allow, currently $or and $and. Please send a request if you’d like another operator to be enabled.
NOTE: Your query must be valid JSON, double check it here, http://json.parser.online.fr/
E.g. api?query=’{“last_name”: “Smith”}’
- onadata.apps.main.views.api_token(request, username=None)¶
Show user’s API Token page view.
- onadata.apps.main.views.clone_xlsform(request, username)¶
Copy a public/Shared form to a users list of forms. Eliminates the need to download Excel File and upload again.
- onadata.apps.main.views.dashboard(request)¶
Show the dashboard page view.
- onadata.apps.main.views.delete_data(request, username=None, id_string=None)¶
Delete submission record.
- onadata.apps.main.views.delete_metadata(request, username, id_string, data_id)¶
Deletes a metadata record.
- onadata.apps.main.views.download_media_data(request, username, id_string, data_id)¶
Redirects to a form metadata record for download.
- onadata.apps.main.views.download_metadata(request, username, id_string, data_id)¶
Downloads metadata file contents.
- onadata.apps.main.views.edit(request, username, id_string)¶
Edit form page view.
- onadata.apps.main.views.enketo_preview(request, username, id_string)¶
Redirects a user to the Enketo preview URL for the given form
id_string
.
- onadata.apps.main.views.faq(request)¶
The frequently asked questions page view.
- onadata.apps.main.views.form_gallery(request)¶
Return a list of urls for all the shared xls files. This could be made a lot prettier.
- onadata.apps.main.views.form_photos(request, username, id_string)¶
View form image attachments.
- onadata.apps.main.views.getting_started(request)¶
The getting started page view.
- onadata.apps.main.views.home(request)¶
Default landing view.
- onadata.apps.main.views.login_redirect(request)¶
Redirects a user to their profile page on successful login.
- onadata.apps.main.views.members_list(request)¶
Show members list page view.
- onadata.apps.main.views.privacy(request)¶
The privacy page view.
- onadata.apps.main.views.profile(request, username)¶
Show user profiles page view.
- onadata.apps.main.views.profile_settings(request, username)¶
User profile settings page view.
- onadata.apps.main.views.public_api(request, username, id_string)¶
Returns public information about the form as JSON
- onadata.apps.main.views.public_profile(request, username)¶
Show user’s public profile page view.
- onadata.apps.main.views.qrcode(request, username, id_string)¶
Returns the Enketo URL in QR code image format.
- onadata.apps.main.views.redirect_to_public_link(request, uuid)¶
Redirects to the public link of the form.
- onadata.apps.main.views.resources(request)¶
The resources page view.
- onadata.apps.main.views.service_health(request)¶
This endpoint checks whether the various services(Database, Cache, e.t.c ) of the application are running as expected. Returns a 200 Status code if all is well and a 500 if a service is down
- onadata.apps.main.views.set_perm(request, username, id_string)¶
Assign form permissions to a user.
- onadata.apps.main.views.set_xform_owner_data(data, xform, request, username, id_string)¶
Set xform owner page view.
- onadata.apps.main.views.show(request, username=None, id_string=None, uuid=None)¶
Show form page view.
- onadata.apps.main.views.support(request)¶
The support page view.
- onadata.apps.main.views.syntax(request)¶
The XLSForm Syntax page view.
- onadata.apps.main.views.tos(request)¶
The terms of service page view.
- onadata.apps.main.views.tutorial(request)¶
The tutorial page view.
- onadata.apps.main.views.update_xform(request, username, id_string)¶
Update a form page view.
- onadata.apps.main.views.username_list(request)¶
Show’s the list of usernames.
- onadata.apps.main.views.xls2xform(request)¶
The XLSForm to XForm page view.