├── .codeclimate.yml ├── .coveragerc ├── .dockerignore ├── .flake8 ├── .github ├── graphql-inspector.yaml ├── pull_request_template.md └── workflows │ ├── ci.yml │ ├── codeql-analysis.yml │ └── flake8.yml ├── .gitignore ├── .python-version ├── .travis-old.yml ├── .vscode └── settings.json ├── Dockerfile ├── LICENSE.txt ├── README.md ├── apps ├── __init__.py ├── analysis │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filter_set.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_alter_analysispillar_filters.py │ │ ├── 0002_auto_20210409_1021.py │ │ ├── 0003_auto_20210519_0922.py │ │ ├── 0004_merge_20210603_0624.py │ │ ├── 0005_auto_20210629_0732.py │ │ ├── 0006_auto_20210708_0404.py │ │ ├── 0007_alter_analyticalstatemententry_unique_together.py │ │ ├── 0008_analyticalstatementngram_automaticsummary_topicmodel_topicmodelcluster.py │ │ ├── 0009_auto_20230411_0440.py │ │ ├── 0010_analyticalstatementgeoentry_analyticalstatementgeotask.py │ │ ├── 0011_analysisreport_analysisreportcontainer_analysisreportcontainerdata_analysisreportsnapshot_analysisre.py │ │ ├── 0012_remove_analysisreportcontainer_content_style.py │ │ ├── 0013_alter_analysisreportcontainer_content_type.py │ │ ├── 0013_alter_analysisreportcontainer_content_type_squashed_0017_merge_20240318_0519.py │ │ ├── 0013_auto_20240315_0501.py │ │ ├── 0014_alter_analysisreportcontainer_content_type.py │ │ ├── 0014_alter_analyticalstatement_title.py │ │ ├── 0015_analysisreportcontainerdata_client_reference_id.py │ │ ├── 0015_auto_20240531_0504.py │ │ ├── 0016_alter_analysisreportcontainer_content_type.py │ │ ├── 0016_auto_20240716_0943.py │ │ ├── 0017_auto_20240716_1050.py │ │ ├── 0017_merge_20240318_0519.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── public_schema.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── analysis_report │ │ │ ├── data.json │ │ │ ├── error1.json │ │ │ └── error2.json │ │ ├── test_apis.py │ │ ├── test_mutations.py │ │ └── test_schemas.py │ ├── types │ │ └── __init__.py │ └── views.py ├── analysis_framework │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── export.py │ ├── factories.py │ ├── filter_set.py │ ├── fixtures │ │ └── af_roles.json │ ├── management │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── add_af_owner_roles.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20171006_0746.py │ │ ├── 0003_auto_20171013_1259.py │ │ ├── 0004_filter_filter_type.py │ │ ├── 0005_auto_20171025_0828.py │ │ ├── 0006_auto_20171124_0629.py │ │ ├── 0007_widget_key.py │ │ ├── 0008_auto_20171124_1115.py │ │ ├── 0009_analysisframework_description.py │ │ ├── 0010_auto_20171208_0617.py │ │ ├── 0011_auto_20171211_1104.py │ │ ├── 0012_filter_widget_key.py │ │ ├── 0013_auto_20171227_0755.py │ │ ├── 0014_auto_20180107_0538.py │ │ ├── 0015_auto_20180111_1049.py │ │ ├── 0016_auto_20180216_0931.py │ │ ├── 0017_auto_20180314_1014.py │ │ ├── 0018_analysisframework_client_id.py │ │ ├── 0019_auto_20181031_0600.py │ │ ├── 0020_auto_20190625_0542.py │ │ ├── 0022_auto_20190711_0747.py │ │ ├── 0023_remove_analysisframeworkrole_can_make_public.py │ │ ├── 0024_auto_20190712_0845.py │ │ ├── 0025_analysisframeworkrole_is_private_role.py │ │ ├── 0026_analysisframework_properties.py │ │ ├── 0027_auto_20190726_0512.py │ │ ├── 0028_auto_20190802_0634.py │ │ ├── 0029_auto_20200117_0853.py │ │ ├── 0030_auto_20210503_0431.py │ │ ├── 0030_auto_20210506_1055.py │ │ ├── 0031_merge_0030_auto_20210503_0431_0030_auto_20210506_1055.py │ │ ├── 0032_auto_20210730_0641.py │ │ ├── 0033_auto_20210817_0458.py │ │ ├── 0034_widget_version.py │ │ ├── 0035_auto_20211130_0516.py │ │ ├── 0036_analysisframeworkrole_type.py │ │ ├── 0037_analysisframework_assisted_tagging_enabled.py │ │ ├── 0038_analysisframework_export.py │ │ ├── 0039_analysisframework_cloned_from.py │ │ ├── 0040_auto_20231109_1208.py │ │ ├── 0041_widget_mapping.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── permissions.py │ ├── public_schema.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ ├── snap_test_mutations.py │ │ │ └── snap_test_schemas.py │ │ ├── test_apis.py │ │ ├── test_filters.py │ │ ├── test_mutations.py │ │ ├── test_roles_api.py │ │ └── test_schemas.py │ ├── utils.py │ ├── views.py │ └── widgets │ │ ├── __init__.py │ │ ├── conditional_widget.py │ │ ├── date_range_widget.py │ │ ├── date_widget.py │ │ ├── geo_widget.py │ │ ├── matrix1d_widget.py │ │ ├── matrix2d_widget.py │ │ ├── multiselect_widget.py │ │ ├── number_matrix_widget.py │ │ ├── number_widget.py │ │ ├── organigram_widget.py │ │ ├── scale_widget.py │ │ ├── select_widget.py │ │ ├── store.py │ │ ├── text_widget.py │ │ ├── time_range_widget.py │ │ └── time_widget.py ├── ary │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── enums.py │ ├── export │ │ ├── __init__.py │ │ ├── affected_groups_info.py │ │ ├── common.py │ │ ├── data_collection_techniques_info.py │ │ ├── locations_info.py │ │ ├── questionaire.py │ │ ├── scoring.py │ │ ├── stakeholders_info.py │ │ └── summary.py │ ├── factories.py │ ├── filters.py │ ├── fixtures │ │ └── ary_template_data.json │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── export_ary_template.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20180223_0607.py │ │ ├── 0003_auto_20180223_0610.py │ │ ├── 0004_auto_20180223_0614.py │ │ ├── 0005_auto_20180223_0622.py │ │ ├── 0006_auto_20180223_0632.py │ │ ├── 0007_auto_20180223_0643.py │ │ ├── 0008_auto_20180312_1207.py │ │ ├── 0009_auto_20180330_0706.py │ │ ├── 0010_auto_20180330_0707.py │ │ ├── 0011_auto_20180330_0709.py │ │ ├── 0012_auto_20180330_0716.py │ │ ├── 0013_auto_20180405_1109.py │ │ ├── 0014_auto_20180416_0944.py │ │ ├── 0014_auto_20180417_1023.py │ │ ├── 0015_auto_20180417_1029.py │ │ ├── 0016_auto_20180418_1054.py │ │ ├── 0017_auto_20180418_1056.py │ │ ├── 0018_merge_20180419_0410.py │ │ ├── 0019_auto_20180419_0455.py │ │ ├── 0020_assessment_score.py │ │ ├── 0021_auto_20180420_0557.py │ │ ├── 0022_scorebucket.py │ │ ├── 0023_auto_20180507_0603.py │ │ ├── 0024_auto_20180510_0723.py │ │ ├── 0024_auto_20180510_0913.py │ │ ├── 0025_merge_20180511_1023.py │ │ ├── 0026_auto_20180514_1006.py │ │ ├── 0027_auto_20180713_0733.py │ │ ├── 0028_assessment_project.py │ │ ├── 0029_auto_20180824_1014.py │ │ ├── 0030_auto_20180824_1018.py │ │ ├── 0031_auto_20181227_0506.py │ │ ├── 0032_auto_20190125_0911.py │ │ ├── 0032_underlyingfactor.py │ │ ├── 0033_merge_20190127_1110.py │ │ ├── 0034_auto_20190210_0639.py │ │ ├── 0035_auto_20190517_0448.py │ │ ├── 0036_auto_20190612_1113.py │ │ ├── 0037_assessment_questionnaire.py │ │ ├── 0038_auto_20191122_0502.py │ │ ├── 0039_auto_20210503_0431.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── schema.py │ ├── serializers.py │ ├── stats.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_apis.py │ │ ├── test_mutations.py │ │ ├── test_permissions.py │ │ └── test_schemas.py │ ├── utils.py │ └── views.py ├── assessment_registry │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dashboard_schema.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filter_set.py │ ├── filters.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── generate_dummy_assessments.py │ │ │ └── migrate_old_assessments.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20230710_0533.py │ │ ├── 0003_auto_20230719_0934.py │ │ ├── 0003_remove_assessmentregistry_affected_groups.py │ │ ├── 0004_assessmentregistry_affected_groups.py │ │ ├── 0005_auto_20230719_0801.py │ │ ├── 0006_auto_20230719_1044.py │ │ ├── 0007_alter_additionaldocument_external_link.py │ │ ├── 0007_auto_20230731_1422.py │ │ ├── 0008_remove_assessmentregistry_locations.py │ │ ├── 0009_assessmentregistry_locations.py │ │ ├── 0010_additionaldocument_file_path.py │ │ ├── 0011_remove_additionaldocument_file_path.py │ │ ├── 0012_merge_20230802_0953.py │ │ ├── 0013_auto_20230803_0222.py │ │ ├── 0014_alter_scorerating_score_type.py │ │ ├── 0015_auto_20230803_0608.py │ │ ├── 0016_alter_assessmentregistry_protection_info_mgmts.py │ │ ├── 0017_auto_20230803_1253.py │ │ ├── 0018_scoreanalyticaldensity_figure_provided.py │ │ ├── 0019_auto_20230804_0944.py │ │ ├── 0020_alter_summaryfocus_options.py │ │ ├── 0021_auto_20230808_1125.py │ │ ├── 0022_auto_20230809_0512.py │ │ ├── 0023_alter_assessmentregistry_protection_info_mgmts.py │ │ ├── 0024_alter_summary_assessment_registry.py │ │ ├── 0025_summaryfocus_focus.py │ │ ├── 0026_auto_20230811_0908.py │ │ ├── 0027_auto_20230811_0941.py │ │ ├── 0028_alter_assessmentregistry_stakeholders.py │ │ ├── 0029_auto_20230814_0609.py │ │ ├── 0030_auto_20230817_0446.py │ │ ├── 0031_auto_20230823_0509.py │ │ ├── 0032_auto_20230823_0635.py │ │ ├── 0033_rename_sub_dimmension_summaryissue_sub_dimension.py │ │ ├── 0034_auto_20230825_0906.py │ │ ├── 0035_remove_summarysubdimensionissue_focus.py │ │ ├── 0036_rename_focus_summaryfocus_sector.py │ │ ├── 0037_auto_20230912_1157.py │ │ ├── 0038_auto_20230915_0803.py │ │ ├── 0039_auto_20231005_1039.py │ │ ├── 0040_scoreanalyticaldensity_score.py │ │ ├── 0041_alter_scorerating_score_type.py │ │ ├── 0042_alter_assessmentregistry_affected_groups.py │ │ ├── 0043_auto_20231220_1003.py │ │ ├── 0044_auto_20231221_0508.py │ │ ├── 0045_auto_20231227_1056.py │ │ ├── 0046_alter_assessmentregistry_lead.py │ │ ├── 0047_alter_assessmentregistry_lead.py │ │ ├── 0048_auto_20240215_0642.py │ │ ├── 0049_assessmentregistry_protection_risks.py │ │ ├── 0050_alter_scoreanalyticaldensity_score.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── schema.py │ ├── serializers.py │ ├── tests │ │ ├── __init__.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ └── snap_test_mutation.py │ │ ├── test_dashboard_schema.py │ │ ├── test_mutation.py │ │ └── test_schemas.py │ ├── utils.py │ └── views.py ├── assisted_tagging │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_rename_is_depricated_assistedtaggingmodelpredictiontag_is_deprecated.py │ │ ├── 0003_assistedtaggingmodelpredictiontag_hide_in_analysis_framework_mapping.py │ │ ├── 0004_draftentry_lead.py │ │ ├── 0005_auto_20220309_0446.py │ │ ├── 0006_auto_20220309_0949.py │ │ ├── 0007_auto_20220309_1458.py │ │ ├── 0008_auto_20220310_1042.py │ │ ├── 0009_alter_assistedtaggingmodelpredictiontag_group.py │ │ ├── 0010_draftentry_related_geoareas.py │ │ ├── 0011_draftentry_draft_entry_type.py │ │ ├── 0011_draftentry_draft_entry_type_squashed_0013_rename_draft_entry_type_draftentry_type.py │ │ ├── 0012_auto_20231222_0554.py │ │ ├── 0012_draftentry_is_discarded.py │ │ ├── 0013_llmassistedtaggingpredication.py │ │ ├── 0013_rename_draft_entry_type_draftentry_type.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ └── tests │ │ ├── snapshots │ │ ├── __init__.py │ │ └── snap_test_query.py │ │ └── test_query.py ├── bulk_data_migration │ ├── __init__.py │ ├── apps.py │ ├── entry_images │ │ └── migrate.py │ ├── entry_images_v2 │ │ └── migrate.py │ ├── management │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── bulk_migrate.py │ │ │ ├── classify_leads.py │ │ │ ├── entries_highlight_migrate.py │ │ │ ├── generate_preview.py │ │ │ ├── update_attribute_for_scale_export.py │ │ │ └── update_attribute_for_widget.py │ └── v1_2 │ │ ├── __init__.py │ │ ├── ary.py │ │ ├── excerpt.py │ │ ├── geo.py │ │ ├── matrix1d.py │ │ ├── matrix2d.py │ │ ├── migrate.py │ │ ├── number_matrix.py │ │ ├── organigram.py │ │ ├── projects.py │ │ └── scale.py ├── category_editor │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_categoryeditor_title.py │ │ ├── 0003_auto_20180216_0931.py │ │ ├── 0004_categoryeditor_client_id.py │ │ ├── 0005_alter_categoryeditor_data.py │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── tests │ │ ├── __init__.py │ │ └── test_apis.py │ └── views.py ├── client_page_meta │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20181202_0553.py │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── tests.py │ └── views.py ├── commons │ ├── __init__.py │ ├── apps.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── clear_cache.py │ │ │ └── run_celery_dev.py │ ├── receivers.py │ ├── schema_snapshots.py │ ├── tests │ │ └── test_common.py │ └── views.py ├── connector │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── create_connector_sources.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20180713_0733.py │ │ ├── 0003_auto_20180802_0622.py │ │ ├── 0004_auto_20180912_1002.py │ │ ├── 0005_auto_20190828_0947.py │ │ ├── 0006_emmconfig.py │ │ ├── 0007_delete_emmentity.py │ │ ├── 0008_auto_20190829_0538.py │ │ ├── 0009_auto_20190904_0516.py │ │ ├── 0010_connectorsource.py │ │ ├── 0011_add_sources.py │ │ ├── 0012_auto_20191107_0424.py │ │ ├── 0013_connector_source_obj.py │ │ ├── 0014_auto_20191107_0426.py │ │ ├── 0015_remove_connector_source.py │ │ ├── 0016_auto_20191107_0500.py │ │ ├── 0017_auto_20191107_0526.py │ │ ├── 0018_alter_connector_params.py │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── sources │ │ ├── __init__.py │ │ └── store.py │ ├── tests │ │ ├── __init__.py │ │ ├── connector_content_mock_data.py │ │ └── test_apis.py │ ├── utils.py │ └── views.py ├── deduplication │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── factories.py │ ├── migrations │ │ ├── 0001_initial.py │ │ └── __init__.py │ ├── models.py │ ├── receivers.py │ ├── tasks │ │ ├── __init__.py │ │ └── indexing.py │ ├── tests │ │ ├── __init__.py │ │ └── test_tasks.py │ └── utils.py ├── deep_explore │ ├── apps.py │ ├── enums.py │ ├── filter_set.py │ ├── management │ │ └── commands │ │ │ └── update_deep_explore_data.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_publicexploreyearsnapshot.py │ │ ├── 0003_auto_20230217_1057.py │ │ ├── 0004_auto_20230227_0912.py │ │ └── __init__.py │ ├── models.py │ ├── schema.py │ ├── tasks.py │ └── tests.py ├── deep_migration │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── migrate_af_changes_v2_v3.py │ │ │ ├── migrate_analysis_framework.py │ │ │ ├── migrate_entry.py │ │ │ ├── migrate_geo.py │ │ │ ├── migrate_lead.py │ │ │ ├── migrate_project.py │ │ │ ├── migrate_user.py │ │ │ └── migrate_user_group.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20180114_0727.py │ │ ├── 0003_auto_20180114_0730.py │ │ ├── 0004_auto_20180114_0810.py │ │ ├── 0005_projectmigration.py │ │ ├── 0006_usermigration.py │ │ ├── 0007_auto_20180114_1533.py │ │ ├── 0008_leadmigration.py │ │ ├── 0009_analysisframeowrkmigration.py │ │ ├── 0010_auto_20180115_0613.py │ │ ├── 0011_auto_20180115_0613.py │ │ ├── 0012_entrymigration.py │ │ ├── 0013_auto_20180121_1025.py │ │ ├── 0014_usergroupmigration.py │ │ └── __init__.py │ ├── models.py │ └── utils.py ├── deepl_integration │ ├── apps.py │ ├── handlers.py │ ├── models.py │ ├── serializers.py │ └── views.py ├── docs │ ├── __init__.py │ ├── inspectors.py │ └── utils.py ├── entry │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── errors.py │ ├── exceptions.py │ ├── factories.py │ ├── filter_set.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20171006_0748.py │ │ ├── 0003_auto_20171013_1259.py │ │ ├── 0004_entry_entry_type.py │ │ ├── 0005_auto_20180102_0457.py │ │ ├── 0006_entry_information_date.py │ │ ├── 0007_auto_20180124_1100.py │ │ ├── 0008_auto_20180215_0850.py │ │ ├── 0009_auto_20180322_0916.py │ │ ├── 0010_entry_client_id.py │ │ ├── 0011_entry_project.py │ │ ├── 0012_auto_20180824_0943.py │ │ ├── 0013_auto_20180824_1018.py │ │ ├── 0014_auto_20181025_1501.py │ │ ├── 0014_auto_20181031_0600.py │ │ ├── 0015_auto_20181025_1502.py │ │ ├── 0015_auto_20181031_0602.py │ │ ├── 0016_merge_20181120_0612.py │ │ ├── 0017_auto_20190306_0617.py │ │ ├── 0018_auto_20190507_0507.py │ │ ├── 0019_entry-attribute-fix.py │ │ ├── 0020_entrycomment_entrycommenttext.py │ │ ├── 0021_auto_20191230_1029.py │ │ ├── 0022_auto_20200110_0609.py │ │ ├── 0023_filterdata_text.py │ │ ├── 0024_auto_20200630_0702.py │ │ ├── 0025_entry-comment-assignee-to-assignees.py │ │ ├── 0026_remove_entrycomment_assignee.py │ │ ├── 0027_entry_verified.py │ │ ├── 0028_auto_20200914_1146.py │ │ ├── 0029_auto_20210112_0935.py │ │ ├── 0029_auto_20210503_0431.py │ │ ├── 0029_entry_approved_by.py │ │ ├── 0030_auto_20210427_0507.py │ │ ├── 0030_merge_0029_auto_20210112_0935_0029_auto_20210503_0431.py │ │ ├── 0031_entry-migrate-verify-to-review-comment.py │ │ ├── 0032_merge_20210506_0840.py │ │ ├── 0033_merge_20210805_0715.py │ │ ├── 0034_attribute_widget_version.py │ │ ├── 0035_alter_filterdata_number.py │ │ ├── 0036_entry_draft_entry.py │ │ ├── 0036_entry_excerpt_modified.py │ │ ├── 0037_merge_20220401_0527.py │ │ ├── 0038_auto_20240709_0417.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── pagination.py │ ├── receivers.py │ ├── schema.py │ ├── serializers.py │ ├── stats.py │ ├── tests │ │ ├── __init__.py │ │ ├── entry_widget_test_data.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ └── snap_test_mutations.py │ │ ├── test_apis.py │ │ ├── test_comprehensive_apis.py │ │ ├── test_entry_comment.py │ │ ├── test_migrations.py │ │ ├── test_mutations.py │ │ ├── test_permissions.py │ │ └── test_schemas.py │ ├── utils.py │ ├── views.py │ └── widgets │ │ ├── __init__.py │ │ ├── conditional_widget.py │ │ ├── date_range_widget.py │ │ ├── date_widget.py │ │ ├── geo_widget.py │ │ ├── matrix1d_widget.py │ │ ├── matrix2d_widget.py │ │ ├── multiselect_widget.py │ │ ├── number_matrix_widget.py │ │ ├── number_widget.py │ │ ├── organigram_widget.py │ │ ├── scale_widget.py │ │ ├── select_widget.py │ │ ├── store.py │ │ ├── text_widget.py │ │ ├── time_range_widget.py │ │ ├── time_widget.py │ │ └── utils.py ├── export │ ├── admin.py │ ├── analyses │ │ ├── __init__.py │ │ └── excel_exporter.py │ ├── apps.py │ ├── assessments │ │ ├── __init__.py │ │ └── excel_exporter.py │ ├── entries │ │ ├── __init__.py │ │ ├── excel_exporter.py │ │ ├── json_exporter.py │ │ └── report_exporter.py │ ├── enums.py │ ├── exporters.py │ ├── factories.py │ ├── filter_set.py │ ├── formats │ │ ├── __init__.py │ │ ├── docx.py │ │ └── xlsx.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20171228_0738.py │ │ ├── 0003_export_mime_type.py │ │ ├── 0004_auto_20180116_0630.py │ │ ├── 0005_auto_20180227_0511.py │ │ ├── 0006_auto_20180706_1021.py │ │ ├── 0006_auto_20180707_1206.py │ │ ├── 0007_merge_20180708_0706.py │ │ ├── 0008_auto_20190426_0853.py │ │ ├── 0009_export_status.py │ │ ├── 0010_auto_20200106_0909.py │ │ ├── 0011_export_is_archived.py │ │ ├── 0011_export_is_deleted.py │ │ ├── 0012_merge_20201229_0900.py │ │ ├── 0013_auto_20210120_0443.py │ │ ├── 0013_auto_20210409_0423.py │ │ ├── 0013_auto_20210503_0431.py │ │ ├── 0014_merge_20210419_0941.py │ │ ├── 0015_merge_20210603_0624.py │ │ ├── 0016_auto_20211027_0928.py │ │ ├── 0017_export_extra_options.py │ │ ├── 0018_auto_20220111_0953.py │ │ ├── 0019_auto_20220511_0632.py │ │ ├── 0020_alter_export_type.py │ │ ├── 0021_auto_20230105_1048.py │ │ └── __init__.py │ ├── mime_types.py │ ├── models.py │ ├── mutation.py │ ├── schema.py │ ├── serializers.py │ ├── tasks │ │ ├── __init__.py │ │ ├── tasks_analyses.py │ │ ├── tasks_assessment.py │ │ ├── tasks_entries.py │ │ └── tasks_projects.py │ ├── tests │ │ ├── __init__.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ └── snap_test_mutations.py │ │ ├── test_apis.py │ │ ├── test_mutations.py │ │ ├── test_schemas.py │ │ └── test_xlsx.py │ └── views.py ├── gallery │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── calculate_and_store_file_size.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20171016_0957.py │ │ ├── 0003_auto_20171016_0957.py │ │ ├── 0004_file_mime_type.py │ │ ├── 0005_auto_20171217_0707.py │ │ ├── 0006_filepreview.py │ │ ├── 0007_auto_20171230_0850.py │ │ ├── 0008_auto_20171230_0853.py │ │ ├── 0009_auto_20171230_0858.py │ │ ├── 0010_auto_20180216_0931.py │ │ ├── 0011_auto_20180405_1109.py │ │ ├── 0012_auto_20180507_0913.py │ │ ├── 0013_file_client_id.py │ │ ├── 0014_file_random_string.py │ │ ├── 0015_add_uuid_20190802_0902.py │ │ ├── 0016_populate_file_uuid_20190802_0912.py │ │ ├── 0017_uuid_unique_20190802_0921.py │ │ ├── 0018_auto_20191217_0608.py │ │ ├── 0019_auto_20210120_0443.py │ │ ├── 0019_auto_20210503_0431.py │ │ ├── 0020_merge_0019_auto_20210120_0443_0019_auto_20210503_0431.py │ │ └── __init__.py │ ├── models.py │ ├── mutations.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_apis.py │ │ ├── test_mutations.py │ │ └── test_tasks.py │ ├── utils.py │ └── views.py ├── geo │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filter_set.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── retrigger_geo_cache.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20170907_0850.py │ │ ├── 0003_auto_20170907_0949.py │ │ ├── 0004_region_code.py │ │ ├── 0005_auto_20170907_1204.py │ │ ├── 0006_auto_20170920_0902.py │ │ ├── 0007_auto_20170922_0551.py │ │ ├── 0008_remove_geoarea_name.py │ │ ├── 0009_auto_20170926_0533.py │ │ ├── 0010_auto_20170926_0550.py │ │ ├── 0011_auto_20171004_0818.py │ │ ├── 0012_auto_20171013_1259.py │ │ ├── 0013_auto_20171114_1117.py │ │ ├── 0014_auto_20171121_0549.py │ │ ├── 0015_auto_20171210_0602.py │ │ ├── 0016_auto_20171210_0606.py │ │ ├── 0017_auto_20171210_0947.py │ │ ├── 0018_auto_20171210_0952.py │ │ ├── 0019_auto_20171210_0955.py │ │ ├── 0020_adminlevel_level.py │ │ ├── 0021_adminlevel_stale_geo_areas.py │ │ ├── 0022_auto_20171218_1057.py │ │ ├── 0023_adminlevel_tolerance.py │ │ ├── 0024_auto_20180107_0538.py │ │ ├── 0025_auto_20180124_1100.py │ │ ├── 0026_auto_20180228_0656.py │ │ ├── 0027_auto_20180325_0739.py │ │ ├── 0028_auto_20180330_0953.py │ │ ├── 0029_region_client_id.py │ │ ├── 0030_auto_20180912_1002.py │ │ ├── 0031_adminlevel_geo_area_titles.py │ │ ├── 0032_merge_20181212_0553.py │ │ ├── 0033_auto_20190429_0541.py │ │ ├── 0034_auto_20190429_0624.py │ │ ├── 0035_auto_20190730_0518.py │ │ ├── 0036_auto_20190730_0617.py │ │ ├── 0037_auto_20210503_0431.py │ │ ├── 0038_auto_20210702_0636.py │ │ ├── 0039_region_centroid.py │ │ ├── 0040_region_cache_index.py │ │ ├── 0041_geoarea_centroid.py │ │ ├── 0042_rename_data_geoarea_cached_data.py │ │ ├── 0043_create-unaccent_extension.py │ │ ├── 0044_region_status.py │ │ └── __init__.py │ ├── models.py │ ├── mutations.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_apis.py │ │ ├── test_celery.py │ │ ├── test_mutations.py │ │ ├── test_schemas.py │ │ └── test_tasks.py │ └── views.py ├── jwt_auth │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── authentication.py │ ├── captcha.py │ ├── errors.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── tests │ │ ├── __init__.py │ │ └── test_apis.py │ ├── token.py │ └── views.py ├── lang │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── import_lang.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20180506_1206.py │ │ ├── 0003_auto_20180519_0706.py │ │ ├── 0004_auto_20200207_1233.py │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── tests │ │ ├── __init__.py │ │ └── test_apis.py │ └── views.py ├── lead │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filter_set.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20170929_1201.py │ │ ├── 0003_auto_20171004_0818.py │ │ ├── 0004_auto_20171006_0733.py │ │ ├── 0005_auto_20171013_1259.py │ │ ├── 0006_auto_20171016_1028.py │ │ ├── 0007_leadpreview_leadpreviewimage.py │ │ ├── 0008_auto_20171104_0920.py │ │ ├── 0009_lead_source_type.py │ │ ├── 0010_lead_classified_doc_id.py │ │ ├── 0011_auto_20171221_0642.py │ │ ├── 0012_auto_20180102_0457.py │ │ ├── 0013_auto_20180107_0538.py │ │ ├── 0014_auto_20180114_1641.py │ │ ├── 0015_auto_20180115_0852.py │ │ ├── 0016_auto_20180216_0931.py │ │ ├── 0017_auto_20180410_0405.py │ │ ├── 0018_auto_20180510_0903.py │ │ ├── 0019_auto_20180713_0733.py │ │ ├── 0020_auto_20180925_0528.py │ │ ├── 0020_lead_tabular_book.py │ │ ├── 0021_auto_20180928_0753.py │ │ ├── 0021_auto_20181228_0942.py │ │ ├── 0022_merge_20190110_0605.py │ │ ├── 0022_remove_lead_tabular_book.py │ │ ├── 0023_merge_20190205_1043.py │ │ ├── 0024_lead_author.py │ │ ├── 0025_auto_20190828_0949.py │ │ ├── 0025_auto_20190906_0907.py │ │ ├── 0025_auto_20190912_0420.py │ │ ├── 0026_auto_20190828_1055.py │ │ ├── 0026_auto_20190906_0927.py │ │ ├── 0027_auto_20190904_0516.py │ │ ├── 0028_auto_20190912_0446.py │ │ ├── 0029_merge_20190918_0941.py │ │ ├── 0030_auto_20191118_1046.py │ │ ├── 0031_auto_20191118_1438.py │ │ ├── 0032_lead_authors.py │ │ ├── 0033_auto_20200715_0546.py │ │ ├── 0034_lead_priority.py │ │ ├── 0035_auto_20201204_1259.py │ │ ├── 0036_lead_is_assessment_lead.py │ │ ├── 0037_auto_20210715_0432.py │ │ ├── 0038_lead_extraction_status.py │ │ ├── 0039_lead_connector_lead.py │ │ ├── 0039_remove_lead_website.py │ │ ├── 0040_alter_lead_confidentiality.py │ │ ├── 0041_merge_20220512_0415.py │ │ ├── 0042_lead_uuid.py │ │ ├── 0043_alter_lead_uuid.py │ │ ├── 0044_usersavedleadfilter.py │ │ ├── 0045_lead_duplicate_leads.py │ │ ├── 0046_auto_20230120_0543.py │ │ ├── 0047_auto_20230228_0809.py │ │ ├── 0048_auto_20230228_0810.py │ │ ├── 0049_auto_20231121_0926.py │ │ ├── 0049_auto_20231121_0926_squashed_0054_auto_20231218_0552.py │ │ ├── 0050_auto_20240621_1149.py │ │ ├── 0050_delete_extractedlead.py │ │ ├── 0051_auto_20231128_0958.py │ │ ├── 0051_auto_20240625_0509.py │ │ ├── 0052_auto_20231130_0615.py │ │ ├── 0053_alter_lead_auto_entry_extraction_status.py │ │ ├── 0054_auto_20231218_0552.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── public_schema.py │ ├── receivers.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ └── snap_test_mutations.py │ │ ├── test_apis.py │ │ ├── test_filters.py │ │ ├── test_migrations.py │ │ ├── test_mutations.py │ │ ├── test_permissions.py │ │ ├── test_schemas.py │ │ ├── test_tasks.py │ │ └── test_unit.py │ ├── typings.py │ └── views.py ├── notification │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filter_set.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20181130_0857.py │ │ ├── 0003_auto_20181227_0506.py │ │ ├── 0004_auto_20191217_0608.py │ │ ├── 0005_auto_20200930_0652.py │ │ ├── 0006_assignment.py │ │ ├── 0007_alter_notification_data.py │ │ ├── 0007_auto_20210427_0507.py │ │ ├── 0008_merge_20210805_0715.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── receivers │ │ ├── __init__.py │ │ ├── assignment.py │ │ ├── entry_comment.py │ │ └── project_membership.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── templatetags │ │ ├── __init__.py │ │ └── deep_notification_tags.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_apis.py │ │ ├── test_mutation.py │ │ ├── test_notification.py │ │ └── test_schemas.py │ └── views.py ├── organization │ ├── __init__.py │ ├── actions.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── forms.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── load_organizations.py │ │ │ └── update_organization_popularity.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20180510_0650.py │ │ ├── 0003_auto_20180510_0711.py │ │ ├── 0004_organization_donor.py │ │ ├── 0005_auto_20190416_0713.py │ │ ├── 0006_auto_20190425_0510.py │ │ ├── 0007_remove_organization_donor.py │ │ ├── 0008_auto_20190912_0901.py │ │ ├── 0009_auto_20191111_0845.py │ │ ├── 0010_organizationtype_short_name.py │ │ ├── 0011_organization_source.py │ │ ├── 0012_organization_popularity.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── public_schema.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_mutations.py │ │ └── test_schemas.py │ └── views.py ├── profiling │ ├── __init__.py │ ├── apps.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── test_profile.py │ └── profiler.py ├── project │ ├── __init__.py │ ├── activity.py │ ├── admin.py │ ├── apps.py │ ├── change_log.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filter_set.py │ ├── fixtures │ │ └── project_roles.json │ ├── forms.py │ ├── management │ │ └── commands │ │ │ └── generate_projects_viz_stats.py │ ├── migrations │ │ ├── 0001_auto_20220708_1137.py │ │ ├── 0001_initial.py │ │ ├── 0001_project_is_test.py │ │ ├── 0002_auto_20170907_1204.py │ │ ├── 0002_projectchangelog.py │ │ ├── 0003_auto_20170919_1137.py │ │ ├── 0003_auto_20230508_0608.py │ │ ├── 0004_auto_20170921_0753.py │ │ ├── 0004_project_enable_publicly_viewable_analysis_report_snapshot.py │ │ ├── 0004_project_is_assessment_enabled.py │ │ ├── 0005_auto_20171004_0818.py │ │ ├── 0005_merge_20231227_0610.py │ │ ├── 0005_projectpinned.py │ │ ├── 0006_project_analysis_framework.py │ │ ├── 0006_projectpinned_modified_at.py │ │ ├── 0007_auto_20171013_1259.py │ │ ├── 0007_merge_20240218_0618.py │ │ ├── 0008_alter_projectpinned_unique_together.py │ │ ├── 0008_auto_20171114_1117.py │ │ ├── 0009_auto_20171121_0804.py │ │ ├── 0010_auto_20171129_0601.py │ │ ├── 0011_project_category_editor.py │ │ ├── 0012_auto_20180216_0931.py │ │ ├── 0013_project_assessment_template.py │ │ ├── 0014_auto_20180308_0630.py │ │ ├── 0015_project_dummy.py │ │ ├── 0016_auto_20180320_1145.py │ │ ├── 0017_auto_20180410_0405.py │ │ ├── 0018_projectjoinrequest.py │ │ ├── 0019_projectmembership_added_by.py │ │ ├── 0020_auto_20180604_0732.py │ │ ├── 0021_projectstatus_projectstatuscondition.py │ │ ├── 0022_auto_20180605_0822.py │ │ ├── 0023_auto_20180605_0827.py │ │ ├── 0024_auto_20180612_0859.py │ │ ├── 0025_project_status.py │ │ ├── 0025_projectjoinrequest_role.py │ │ ├── 0026_auto_20180707_1209.py │ │ ├── 0027_merge_20180708_0706.py │ │ ├── 0028_project_client_id.py │ │ ├── 0029_auto_20180913_1050.py │ │ ├── 0029_projectrole.py │ │ ├── 0030_auto_20180815_0743.py │ │ ├── 0030_auto_20180913_1050.py │ │ ├── 0031_auto_20180815_0817.py │ │ ├── 0031_remove_project_user_groups.py │ │ ├── 0032_auto_20180815_0825.py │ │ ├── 0032_auto_20180913_1100.py │ │ ├── 0033_auto_20180815_0832.py │ │ ├── 0033_auto_20180913_1107.py │ │ ├── 0034_auto_20180815_1013.py │ │ ├── 0034_auto_20180913_1116.py │ │ ├── 0035_auto_20180815_1014.py │ │ ├── 0036_auto_20180815_1015.py │ │ ├── 0037_auto_20180815_1014.py │ │ ├── 0038_auto_20180819_1038.py │ │ ├── 0039_projectrole_assessment_permissions.py │ │ ├── 0040_auto_20180902_0709.py │ │ ├── 0041_merge_20180930_0624.py │ │ ├── 0042_auto_20181011_0631.py │ │ ├── 0043_auto_20181011_0952.py │ │ ├── 0044_auto_20181012_0653.py │ │ ├── 0045_projectmembership_is_role_modified.py │ │ ├── 0046_projectusergroupmembership_role.py │ │ ├── 0047_auto_20181123_0554.py │ │ ├── 0048_auto_20181123_0928.py │ │ ├── 0049_projectrole_level.py │ │ ├── 0050_auto_20181127_0954.py │ │ ├── 0051_auto_20181127_1005.py │ │ ├── 0052_auto_20181127_1015.py │ │ ├── 0053_auto_20181127_1114.py │ │ ├── 0054_auto_20181227_0506.py │ │ ├── 0055_project_is_private.py │ │ ├── 0056_projectentrystats.py │ │ ├── 0057_view_only_unprotected_role.py │ │ ├── 0058_projectarystats.py │ │ ├── 0059_auto_20191202_0826.py │ │ ├── 0060_project_is_visualization_enabled.py │ │ ├── 0061_projectarystats_confidential_file.py │ │ ├── 0062_auto_20200715_1015.py │ │ ├── 0062_auto_20200804_0810.py │ │ ├── 0063_auto_20200715_1131.py │ │ ├── 0063_projectjoinrequest_data_squashed_0064_auto_20200902_0438.py │ │ ├── 0064_merge_20200917_1003.py │ │ ├── 0065_project_stats_cache.py │ │ ├── 0066_projectstats_token.py │ │ ├── 0067_auto_20210406_0916.py │ │ ├── 0067_auto_20210503_0431.py │ │ ├── 0068_project_status.py │ │ ├── 0069_projectstats_public_share.py │ │ ├── 0070_merge_20210603_0624.py │ │ ├── 0070_projectmembership_badges.py │ │ ├── 0071_projectusergroupmembership_badges.py │ │ ├── 0072_merge_20210805_0715.py │ │ ├── 0073_alter_projectjoinrequest_unique_together.py │ │ ├── 0074_projectrole_type.py │ │ ├── 0075_project_has_publicly_viewable_leads.py │ │ ├── 0076_auto_20220520_0834.py │ │ ├── 0076_auto_20220524_0523.py │ │ ├── 0077_merge_0076_auto_20220520_0834_0076_auto_20220524_0523.py │ │ ├── __init__.py │ │ ├── rename_duplicate_project_name.py │ │ ├── set_is_assessment_enabled_true.py │ │ └── set_istest_true_for_test_projects.py │ ├── mixins.py │ ├── models.py │ ├── mutation.py │ ├── permissions.py │ ├── public_schema.py │ ├── receivers.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── entry_stats_data.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ ├── snap_test_mutations.py │ │ │ └── snap_test_schemas.py │ │ ├── test_apis.py │ │ ├── test_filters.py │ │ ├── test_migration.py │ │ ├── test_mutations.py │ │ ├── test_schemas.py │ │ └── test_utils.py │ ├── token.py │ ├── views.py │ └── widgets.py ├── quality_assurance │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_entryreviewcomment_created_at.py │ │ ├── 0003_entryreviewcomment_entry_comment.py │ │ ├── 0004_entry_comment_to_qa_comment.py │ │ ├── 0005_alter_entryreviewcomment_entry.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── schema.py │ ├── serializers.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_apis.py │ │ ├── test_mutations.py │ │ └── test_schemas.py │ └── views.py ├── questionnaire │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── filter_set.py │ ├── fixtures │ │ └── qb_crisis_types.json │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20200114_0805.py │ │ ├── 0003_question_is_archived_squashed_0010_auto_20200217_0748.py │ │ ├── 0004_auto_20200504_0952.py │ │ ├── 0005_auto_20200505_0827.py │ │ ├── 0006_auto_20200519_0913.py │ │ ├── 0007_auto_20200519_0915.py │ │ ├── 0008_auto_20200519_0922.py │ │ ├── 0009_auto_20210503_0431.py │ │ └── __init__.py │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── utils │ │ ├── __init__.py │ │ ├── kobo_toolbox.py │ │ ├── openrosa2html5form.xsl │ │ ├── openrosa2xmlmodel.xsl │ │ └── xls_form.py │ └── views.py ├── redis_store │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ └── __init__.py │ ├── models.py │ ├── redis.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_redis.py │ │ └── tests.py │ └── views.py ├── static │ ├── css │ │ └── admin_extend.css │ ├── doc_export │ │ ├── template.docx │ │ └── template_02.docx │ ├── image │ │ ├── deep-logo-long.png │ │ ├── deep-logo.png │ │ ├── deep_chart_preview.png │ │ ├── drop-icon.png │ │ ├── graphQL-logo.svg │ │ ├── skype.png │ │ ├── slack.png │ │ └── zendesk.png │ └── js │ │ └── jsoneditor-init.js ├── tabular │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── extractor │ │ ├── __init__.py │ │ ├── csv.py │ │ ├── ods.py │ │ ├── xls.py │ │ └── xlsx.py │ ├── filters.py │ ├── migrations │ │ ├── 0001_squashed_0005_auto_20181024_0626.py │ │ ├── 0002_auto_20181024_0902.py │ │ ├── 0003_remove_book_pending.py │ │ ├── 0004_auto_20181024_1303.py │ │ ├── 0005_auto_20181025_0634.py │ │ ├── 0006_auto_20181026_0624.py │ │ ├── 0007_auto_20181028_1012.py │ │ ├── 0008_geodata.py │ │ ├── 0009_auto_20181121_0626.py │ │ ├── 0010_remove_sheet_data.py │ │ ├── 0011_sheet_data.py │ │ ├── 0012_auto_20190107_0512.py │ │ ├── 0013_auto_20190131_0852.py │ │ ├── 0013_auto_20190131_1019.py │ │ ├── 0014_merge_20190205_0951.py │ │ ├── 0015_remove_book_meta_status.py │ │ ├── 0016_auto_20190218_1920.py │ │ ├── 0017_field_cache.py │ │ ├── 0018_auto_20190308_1400.py │ │ ├── 0019_auto_20190313_0705.py │ │ ├── 0020_sheet_data_row_index.py │ │ ├── 0021_auto_20190611_1129.py │ │ ├── 0022_auto_20210503_0431.py │ │ └── __init__.py │ ├── models.py │ ├── receivers.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ └── test_unit.py │ ├── utils.py │ ├── views.py │ └── viz │ │ ├── __init__.py │ │ ├── barchart.py │ │ ├── histograms.py │ │ ├── map.py │ │ ├── renderer.py │ │ ├── timeseries.py │ │ └── wordcloud.py ├── templates │ ├── admin │ │ ├── base_site.html │ │ ├── filter.html │ │ ├── organization_change_list.html │ │ └── submit_line.html │ ├── ary │ │ └── ary_change_list.html │ ├── base.html │ ├── base_email.html │ ├── entry │ │ ├── comment_notification_email.html │ │ ├── comment_notification_email.txt │ │ ├── review_comment_notification_email.html │ │ └── review_comment_notification_email.txt │ ├── home │ │ └── welcome.html │ ├── organization │ │ ├── merge_confirmation.html │ │ └── merge_tree_view.html │ ├── password_changed │ │ ├── email.html │ │ └── subject.txt │ ├── project │ │ ├── project_join_accept.txt │ │ ├── project_join_accept_email.html │ │ ├── project_join_reject.txt │ │ ├── project_join_reject_email.html │ │ ├── project_join_request.txt │ │ ├── project_join_request_confirm.html │ │ ├── project_join_request_email.html │ │ └── project_viz.html │ ├── registration │ │ ├── base_email.html │ │ ├── password_reset_confirm.html │ │ ├── password_reset_email.html │ │ ├── password_reset_subject.txt │ │ ├── user_activation_confirm.html │ │ ├── user_activation_email.html │ │ └── user_activation_subject.txt │ ├── rest_framework │ │ ├── api.html │ │ └── login_base.html │ └── user │ │ └── unsubscribe_email__confirm.html ├── unified_connector │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20220303_1143.py │ │ ├── 0003_alter_connectorleadpreviewimage_connector_lead.py │ │ ├── 0004_connectorlead_website.py │ │ ├── 0005_auto_20220426_0906.py │ │ ├── 0006_alter_connectorsource_source.py │ │ ├── 0007_alter_connectorsource_source.py │ │ ├── 0008_connectorlead_text_extraction_id.py │ │ ├── 0009_auto_20240621_1149.py │ │ ├── 0010_auto_20240625_0806.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── schema.py │ ├── serializers.py │ ├── sources │ │ ├── acaps_briefing_notes.py │ │ ├── atom_feed.py │ │ ├── base.py │ │ ├── emm.py │ │ ├── humanitarian_response.py │ │ ├── pdna.py │ │ ├── relief_web.py │ │ ├── research_center.py │ │ ├── rss_feed.py │ │ ├── unhcr_portal.py │ │ └── wpf.py │ ├── tasks.py │ └── tests │ │ ├── __init__.py │ │ ├── mock_data │ │ ├── atom_feed_mock_data.py │ │ ├── emm_mock_data.py │ │ ├── humanitarian_response_mock_data.py │ │ ├── pdna_mock_data.py │ │ ├── relief_web_mock_data.py │ │ ├── rss_feed_mock_data.py │ │ ├── store.py │ │ └── unhcr_mock_data.py │ │ ├── snapshots │ │ ├── __init__.py │ │ └── snap_test_mutation.py │ │ ├── test_mutation.py │ │ ├── test_query.py │ │ └── test_source.py ├── user │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── fixtures │ │ └── features.json │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_profile_hid.py │ │ ├── 0003_auto_20171016_1028.py │ │ ├── 0004_auto_20171129_0851.py │ │ ├── 0005_auto_20180107_0538.py │ │ ├── 0006_profile_last_active_project.py │ │ ├── 0007_profile_login_attempts.py │ │ ├── 0008_auto_20180308_0630.py │ │ ├── 0009_profile_language.py │ │ ├── 0010_profile_receive_email.py │ │ ├── 0011_auto_20180802_0608.py │ │ ├── 0012_auto_20181120_0559.py │ │ ├── 0013_profile_experimental.py │ │ ├── 0014_auto_20190212_0443.py │ │ ├── 0015_auto_20190221_0525.py │ │ ├── 0016_profile_invalid_email.py │ │ ├── 0017_emaildomain_feature_featureaccess.py │ │ ├── 0018_auto_20190624_1017.py │ │ ├── 0019_auto_20190626_0605.py │ │ ├── 0020_auto_20190626_0609.py │ │ ├── 0021_auto_20191111_1200.py │ │ ├── 0022_auto_20191217_0608.py │ │ ├── 0023_auto_20200120_0834.py │ │ ├── 0024_feature_is_available_for_all.py │ │ ├── 0025_alter_feature_key.py │ │ ├── 0026_alter_feature_key.py │ │ ├── 0027_alter_feature_key.py │ │ ├── 0028_auto_20220714_1012.py │ │ ├── 0029_auto_20230508_0608.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── notifications.py │ ├── permissions.py │ ├── receivers.py │ ├── schema.py │ ├── serializers.py │ ├── tasks.py │ ├── tests │ │ ├── __init__.py │ │ ├── test_apis.py │ │ ├── test_password.py │ │ └── test_schemas.py │ ├── token.py │ ├── utils.py │ ├── validators.py │ └── views.py ├── user_group │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── dataloaders.py │ ├── enums.py │ ├── factories.py │ ├── filters.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20170907_0949.py │ │ ├── 0003_auto_20171114_1112.py │ │ ├── 0004_auto_20171114_1117.py │ │ ├── 0005_usergroup_project_specific_fields.py │ │ ├── 0006_auto_20171122_0522.py │ │ ├── 0007_usergroup_description.py │ │ ├── 0008_remove_usergroup_display_picture.py │ │ ├── 0009_usergroup_display_picture.py │ │ ├── 0010_auto_20180410_0405.py │ │ ├── 0011_groupmembership_added_by.py │ │ ├── 0012_auto_20180604_0732.py │ │ ├── 0013_alter_usergroup_custom_project_fields.py │ │ ├── 0013_auto_20210621_1515.py │ │ ├── 0014_merge_20210625_0417.py │ │ └── __init__.py │ ├── models.py │ ├── mutation.py │ ├── receivers.py │ ├── schema.py │ ├── serializers.py │ ├── tests │ │ ├── __init__.py │ │ ├── snapshots │ │ │ ├── __init__.py │ │ │ └── snap_test_mutations.py │ │ ├── test_apis.py │ │ ├── test_mutations.py │ │ └── test_schemas.py │ └── views.py └── user_resource │ ├── __init__.py │ ├── admin.py │ ├── apps.py │ ├── filters.py │ ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20170921_0753.py │ └── __init__.py │ ├── models.py │ ├── schema.py │ ├── serializers.py │ └── views.py ├── codecov.yml ├── deep ├── __init__.py ├── admin.py ├── authentication.py ├── caches.py ├── celery.py ├── compiler.py ├── context_processor.py ├── converters.py ├── dataloaders.py ├── deepl.py ├── documents_types.py ├── enums.py ├── error_codes.py ├── errors.py ├── exception_handler.py ├── exceptions.py ├── filter_set.py ├── graphene_context.py ├── graphene_converter.py ├── managers.py ├── middleware.py ├── models.py ├── number_generator.py ├── paginations.py ├── permalinks.py ├── permissions.py ├── s3_storages.py ├── schema.py ├── serializers.py ├── ses.py ├── settings.py ├── tasks.py ├── test_files │ ├── documents │ │ ├── doc.docx │ │ ├── doc.docx.txt │ │ ├── doc.pdf │ │ ├── doc.pdf.txt │ │ ├── doc.pptx │ │ ├── doc.pptx.txt │ │ └── pages.json │ ├── documents_attachment │ │ ├── doc.docx.txt │ │ ├── doc.pdf.txt │ │ └── doc.pptx.txt │ ├── documents_urls │ │ ├── 3227553.txt │ │ ├── demo.docx.txt │ │ ├── pages.json │ │ ├── pdf-sample.pdf.txt │ │ ├── powerpoint.pptx.txt │ │ └── rehabilitation-services-urgently-needed-prevent-disability.txt │ ├── geo.json │ ├── mock_draftentry.json │ └── nepal-geo-json │ │ ├── Nepal.NPL.NP.geo.json │ │ ├── NepalDevelopment_Region.geo.json │ │ ├── admin_level2.geo.json │ │ └── admin_level3.geo.json ├── tests │ ├── __init__.py │ ├── test_api_exception.py │ ├── test_case.py │ ├── test_fake.py │ └── test_views.py ├── token.py ├── trackers.py ├── urls.py ├── views.py ├── writable_nested_serializers.py └── wsgi.py ├── deploy ├── configs │ ├── log_files.yml-sample │ └── uwsgi.ini ├── cronjobs └── scripts │ ├── in_web_env.sh │ ├── run_web.sh │ └── run_worker.sh ├── gh-docker-compose.yml ├── manage.py ├── mypy.ini ├── poetry.lock ├── postgres └── Dockerfile ├── pyproject.toml ├── pytest.ini ├── schema.graphql ├── scripts ├── list_relief_web_countries.sh ├── run_tests.sh ├── run_web.sh └── run_worker.sh └── utils ├── __init__.py ├── aws.py ├── common.py ├── data_structures.py ├── date_extractor.py ├── db ├── __init__.py └── functions.py ├── external_storages ├── __init__.py ├── dropbox.py └── google_drive.py ├── extractor ├── __init__.py ├── document.py ├── exception.py ├── extractors.py ├── file_document.py ├── formats │ ├── __init__.py │ ├── docx.py │ ├── html.py │ ├── ods.py │ ├── pdf.py │ └── xlsx.py ├── tests │ ├── __init__.py │ ├── test_extractors.py │ ├── test_file_document.py │ └── test_web_document.py └── web_document.py ├── files.py ├── graphene ├── __init__.py ├── dataloaders.py ├── enums.py ├── error_types.py ├── fields.py ├── filters.py ├── geo_scalars.py ├── middleware.py ├── mutation.py ├── options.py ├── pagination.py ├── resolver.py ├── tests.py └── types.py ├── hid ├── __init__.py ├── hid.py └── tests │ ├── __init__.py │ └── test_hid.py ├── image.py ├── logger.py ├── request.py ├── sentry.py ├── tests.py └── web_info_extractor ├── __init__.py ├── base.py ├── default.py └── redhum.py /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = C901, W504 3 | max-line-length = 125 4 | exclude = .git,__pycache__,old,build,dist,*/migrations/*.py 5 | max-complexity = 10 6 | per-file-ignores = 7 | /**/tests/*_mock_data.py: E501 8 | **/snap_test_*.py: E501 9 | -------------------------------------------------------------------------------- /.github/graphql-inspector.yaml: -------------------------------------------------------------------------------- 1 | diff: 2 | failOnBreaking: true 3 | 4 | schema: 'schema.graphql' 5 | -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.8.10 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.linting.mypyEnabled": true, 3 | "python.linting.enabled": true, 4 | "python.formatting.provider": "true" 5 | } 6 | -------------------------------------------------------------------------------- /apps/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/__init__.py -------------------------------------------------------------------------------- /apps/analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis/__init__.py -------------------------------------------------------------------------------- /apps/analysis/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AnalysisConfig(AppConfig): 5 | name = 'analysis' 6 | -------------------------------------------------------------------------------- /apps/analysis/migrations/0002_alter_analysispillar_filters.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-05-03 04:31 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='analysispillar', 15 | name='filters', 16 | field=models.JSONField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/analysis/migrations/0004_merge_20210603_0624.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-03 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis', '0002_alter_analysispillar_filters'), 10 | ('analysis', '0003_auto_20210519_0922'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/analysis/migrations/0007_alter_analyticalstatemententry_unique_together.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-06-22 09:00 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis', '0006_auto_20210708_0404'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterUniqueTogether( 14 | name='analyticalstatemententry', 15 | unique_together=set(), 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/analysis/migrations/0012_remove_analysisreportcontainer_content_style.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-30 04:48 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis', '0011_analysisreport_analysisreportcontainer_analysisreportcontainerdata_analysisreportsnapshot_analysisre'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='analysisreportcontainer', 15 | name='content_style', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/analysis/migrations/0014_alter_analyticalstatement_title.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2024-04-03 09:32 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis', '0013_auto_20240315_0501'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='analyticalstatement', 15 | name='title', 16 | field=models.CharField(blank=True, max_length=150, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/analysis/migrations/0017_merge_20240318_0519.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2024-03-18 05:19 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis', '0013_auto_20240315_0501'), 10 | ('analysis', '0016_alter_analysisreportcontainer_content_type'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/analysis/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis/migrations/__init__.py -------------------------------------------------------------------------------- /apps/analysis/public_schema.py: -------------------------------------------------------------------------------- 1 | import typing 2 | import graphene 3 | 4 | from .schema import AnalysisReportSnapshotType 5 | from .models import AnalysisReport, AnalysisReportSnapshot 6 | 7 | 8 | class Query: 9 | public_analysis_report_snapshot = graphene.Field( 10 | AnalysisReportSnapshotType, 11 | slug=graphene.String(required=True), 12 | ) 13 | 14 | @staticmethod 15 | def resolve_public_analysis_report_snapshot(root, info, slug, **kwargs) -> typing.Optional[AnalysisReportSnapshot]: 16 | return AnalysisReport.get_latest_snapshot(slug=slug) 17 | -------------------------------------------------------------------------------- /apps/analysis/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis/tests/__init__.py -------------------------------------------------------------------------------- /apps/analysis/types/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis/types/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis_framework/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AnalysisFrameworkConfig(AppConfig): 5 | name = 'analysis_framework' 6 | -------------------------------------------------------------------------------- /apps/analysis_framework/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis_framework/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0015_auto_20180111_1049.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-11 10:49 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('analysis_framework', '0014_auto_20180107_0538'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='filter', 17 | options={'ordering': ['title', 'widget_key', 'key']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0016_auto_20180216_0931.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-02-16 09:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('analysis_framework', '0015_auto_20180111_1049'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='analysisframework', 17 | options={'ordering': ['-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0022_auto_20190711_0747.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.9 on 2019-07-11 07:47 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0020_auto_20190625_0542'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterUniqueTogether( 14 | name='analysisframeworkrole', 15 | unique_together={('can_add_user', 'can_clone_framework', 'can_edit_framework', 'can_use_in_other_projects', 'is_default_role')}, 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0023_remove_analysisframeworkrole_can_make_public.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.9 on 2019-07-11 07:50 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0022_auto_20190711_0747'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='analysisframeworkrole', 15 | name='can_make_public', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0025_analysisframeworkrole_is_private_role.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.9 on 2019-07-15 09:07 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0024_auto_20190712_0845'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='analysisframeworkrole', 15 | name='is_private_role', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0028_auto_20190802_0634.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.9 on 2019-08-02 06:34 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0027_auto_20190726_0512'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='analysisframework', 15 | name='description', 16 | field=models.TextField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0031_merge_0030_auto_20210503_0431_0030_auto_20210506_1055.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-03 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0030_auto_20210503_0431'), 10 | ('analysis_framework', '0030_auto_20210506_1055'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0034_widget_version.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.5 on 2021-11-17 07:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0033_auto_20210817_0458'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='widget', 15 | name='version', 16 | field=models.SmallIntegerField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/0037_analysisframework_assisted_tagging_enabled.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-03-24 07:22 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('analysis_framework', '0036_analysisframeworkrole_type'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='analysisframework', 15 | name='assisted_tagging_enabled', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/analysis_framework/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis_framework/migrations/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis_framework/tests/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis_framework/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/widgets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/analysis_framework/widgets/__init__.py -------------------------------------------------------------------------------- /apps/analysis_framework/widgets/date_widget.py: -------------------------------------------------------------------------------- 1 | WIDGET_ID = 'dateWidget' 2 | 3 | 4 | def get_filters(widget, properties): 5 | from analysis_framework.models import Filter # To avoid circular import 6 | return [{ 7 | 'filter_type': Filter.FilterType.NUMBER, 8 | 'properties': { 9 | 'type': 'date', 10 | }, 11 | }] 12 | 13 | 14 | def get_exportable(widget, properties): 15 | return { 16 | 'excel': { 17 | 'title': widget.title, 18 | 'col_type': 'date', 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /apps/analysis_framework/widgets/geo_widget.py: -------------------------------------------------------------------------------- 1 | WIDGET_ID = 'geoWidget' 2 | 3 | 4 | def get_filters(widget, properties): 5 | from analysis_framework.models import Filter # To avoid circular import 6 | return [{ 7 | 'filter_type': Filter.FilterType.LIST, 8 | 'properties': { 9 | 'type': 'geo', 10 | }, 11 | }] 12 | 13 | 14 | def get_exportable(widget, properties): 15 | return { 16 | 'excel': { 17 | 'type': 'geo', 18 | 'title': widget.title, 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /apps/analysis_framework/widgets/number_widget.py: -------------------------------------------------------------------------------- 1 | WIDGET_ID = 'numberWidget' 2 | 3 | 4 | def get_filters(widget, properties): 5 | from analysis_framework.models import Filter # To avoid circular import 6 | 7 | return [{ 8 | 'filter_type': Filter.FilterType.NUMBER, 9 | 'properties': { 10 | 'type': 'number', 11 | }, 12 | }] 13 | 14 | 15 | def get_exportable(widget, properties): 16 | return { 17 | 'excel': { 18 | 'title': widget.title, 19 | 'col_type': 'number', 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /apps/analysis_framework/widgets/text_widget.py: -------------------------------------------------------------------------------- 1 | WIDGET_ID = 'textWidget' 2 | 3 | 4 | def get_filters(widget, properties): 5 | from analysis_framework.models import Filter # To avoid circular import 6 | 7 | return [{ 8 | 'filter_type': Filter.FilterType.TEXT, 9 | 'properties': { 10 | 'type': 'text', 11 | }, 12 | }] 13 | 14 | 15 | def get_exportable(widget, properties): 16 | return { 17 | 'excel': { 18 | 'title': widget.title, 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /apps/analysis_framework/widgets/time_widget.py: -------------------------------------------------------------------------------- 1 | WIDGET_ID = 'timeWidget' 2 | 3 | 4 | def get_filters(widget, properties): 5 | from analysis_framework.models import Filter # To avoid circular import 6 | 7 | return [{ 8 | 'filter_type': Filter.FilterType.NUMBER, 9 | 'properties': { 10 | 'type': 'time', 11 | }, 12 | }] 13 | 14 | 15 | def get_exportable(widget, properties): 16 | return { 17 | 'excel': { 18 | 'title': widget.title, 19 | 'col_type': 'time', 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /apps/ary/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/ary/__init__.py -------------------------------------------------------------------------------- /apps/ary/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AryConfig(AppConfig): 5 | name = 'ary' 6 | -------------------------------------------------------------------------------- /apps/ary/enums.py: -------------------------------------------------------------------------------- 1 | from utils.graphene.enums import convert_enum_to_graphene_enum 2 | 3 | from .models import MethodologyProtectionInfo 4 | 5 | 6 | AssessmentMethodologyProtectionInfoEnum = convert_enum_to_graphene_enum( 7 | MethodologyProtectionInfo, name='AssessmentMethodologyProtectionInfoEnum') 8 | 9 | enum_map = { 10 | 'UnusedAssessmentMethodologyProtectionInfo': AssessmentMethodologyProtectionInfoEnum, 11 | } 12 | -------------------------------------------------------------------------------- /apps/ary/export/stakeholders_info.py: -------------------------------------------------------------------------------- 1 | from assessment_registry.models import AssessmentRegistryOrganization 2 | 3 | 4 | default_values = { 5 | 'stakeholders': None, 6 | } 7 | 8 | 9 | def get_stakeholders_info(assessment): 10 | stakeholders_info = [ 11 | { 12 | 'name': org.organization.title, 13 | 'type': org.get_organization_type_display() 14 | }for org in AssessmentRegistryOrganization.objects.filter(assessment_registry=assessment) 15 | ] # TODO : Add Dataloaders 16 | 17 | return { 18 | 'stakeholders': stakeholders_info, 19 | } 20 | -------------------------------------------------------------------------------- /apps/ary/factories.py: -------------------------------------------------------------------------------- 1 | from factory.django import DjangoModelFactory 2 | 3 | from .models import ( 4 | AssessmentTemplate, 5 | Assessment, 6 | ) 7 | 8 | 9 | class AssessmentFactory(DjangoModelFactory): 10 | class Meta: 11 | model = Assessment 12 | 13 | 14 | class AssessmentTemplateFactory(DjangoModelFactory): 15 | class Meta: 16 | model = AssessmentTemplate 17 | -------------------------------------------------------------------------------- /apps/ary/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/ary/management/__init__.py -------------------------------------------------------------------------------- /apps/ary/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/ary/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/ary/migrations/0010_auto_20180330_0707.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-03-30 07:07 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0009_auto_20180330_0706'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameModel( 16 | old_name='AssessmentTopic', 17 | new_name='Sector', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/ary/migrations/0011_auto_20180330_0709.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-03-30 07:09 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0010_auto_20180330_0707'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameModel( 16 | old_name='SepecificNeedGroup', 17 | new_name='SpecificNeedGroup', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/ary/migrations/0012_auto_20180330_0716.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-03-30 07:16 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0011_auto_20180330_0709'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='focus', 17 | options={'ordering': ['order'], 'verbose_name_plural': 'focuses'}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/ary/migrations/0014_auto_20180416_0944.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-04-16 09:44 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0013_auto_20180405_1109'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='assessment', 17 | old_name='summary_data', 18 | new_name='summary', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/ary/migrations/0018_merge_20180419_0410.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-04-19 04:10 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0014_auto_20180416_0944'), 12 | ('ary', '0017_auto_20180418_1056'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/ary/migrations/0025_merge_20180511_1023.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-05-11 10:23 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0024_auto_20180510_0913'), 12 | ('ary', '0024_auto_20180510_0723'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/ary/migrations/0033_merge_20190127_1110.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2019-01-27 11:10 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('ary', '0032_auto_20190125_0911'), 12 | ('ary', '0032_underlyingfactor'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/ary/migrations/0037_assessment_questionnaire.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-06-18 04:24 2 | 3 | import django.contrib.postgres.fields.jsonb 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('ary', '0036_auto_20190612_1113'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='assessment', 16 | name='questionnaire', 17 | field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=None, null=True), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/ary/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/ary/migrations/__init__.py -------------------------------------------------------------------------------- /apps/ary/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/ary/tests/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assessment_registry/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AssessmentRegistryConfig(AppConfig): 5 | name = 'assessment_registry' 6 | -------------------------------------------------------------------------------- /apps/assessment_registry/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assessment_registry/management/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assessment_registry/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0003_remove_assessmentregistry_affected_groups.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-07-13 06:21 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0003_auto_20230719_0934'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='assessmentregistry', 15 | name='affected_groups', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0007_alter_additionaldocument_external_link.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-07-26 08:27 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0006_auto_20230719_1044'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='additionaldocument', 15 | name='external_link', 16 | field=models.URLField(blank=True, max_length=500), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0008_remove_assessmentregistry_locations.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-07-27 10:48 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0007_alter_additionaldocument_external_link'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='assessmentregistry', 15 | name='locations', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0010_additionaldocument_file_path.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-07-28 08:17 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0009_assessmentregistry_locations'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='additionaldocument', 15 | name='file_path', 16 | field=models.CharField(blank=True, max_length=500), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0011_remove_additionaldocument_file_path.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-01 05:19 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0010_additionaldocument_file_path'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='additionaldocument', 15 | name='file_path', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0012_merge_20230802_0953.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-02 09:53 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0007_auto_20230731_1422'), 10 | ('assessment_registry', '0011_remove_additionaldocument_file_path'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0020_alter_summaryfocus_options.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-08 05:15 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0019_auto_20230804_0944'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterModelOptions( 14 | name='summaryfocus', 15 | options={'verbose_name': 'SummaryDimmension'}, 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0033_rename_sub_dimmension_summaryissue_sub_dimension.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-23 06:44 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0032_auto_20230823_0635'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='summaryissue', 15 | old_name='sub_dimmension', 16 | new_name='sub_dimension', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0035_remove_summarysubdimensionissue_focus.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-25 09:46 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0034_auto_20230825_0906'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='summarysubdimensionissue', 15 | name='focus', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0036_rename_focus_summaryfocus_sector.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-28 07:55 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0035_remove_summarysubdimensionissue_focus'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='summaryfocus', 15 | old_name='focus', 16 | new_name='sector', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0040_scoreanalyticaldensity_score.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-10-06 10:06 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0039_auto_20231005_1039'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='scoreanalyticaldensity', 15 | name='score', 16 | field=models.IntegerField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/0050_alter_scoreanalyticaldensity_score.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2024-03-25 10:12 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assessment_registry', '0049_assessmentregistry_protection_risks'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='scoreanalyticaldensity', 15 | name='score', 16 | field=models.FloatField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assessment_registry/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assessment_registry/migrations/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assessment_registry/tests/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assessment_registry/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/assessment_registry/utils.py: -------------------------------------------------------------------------------- 1 | # Get heirarchy level of a django model. 2 | def get_hierarchy_level(parent_instance): 3 | level = 1 4 | while parent_instance.parent: 5 | level += 1 6 | parent_instance = parent_instance.parent 7 | return level 8 | -------------------------------------------------------------------------------- /apps/assessment_registry/views.py: -------------------------------------------------------------------------------- 1 | # from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /apps/assisted_tagging/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assisted_tagging/__init__.py -------------------------------------------------------------------------------- /apps/assisted_tagging/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AssistedTaggingConfig(AppConfig): 5 | name = 'assisted_tagging' 6 | -------------------------------------------------------------------------------- /apps/assisted_tagging/migrations/0002_rename_is_depricated_assistedtaggingmodelpredictiontag_is_deprecated.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-03-08 14:16 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assisted_tagging', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='assistedtaggingmodelpredictiontag', 15 | old_name='is_depricated', 16 | new_name='is_deprecated', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assisted_tagging/migrations/0009_alter_assistedtaggingmodelpredictiontag_group.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-03-10 11:03 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assisted_tagging', '0008_auto_20220310_1042'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='assistedtaggingmodelpredictiontag', 15 | name='group', 16 | field=models.CharField(blank=True, max_length=256, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assisted_tagging/migrations/0012_draftentry_is_discarded.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-12-11 05:40 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assisted_tagging', '0011_draftentry_draft_entry_type'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='draftentry', 15 | name='is_discarded', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assisted_tagging/migrations/0013_rename_draft_entry_type_draftentry_type.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-12-20 11:34 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('assisted_tagging', '0012_draftentry_is_discarded'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='draftentry', 15 | old_name='draft_entry_type', 16 | new_name='type', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/assisted_tagging/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assisted_tagging/migrations/__init__.py -------------------------------------------------------------------------------- /apps/assisted_tagging/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/assisted_tagging/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/bulk_data_migration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/bulk_data_migration/__init__.py -------------------------------------------------------------------------------- /apps/bulk_data_migration/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BulkDataMigrationConfig(AppConfig): 5 | name = 'bulk_data_migration' 6 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/bulk_data_migration/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/bulk_data_migration/management/commands/update_attribute_for_scale_export.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | 3 | from entry.models import Attribute 4 | from entry.utils import update_entry_attribute 5 | 6 | 7 | class Command(BaseCommand): 8 | help = 'Update attributes to export scales' 9 | 10 | def handle(self, *args, **options): 11 | for each in Attribute.objects.filter(widget__widget_id__in=['scaleWidget', 'conditionalWidget']): 12 | update_entry_attribute(each) 13 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/bulk_data_migration/v1_2/__init__.py -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/excerpt.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | return widget_data 3 | 4 | 5 | def migrate_attribute(data): 6 | return None 7 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/geo.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | return widget_data 3 | 4 | 5 | def migrate_val(v): 6 | if isinstance(v, dict): 7 | return v['key'] 8 | return v 9 | 10 | 11 | def migrate_attribute(data): 12 | value = data.get('values') or [] 13 | return { 14 | 'value': [migrate_val(v) for v in value], 15 | } 16 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/matrix1d.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | return widget_data 3 | 4 | 5 | def migrate_attribute(data): 6 | if data.get('value'): 7 | return data 8 | 9 | return { 10 | 'value': data 11 | } 12 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/matrix2d.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | return widget_data 3 | 4 | 5 | def migrate_attribute(data): 6 | if data.get('value'): 7 | return data 8 | 9 | return { 10 | 'value': data 11 | } 12 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/number_matrix.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | return widget_data 3 | 4 | 5 | def migrate_attribute(data): 6 | if data.get('value'): 7 | return data 8 | 9 | return { 10 | 'value': data 11 | } 12 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/organigram.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | return widget_data 3 | 4 | 5 | def migrate_val(v): 6 | if isinstance(v, dict): 7 | return v['id'] 8 | return v 9 | 10 | 11 | def migrate_attribute(data): 12 | value = data.get('values') or [] 13 | return { 14 | 'value': [migrate_val(v) for v in value], 15 | } 16 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/projects.py: -------------------------------------------------------------------------------- 1 | from django.db import transaction 2 | from project.models import Project 3 | 4 | 5 | def migrate_projects(*args, **kwargs): 6 | filter_args = kwargs 7 | with transaction.atomic(): 8 | for project in Project.objects.filter(**filter_args): 9 | project.update_status() 10 | -------------------------------------------------------------------------------- /apps/bulk_data_migration/v1_2/scale.py: -------------------------------------------------------------------------------- 1 | def migrate_widget(widget_data): 2 | units = widget_data.get('scale_units') or [] 3 | for unit in units: 4 | if unit.get('title'): 5 | unit['label'] = unit['title'] 6 | unit.pop('title') 7 | return widget_data 8 | 9 | 10 | def migrate_attribute(data): 11 | if data.get('value'): 12 | return data 13 | 14 | return { 15 | 'value': data.get('selected_scale') 16 | } 17 | -------------------------------------------------------------------------------- /apps/category_editor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/category_editor/__init__.py -------------------------------------------------------------------------------- /apps/category_editor/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from reversion.admin import VersionAdmin 3 | from category_editor.models import CategoryEditor 4 | 5 | 6 | @admin.register(CategoryEditor) 7 | class CategoryEditorAdmin(VersionAdmin): 8 | search_fields = ('title',) 9 | autocomplete_fields = ('created_by', 'modified_by',) 10 | -------------------------------------------------------------------------------- /apps/category_editor/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CategoryEditorConfig(AppConfig): 5 | name = 'category_editor' 6 | -------------------------------------------------------------------------------- /apps/category_editor/migrations/0003_auto_20180216_0931.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-02-16 09:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('category_editor', '0002_categoryeditor_title'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='categoryeditor', 17 | options={'ordering': ['-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/category_editor/migrations/0005_alter_categoryeditor_data.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-05-03 04:31 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('category_editor', '0004_categoryeditor_client_id'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='categoryeditor', 15 | name='data', 16 | field=models.JSONField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/category_editor/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/category_editor/migrations/__init__.py -------------------------------------------------------------------------------- /apps/category_editor/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/category_editor/tests/__init__.py -------------------------------------------------------------------------------- /apps/client_page_meta/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/client_page_meta/__init__.py -------------------------------------------------------------------------------- /apps/client_page_meta/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from reversion.admin import VersionAdmin 3 | 4 | from .models import Page 5 | 6 | 7 | @admin.register(Page) 8 | class PageAdmin(VersionAdmin): 9 | search_fields = ('title', 'page_id') 10 | list_display = ('title', 'page_id', 'help_url') 11 | -------------------------------------------------------------------------------- /apps/client_page_meta/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ClientPageMetaConfig(AppConfig): 5 | name = 'client_page_meta' 6 | -------------------------------------------------------------------------------- /apps/client_page_meta/migrations/0002_auto_20181202_0553.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-12-02 05:53 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('client_page_meta', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='page', 17 | name='help_url', 18 | field=models.TextField(), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/client_page_meta/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/client_page_meta/migrations/__init__.py -------------------------------------------------------------------------------- /apps/client_page_meta/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class Page(models.Model): 5 | title = models.CharField(max_length=300) 6 | page_id = models.CharField(max_length=300, unique=True) 7 | help_url = models.TextField() 8 | 9 | def __str__(self): 10 | return '{} {}'.format(self.title, self.page_id) 11 | -------------------------------------------------------------------------------- /apps/client_page_meta/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | 3 | from .models import Page 4 | 5 | 6 | class PageSerializer(serializers.ModelSerializer): 7 | class Meta: 8 | model = Page 9 | fields = ('__all__') 10 | -------------------------------------------------------------------------------- /apps/client_page_meta/tests.py: -------------------------------------------------------------------------------- 1 | # from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/client_page_meta/views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import viewsets 2 | 3 | from .serializers import PageSerializer 4 | from .models import Page 5 | 6 | 7 | class PageViewSet(viewsets.ReadOnlyModelViewSet): 8 | queryset = Page.objects.all() 9 | serializer_class = PageSerializer 10 | lookup_field = 'page_id' 11 | -------------------------------------------------------------------------------- /apps/commons/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/commons/__init__.py -------------------------------------------------------------------------------- /apps/commons/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CommonsConfig(AppConfig): 5 | name = 'commons' 6 | 7 | def ready(self): 8 | import commons.receivers # noqa: F401 9 | -------------------------------------------------------------------------------- /apps/commons/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/commons/management/__init__.py -------------------------------------------------------------------------------- /apps/commons/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/commons/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/commons/management/commands/clear_cache.py: -------------------------------------------------------------------------------- 1 | from django.core.cache import cache 2 | from django.core.management.base import BaseCommand 3 | 4 | 5 | class Command(BaseCommand): 6 | def handle(self, **_): 7 | cache.clear() 8 | -------------------------------------------------------------------------------- /apps/commons/tests/test_common.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from deep.tests import TestCase 3 | 4 | 5 | class TestNotificationAPIs(TestCase): 6 | 7 | def test_detect_testmode(self): 8 | assert settings.TESTING is True 9 | -------------------------------------------------------------------------------- /apps/connector/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/connector/__init__.py -------------------------------------------------------------------------------- /apps/connector/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from deep.admin import VersionAdmin 4 | from connector.models import Connector, EMMConfig, ConnectorSource 5 | 6 | 7 | @admin.register(Connector) 8 | class ConnectorAdmin(VersionAdmin): 9 | autocomplete_fields = ('created_by', 'modified_by',) 10 | 11 | 12 | @admin.register(EMMConfig) 13 | class EMMConfigAdmin(VersionAdmin): 14 | list_display = ('entity_tag', 'trigger_tag', 'trigger_attribute',) 15 | 16 | 17 | admin.site.register(ConnectorSource) 18 | -------------------------------------------------------------------------------- /apps/connector/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/connector/management/__init__.py -------------------------------------------------------------------------------- /apps/connector/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/connector/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/connector/migrations/0007_delete_emmentity.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.9 on 2019-08-28 10:55 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0026_auto_20190828_1055'), 10 | ('connector', '0006_emmconfig'), 11 | ] 12 | 13 | operations = [ 14 | migrations.DeleteModel( 15 | name='EMMEntity', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/connector/migrations/0015_remove_connector_source.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.13 on 2019-11-07 04:59 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('connector', '0014_auto_20191107_0426'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='connector', 15 | name='source', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/connector/migrations/0016_auto_20191107_0500.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.13 on 2019-11-07 05:00 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('connector', '0015_remove_connector_source'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='connector', 15 | old_name='source_obj', 16 | new_name='source', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/connector/migrations/0017_auto_20191107_0526.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.13 on 2019-11-07 05:26 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('connector', '0016_auto_20191107_0500'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='connectorsource', 15 | old_name='name', 16 | new_name='title', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/connector/migrations/0018_alter_connector_params.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-05-03 04:31 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('connector', '0017_auto_20191107_0526'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='connector', 15 | name='params', 16 | field=models.JSONField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/connector/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/connector/migrations/__init__.py -------------------------------------------------------------------------------- /apps/connector/sources/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/connector/sources/__init__.py -------------------------------------------------------------------------------- /apps/connector/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/connector/tests/__init__.py -------------------------------------------------------------------------------- /apps/deduplication/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deduplication/__init__.py -------------------------------------------------------------------------------- /apps/deduplication/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import LSHIndex 4 | 5 | 6 | @admin.register(LSHIndex) 7 | class LSHIndexAdmin(admin.ModelAdmin): 8 | pass 9 | -------------------------------------------------------------------------------- /apps/deduplication/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DeduplicationConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "deduplication" 7 | 8 | def ready(self): 9 | import deduplication.receivers # noqa 10 | -------------------------------------------------------------------------------- /apps/deduplication/factories.py: -------------------------------------------------------------------------------- 1 | from factory.django import DjangoModelFactory 2 | 3 | from .models import LSHIndex 4 | 5 | 6 | class LSHIndexFactory(DjangoModelFactory): 7 | class Meta: 8 | model = LSHIndex 9 | -------------------------------------------------------------------------------- /apps/deduplication/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deduplication/migrations/__init__.py -------------------------------------------------------------------------------- /apps/deduplication/tasks/__init__.py: -------------------------------------------------------------------------------- 1 | from .indexing import create_indices 2 | 3 | __all__ = [ 4 | "create_indices", 5 | ] 6 | -------------------------------------------------------------------------------- /apps/deduplication/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deduplication/tests/__init__.py -------------------------------------------------------------------------------- /apps/deep_explore/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DeepExploreConfig(AppConfig): 5 | name = 'deep_explore' 6 | -------------------------------------------------------------------------------- /apps/deep_explore/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deep_explore/migrations/__init__.py -------------------------------------------------------------------------------- /apps/deep_migration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deep_migration/__init__.py -------------------------------------------------------------------------------- /apps/deep_migration/admin.py: -------------------------------------------------------------------------------- 1 | # Empty 2 | -------------------------------------------------------------------------------- /apps/deep_migration/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DeepMigrationConfig(AppConfig): 5 | name = 'deep_migration' 6 | -------------------------------------------------------------------------------- /apps/deep_migration/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deep_migration/management/__init__.py -------------------------------------------------------------------------------- /apps/deep_migration/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deep_migration/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/deep_migration/migrations/0004_auto_20180114_0810.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-14 08:10 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('deep_migration', '0003_auto_20180114_0730'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='adminlevelmigration', 17 | old_name='level', 18 | new_name='old_id', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/deep_migration/migrations/0010_auto_20180115_0613.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-15 06:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('deep_migration', '0009_analysisframeowrkmigration'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameModel( 16 | old_name='AnalysisFrameowrkMigration', 17 | new_name='AnalysisFramworkMigration', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/deep_migration/migrations/0011_auto_20180115_0613.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-15 06:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('deep_migration', '0010_auto_20180115_0613'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameModel( 16 | old_name='AnalysisFramworkMigration', 17 | new_name='AnalysisFrameworkMigration', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/deep_migration/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/deep_migration/migrations/__init__.py -------------------------------------------------------------------------------- /apps/deepl_integration/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DeeplIntegrationConfig(AppConfig): 5 | name = 'deepl_integration' 6 | -------------------------------------------------------------------------------- /apps/docs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/docs/__init__.py -------------------------------------------------------------------------------- /apps/entry/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/entry/__init__.py -------------------------------------------------------------------------------- /apps/entry/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class EntryConfig(AppConfig): 5 | name = 'entry' 6 | 7 | def ready(self): 8 | import entry.receivers # noqa 9 | -------------------------------------------------------------------------------- /apps/entry/errors.py: -------------------------------------------------------------------------------- 1 | from rest_framework import exceptions 2 | 3 | from deep import error_codes 4 | 5 | 6 | class EntryValidationVersionMismatchError(exceptions.ValidationError): 7 | status_code = 400 8 | code = error_codes.ENTRY_VALIDATION_VERSION_MISMATCH 9 | default_detail = 'Version Mismatch' 10 | -------------------------------------------------------------------------------- /apps/entry/exceptions.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/entry/exceptions.py -------------------------------------------------------------------------------- /apps/entry/migrations/0002_auto_20171006_0748.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-10-06 07:48 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('entry', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='entry', 17 | options={'ordering': ['-modified_at', '-created_at'], 'verbose_name_plural': 'entries'}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/entry/migrations/0006_entry_information_date.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-22 09:49 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('entry', '0005_auto_20180102_0457'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='entry', 17 | name='information_date', 18 | field=models.DateField(blank=True, default=None, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/entry/migrations/0016_merge_20181120_0612.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-11-20 06:12 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('entry', '0015_auto_20181025_1502'), 12 | ('entry', '0015_auto_20181031_0602'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/entry/migrations/0023_filterdata_text.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-01-17 08:55 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0022_auto_20200110_0609'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='filterdata', 15 | name='text', 16 | field=models.TextField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/entry/migrations/0026_remove_entrycomment_assignee.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-06-30 07:20 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0025_entry-comment-assignee-to-assignees'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='entrycomment', 15 | name='assignee', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/entry/migrations/0027_entry_verified.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-09-14 11:44 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0026_remove_entrycomment_assignee'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='entry', 15 | name='verified', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/entry/migrations/0030_merge_0029_auto_20210112_0935_0029_auto_20210503_0431.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-03 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0029_auto_20210112_0935'), 10 | ('entry', '0029_auto_20210503_0431'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/entry/migrations/0032_merge_20210506_0840.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-05-06 08:40 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0029_auto_20210112_0935'), 10 | ('entry', '0031_entry-migrate-verify-to-review-comment'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/entry/migrations/0033_merge_20210805_0715.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-08-05 07:15 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0030_merge_0029_auto_20210112_0935_0029_auto_20210503_0431'), 10 | ('entry', '0032_merge_20210506_0840'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/entry/migrations/0034_attribute_widget_version.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.5 on 2021-11-17 07:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0033_merge_20210805_0715'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='attribute', 15 | name='widget_version', 16 | field=models.SmallIntegerField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/entry/migrations/0035_alter_filterdata_number.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.9 on 2021-12-07 08:14 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0034_attribute_widget_version'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='filterdata', 15 | name='number', 16 | field=models.BigIntegerField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/entry/migrations/0037_merge_20220401_0527.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-04-01 05:27 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('entry', '0036_entry_draft_entry'), 10 | ('entry', '0036_entry_excerpt_modified'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/entry/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/entry/migrations/__init__.py -------------------------------------------------------------------------------- /apps/entry/pagination.py: -------------------------------------------------------------------------------- 1 | from rest_framework import pagination 2 | 3 | 4 | class ComprehensiveEntriesSetPagination(pagination.LimitOffsetPagination): 5 | default_limit = 20 6 | max_limit = 50 7 | -------------------------------------------------------------------------------- /apps/entry/receivers.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.dispatch import receiver 3 | 4 | from lead.models import Lead 5 | from .models import Entry 6 | 7 | 8 | @receiver(models.signals.post_save, sender=Entry) 9 | def update_lead_status(sender, instance, created, **kwargs): 10 | lead = instance.lead 11 | if lead.status == Lead.Status.NOT_TAGGED: 12 | lead.status = Lead.Status.IN_PROGRESS 13 | lead.save(update_fields=['status']) 14 | -------------------------------------------------------------------------------- /apps/entry/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/entry/tests/__init__.py -------------------------------------------------------------------------------- /apps/entry/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/entry/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/entry/widgets/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/entry/widgets/__init__.py -------------------------------------------------------------------------------- /apps/export/analyses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/export/analyses/__init__.py -------------------------------------------------------------------------------- /apps/export/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ExportConfig(AppConfig): 5 | name = 'export' 6 | -------------------------------------------------------------------------------- /apps/export/assessments/__init__.py: -------------------------------------------------------------------------------- 1 | from .excel_exporter import ExcelExporter, NewExcelExporter # noqa 2 | -------------------------------------------------------------------------------- /apps/export/entries/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/export/entries/__init__.py -------------------------------------------------------------------------------- /apps/export/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | from factory.django import DjangoModelFactory 3 | 4 | from .models import Export 5 | 6 | 7 | class ExportFactory(DjangoModelFactory): 8 | title = factory.Sequence(lambda n: f'Export-{n}') 9 | type = factory.fuzzy.FuzzyChoice(Export.DataType) 10 | 11 | class Meta: 12 | model = Export 13 | -------------------------------------------------------------------------------- /apps/export/formats/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/export/formats/__init__.py -------------------------------------------------------------------------------- /apps/export/migrations/0003_export_mime_type.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-04 06:56 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('export', '0002_auto_20171228_0738'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='export', 17 | name='mime_type', 18 | field=models.CharField(blank=True, max_length=200), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/export/migrations/0007_merge_20180708_0706.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-07-08 07:06 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('export', '0006_auto_20180707_1206'), 12 | ('export', '0006_auto_20180706_1021'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/export/migrations/0011_export_is_archived.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-12-22 08:05 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('export', '0010_auto_20200106_0909'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='export', 15 | name='is_archived', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/export/migrations/0011_export_is_deleted.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-12-23 04:35 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('export', '0010_auto_20200106_0909'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='export', 15 | name='is_deleted', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/export/migrations/0012_merge_20201229_0900.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-12-29 09:00 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('export', '0011_export_is_deleted'), 10 | ('export', '0011_export_is_archived'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/export/migrations/0014_merge_20210419_0941.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-04-19 09:41 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('export', '0013_auto_20210120_0443'), 10 | ('export', '0013_auto_20210409_0423'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/export/migrations/0015_merge_20210603_0624.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-03 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('export', '0013_auto_20210503_0431'), 10 | ('export', '0014_merge_20210419_0941'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/export/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/export/migrations/__init__.py -------------------------------------------------------------------------------- /apps/export/mime_types.py: -------------------------------------------------------------------------------- 1 | DOCX_MIME_TYPE = \ 2 | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' 3 | PDF_MIME_TYPE = \ 4 | 'application/pdf' 5 | EXCEL_MIME_TYPE = \ 6 | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' 7 | CSV_MIME_TYPE = 'text/csv' 8 | JSON_MIME_TYPE = \ 9 | 'application/json' 10 | -------------------------------------------------------------------------------- /apps/export/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/export/tests/__init__.py -------------------------------------------------------------------------------- /apps/export/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/export/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/gallery/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/gallery/__init__.py -------------------------------------------------------------------------------- /apps/gallery/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from reversion.admin import VersionAdmin 3 | 4 | from deep.admin import document_preview 5 | 6 | from .models import File 7 | from .filters import IsTabularListFilter 8 | 9 | 10 | @admin.register(File) 11 | class FileAdmin(VersionAdmin): 12 | list_display = ('title', 'file', 'mime_type',) 13 | readonly_fields = (document_preview('file'),) 14 | search_fields = ('title', 'file', 'mime_type', ) 15 | list_filter = (IsTabularListFilter,) 16 | autocomplete_fields = ('created_by', 'modified_by', 'projects',) 17 | -------------------------------------------------------------------------------- /apps/gallery/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class GalleryConfig(AppConfig): 5 | name = 'gallery' 6 | -------------------------------------------------------------------------------- /apps/gallery/enums.py: -------------------------------------------------------------------------------- 1 | import graphene 2 | 3 | 4 | class PrivateFileModuleType(graphene.Enum): 5 | ENTRY_ATTACHMENT = 'entry-attachment' 6 | LEAD_PREVIEW_ATTACHMENT = 'lead-preview-attachment' 7 | -------------------------------------------------------------------------------- /apps/gallery/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/gallery/management/__init__.py -------------------------------------------------------------------------------- /apps/gallery/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/gallery/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/gallery/migrations/0003_auto_20171016_0957.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-10-16 09:57 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('gallery', '0002_auto_20171016_0957'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='file', 17 | name='is_public', 18 | field=models.BooleanField(default=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0004_file_mime_type.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-12 10:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('gallery', '0003_auto_20171016_0957'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='file', 17 | name='mime_type', 18 | field=models.CharField(blank=True, max_length=130, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0008_auto_20171230_0853.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-30 08:53 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('gallery', '0007_auto_20171230_0850'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='filepreview', 17 | old_name='text_extract', 18 | new_name='text', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0010_auto_20180216_0931.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-02-16 09:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('gallery', '0009_auto_20171230_0858'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='file', 17 | options={'ordering': ['-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0011_auto_20180405_1109.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-04-05 11:09 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('gallery', '0010_auto_20180216_0931'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='file', 17 | old_name='meta_data', 18 | new_name='metadata', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0014_file_random_string.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-13 07:05 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('gallery', '0013_file_client_id'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='file', 15 | name='random_string', 16 | field=models.CharField(blank=True, max_length=16, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0017_uuid_unique_20190802_0921.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.10 on 2019-08-02 09:21 2 | 3 | import uuid 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('gallery', '0016_populate_file_uuid_20190802_0912'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='file', 16 | name='uuid', 17 | field=models.UUIDField(default=uuid.uuid4, unique=True), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0018_auto_20191217_0608.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-12-17 06:08 2 | 3 | from django.db import migrations, models 4 | import uuid 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('gallery', '0017_uuid_unique_20190802_0921'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='file', 16 | name='uuid', 17 | field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0019_auto_20210120_0443.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-01-20 04:43 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('gallery', '0018_auto_20191217_0608'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='file', 15 | name='is_public', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/gallery/migrations/0020_merge_0019_auto_20210120_0443_0019_auto_20210503_0431.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-03 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('gallery', '0019_auto_20210120_0443'), 10 | ('gallery', '0019_auto_20210503_0431'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/gallery/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/gallery/migrations/__init__.py -------------------------------------------------------------------------------- /apps/gallery/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/gallery/tests/__init__.py -------------------------------------------------------------------------------- /apps/geo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/geo/__init__.py -------------------------------------------------------------------------------- /apps/geo/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class GeoConfig(AppConfig): 5 | name = 'geo' 6 | 7 | def ready(self): 8 | import utils.db.functions # noqa 9 | -------------------------------------------------------------------------------- /apps/geo/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/geo/management/__init__.py -------------------------------------------------------------------------------- /apps/geo/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/geo/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/geo/migrations/0004_region_code.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-09-07 10:28 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0003_auto_20170907_0949'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='region', 17 | name='code', 18 | field=models.CharField(default=None, max_length=10), 19 | preserve_default=False, 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /apps/geo/migrations/0008_remove_geoarea_name.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-09-22 05:59 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0007_auto_20170922_0551'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='geoarea', 17 | name='name', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/geo/migrations/0009_auto_20170926_0533.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-09-26 05:33 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0008_remove_geoarea_name'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='region', 17 | old_name='is_global', 18 | new_name='public', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0011_auto_20171004_0818.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-10-04 08:18 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0010_auto_20170926_0550'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='region', 17 | options={'ordering': ['-modified_at', '-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/geo/migrations/0013_auto_20171114_1117.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-11-14 11:17 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0012_auto_20171013_1259'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='region', 17 | options={'ordering': ['title', 'code']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/geo/migrations/0020_adminlevel_level.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-11 10:01 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0019_auto_20171210_0955'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='adminlevel', 17 | name='level', 18 | field=models.IntegerField(blank=True, default=None, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0021_adminlevel_stale_geo_areas.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-18 10:54 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0020_adminlevel_level'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='adminlevel', 17 | name='stale_geo_areas', 18 | field=models.BooleanField(default=False), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0022_auto_20171218_1057.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-18 10:57 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0021_adminlevel_stale_geo_areas'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='adminlevel', 17 | name='stale_geo_areas', 18 | field=models.BooleanField(default=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0023_adminlevel_tolerance.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-22 06:32 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0022_auto_20171218_1057'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='adminlevel', 17 | name='tolerance', 18 | field=models.FloatField(default=0.0001), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0025_auto_20180124_1100.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-24 11:00 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0024_auto_20180107_0538'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='adminlevel', 17 | options={'ordering': ['level']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/geo/migrations/0032_merge_20181212_0553.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-12-12 05:53 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('geo', '0031_adminlevel_geo_area_titles'), 12 | ('geo', '0029_region_client_id'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/geo/migrations/0033_auto_20190429_0541.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-04-29 05:41 2 | 3 | from django.db import migrations 4 | 5 | 6 | def clear_admin_level_geo_area_cache(apps, schema_editor): 7 | AdminLevel = apps.get_model('geo', 'AdminLevel') 8 | 9 | AdminLevel.objects.all().update(geo_area_titles=None) 10 | 11 | 12 | class Migration(migrations.Migration): 13 | 14 | dependencies = [ 15 | ('geo', '0032_merge_20181212_0553'), 16 | ] 17 | 18 | operations = [ 19 | migrations.RunPython(clear_admin_level_geo_area_cache), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0034_auto_20190429_0624.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-04-29 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | def clear_region_geo_options_cache(apps, schema_editor): 7 | Region = apps.get_model('geo', 'Region') 8 | 9 | Region.objects.all().update(geo_options=None) 10 | 11 | 12 | class Migration(migrations.Migration): 13 | 14 | dependencies = [ 15 | ('geo', '0033_auto_20190429_0541'), 16 | ] 17 | 18 | operations = [ 19 | migrations.RunPython(clear_region_geo_options_cache), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/geo/migrations/0036_auto_20190730_0617.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.10 on 2019-07-30 06:17 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('geo', '0035_auto_20190730_0518'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='adminlevel', 15 | name='bounds', 16 | ), 17 | migrations.RemoveField( 18 | model_name='adminlevel', 19 | name='geojson', 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /apps/geo/migrations/0040_region_cache_index.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.12 on 2022-05-20 08:34 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('geo', '0039_region_centroid'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='region', 15 | name='cache_index', 16 | field=models.SmallIntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/geo/migrations/0041_geoarea_centroid.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.15 on 2023-01-13 14:55 2 | 3 | import django.contrib.gis.db.models.fields 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('geo', '0040_region_cache_index'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='geoarea', 16 | name='centroid', 17 | field=django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/geo/migrations/0042_rename_data_geoarea_cached_data.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-02 09:32 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('geo', '0041_geoarea_centroid'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='geoarea', 15 | old_name='data', 16 | new_name='cached_data', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/geo/migrations/0043_create-unaccent_extension.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-08-21 08:03 2 | 3 | from django.db import migrations 4 | from django.contrib.postgres.operations import CreateExtension 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('geo', '0042_rename_data_geoarea_cached_data'), 10 | ] 11 | 12 | operations = [ 13 | CreateExtension('unaccent') 14 | ] 15 | -------------------------------------------------------------------------------- /apps/geo/migrations/0044_region_status.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.25 on 2024-12-05 04:25 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('geo', '0043_create-unaccent_extension'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='region', 15 | name='status', 16 | field=models.PositiveSmallIntegerField(choices=[(0, 'Initiated'), (1, 'Pending'), (2, 'Completed'), (3, 'Failed')], default=1), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/geo/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/geo/migrations/__init__.py -------------------------------------------------------------------------------- /apps/geo/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/geo/tests/__init__.py -------------------------------------------------------------------------------- /apps/geo/tests/test_celery.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase, override_settings 2 | from geo.tasks import add 3 | 4 | 5 | @override_settings(CELERY_TASK_ALWAYS_EAGER=True) 6 | class CeleryTest(TestCase): 7 | """ 8 | Simple celery test 9 | """ 10 | 11 | def test_add(self): 12 | """ 13 | Test the addition task 14 | """ 15 | 16 | result = add.delay(5, 4) 17 | self.assertEqual(result.get(), 9) 18 | self.assertTrue(result.successful()) 19 | -------------------------------------------------------------------------------- /apps/jwt_auth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/jwt_auth/__init__.py -------------------------------------------------------------------------------- /apps/jwt_auth/admin.py: -------------------------------------------------------------------------------- 1 | # from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/jwt_auth/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class JwtAuthConfig(AppConfig): 5 | name = 'jwt_auth' 6 | -------------------------------------------------------------------------------- /apps/jwt_auth/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/jwt_auth/migrations/__init__.py -------------------------------------------------------------------------------- /apps/jwt_auth/models.py: -------------------------------------------------------------------------------- 1 | # from django.contrib.auth.models import User 2 | # from django.db import models 3 | 4 | 5 | # class RefreshToken(models.Model): 6 | # user = models.ForeignKey(User, on_delete=models.CASCADE) 7 | # token = models.TextField() 8 | # blacklisted = models.BooleanField(default=False) 9 | 10 | # def __str__(self): 11 | # return '{} ({}) {}'.format( 12 | # self.user, 13 | # self.token, 14 | # 'BLACKLISTED' if self.blacklisted else None 15 | # ) 16 | -------------------------------------------------------------------------------- /apps/jwt_auth/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/jwt_auth/tests/__init__.py -------------------------------------------------------------------------------- /apps/lang/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lang/__init__.py -------------------------------------------------------------------------------- /apps/lang/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LangConfig(AppConfig): 5 | name = 'lang' 6 | -------------------------------------------------------------------------------- /apps/lang/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lang/management/__init__.py -------------------------------------------------------------------------------- /apps/lang/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lang/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/lang/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lang/migrations/__init__.py -------------------------------------------------------------------------------- /apps/lang/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lang/tests/__init__.py -------------------------------------------------------------------------------- /apps/lead/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'lead.apps.LeadConfig' 2 | -------------------------------------------------------------------------------- /apps/lead/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LeadConfig(AppConfig): 5 | name = 'lead' 6 | -------------------------------------------------------------------------------- /apps/lead/migrations/0003_auto_20171004_0818.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-10-04 08:18 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0002_auto_20170929_1201'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='lead', 17 | options={'ordering': ['-modified_at', '-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/lead/migrations/0010_lead_classified_doc_id.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-12-21 06:36 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0009_lead_source_type'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='lead', 17 | name='classified_doc_id', 18 | field=models.IntegerField(blank=True, default=None, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/lead/migrations/0014_auto_20180114_1641.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-14 16:41 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0013_auto_20180107_0538'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='lead', 17 | name='url', 18 | field=models.TextField(), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/lead/migrations/0015_auto_20180115_0852.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-15 08:52 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0014_auto_20180114_1641'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='lead', 17 | name='url', 18 | field=models.TextField(blank=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/lead/migrations/0016_auto_20180216_0931.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-02-16 09:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0015_auto_20180115_0852'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='lead', 17 | options={'ordering': ['-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/lead/migrations/0022_merge_20190110_0605.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2019-01-10 06:05 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0021_auto_20180928_0753'), 12 | ('lead', '0021_auto_20181228_0942'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/lead/migrations/0022_remove_lead_tabular_book.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2019-01-31 09:45 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0021_auto_20181228_0942'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='lead', 17 | name='tabular_book', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/lead/migrations/0023_merge_20190205_1043.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2019-02-05 10:43 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('lead', '0022_remove_lead_tabular_book'), 12 | ('lead', '0022_merge_20190110_0605'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/lead/migrations/0024_lead_author.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.10 on 2019-08-19 06:14 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0023_merge_20190205_1043'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='lead', 15 | name='author', 16 | field=models.CharField(blank=True, max_length=255), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/lead/migrations/0029_merge_20190918_0941.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.10 on 2019-09-18 09:41 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0025_auto_20190828_0949'), 10 | ('lead', '0028_auto_20190912_0446'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/lead/migrations/0032_lead_authors.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-06-19 05:16 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('organization', '0009_auto_20191111_0845'), 10 | ('lead', '0031_auto_20191118_1438'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='lead', 16 | name='authors', 17 | field=models.ManyToManyField(blank=True, to='organization.Organization'), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/lead/migrations/0034_lead_priority.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-07-29 04:58 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0033_auto_20200715_0546'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='lead', 15 | name='priority', 16 | field=models.IntegerField(choices=[(100, 'Low'), (200, 'Medium'), (300, 'High')], default=100), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/lead/migrations/0035_auto_20201204_1259.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-12-04 12:59 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0034_lead_priority'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='lead', 15 | name='status', 16 | field=models.CharField(choices=[('pending', 'Not Tagged'), ('processed', 'In progress'), ('validated', 'Tagged')], default='pending', max_length=30), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/lead/migrations/0036_lead_is_assessment_lead.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-07-15 03:48 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0035_auto_20201204_1259'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='lead', 15 | name='is_assessment_lead', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/lead/migrations/0039_remove_lead_website.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-04-13 04:43 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0038_lead_extraction_status'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='lead', 15 | name='website', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/lead/migrations/0041_merge_20220512_0415.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.12 on 2022-05-12 04:15 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0039_remove_lead_website'), 10 | ('lead', '0040_alter_lead_confidentiality'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/lead/migrations/0042_lead_uuid.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.12 on 2022-05-18 05:35 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0041_merge_20220512_0415'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='lead', 15 | name='uuid', 16 | field=models.UUIDField(blank=True, editable=False, null=True, unique=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/lead/migrations/0045_lead_duplicate_leads.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.15 on 2022-12-20 10:01 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0044_usersavedleadfilter'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='lead', 15 | name='duplicate_leads', 16 | field=models.ManyToManyField(blank=True, related_name='duplicate_of', to='lead.Lead'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/lead/migrations/0050_delete_extractedlead.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-11-23 04:41 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('lead', '0049_auto_20231121_0926'), 10 | ] 11 | 12 | operations = [ 13 | migrations.DeleteModel( 14 | name='ExtractedLead', 15 | ), 16 | ] 17 | -------------------------------------------------------------------------------- /apps/lead/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lead/migrations/__init__.py -------------------------------------------------------------------------------- /apps/lead/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lead/tests/__init__.py -------------------------------------------------------------------------------- /apps/lead/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/lead/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/lead/tests/test_unit.py: -------------------------------------------------------------------------------- 1 | from utils.common import sanitize_text 2 | 3 | 4 | def test_lead_text_extract_transform_tab_and_nbsp(): 5 | """Test fitler and tansform extracted word""" 6 | extracted_text = 'Hello, this is extracted\t text that contains  .' 7 | expected_text = 'Hello, this is extracted text that contains .' 8 | assert sanitize_text(extracted_text) == expected_text 9 | -------------------------------------------------------------------------------- /apps/lead/typings.py: -------------------------------------------------------------------------------- 1 | from typing import TypedDict 2 | 3 | 4 | class NlpExtractorDocument(TypedDict): 5 | url: str 6 | client_id: str 7 | -------------------------------------------------------------------------------- /apps/notification/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'notification.apps.NotificationConfig' 2 | -------------------------------------------------------------------------------- /apps/notification/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import ( 3 | Notification, 4 | Assignment 5 | ) 6 | 7 | 8 | @admin.register(Notification) 9 | class Notification(admin.ModelAdmin): 10 | list_display = ('receiver', 'project', 'notification_type', 'timestamp', 'status') 11 | list_filter = ('notification_type', 'status') 12 | 13 | 14 | @admin.register(Assignment) 15 | class Assignment(admin.ModelAdmin): 16 | pass 17 | -------------------------------------------------------------------------------- /apps/notification/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class NotificationConfig(AppConfig): 5 | name = 'notification' 6 | 7 | def ready(self): 8 | from . import receivers # noqa 9 | -------------------------------------------------------------------------------- /apps/notification/factories.py: -------------------------------------------------------------------------------- 1 | from factory.django import DjangoModelFactory 2 | 3 | from notification.models import ( 4 | Assignment, 5 | Notification, 6 | ) 7 | 8 | 9 | class NotificationFactory(DjangoModelFactory): 10 | class Meta: 11 | model = Notification 12 | 13 | 14 | class AssignmentFactory(DjangoModelFactory): 15 | class Meta: 16 | model = Assignment 17 | -------------------------------------------------------------------------------- /apps/notification/migrations/0007_alter_notification_data.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-05-03 04:31 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('notification', '0006_assignment'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='notification', 15 | name='data', 16 | field=models.JSONField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/notification/migrations/0008_merge_20210805_0715.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-08-05 07:15 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('notification', '0007_alter_notification_data'), 10 | ('notification', '0007_auto_20210427_0507'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/notification/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/notification/migrations/__init__.py -------------------------------------------------------------------------------- /apps/notification/receivers/__init__.py: -------------------------------------------------------------------------------- 1 | from . import project_membership # noqa: F401 2 | from . import entry_comment # noqa: F401 3 | from . import assignment # noqa: F401 4 | -------------------------------------------------------------------------------- /apps/notification/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/notification/templatetags/__init__.py -------------------------------------------------------------------------------- /apps/notification/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/notification/tests/__init__.py -------------------------------------------------------------------------------- /apps/organization/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/organization/__init__.py -------------------------------------------------------------------------------- /apps/organization/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class OrganizationConfig(AppConfig): 5 | name = 'organization' 6 | -------------------------------------------------------------------------------- /apps/organization/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from .models import Organization 3 | 4 | 5 | class MergeForm(forms.Form): 6 | parent_organization = forms.ModelChoiceField( 7 | queryset=Organization.objects.none(), 8 | required=True, 9 | ) 10 | 11 | def __init__(self, *args, **kwargs): 12 | qs = kwargs.pop('organizations') 13 | super().__init__(*args, **kwargs) 14 | self.fields['parent_organization'].queryset = qs 15 | -------------------------------------------------------------------------------- /apps/organization/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/organization/management/__init__.py -------------------------------------------------------------------------------- /apps/organization/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/organization/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/organization/migrations/0004_organization_donor.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-05-14 09:59 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('organization', '0003_auto_20180510_0711'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='organization', 17 | name='donor', 18 | field=models.BooleanField(default=False), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/organization/migrations/0006_auto_20190425_0510.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-04-25 05:10 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('organization', '0005_auto_20190416_0713'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='organization', 15 | name='verified', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/organization/migrations/0007_remove_organization_donor.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-05-17 04:48 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('organization', '0006_auto_20190425_0510'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='organization', 15 | name='donor', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/organization/migrations/0010_organizationtype_short_name.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-11-13 05:39 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('organization', '0009_auto_20191111_0845'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='organizationtype', 15 | name='short_name', 16 | field=models.CharField(blank=True, max_length=255, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/organization/migrations/0012_organization_popularity.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.15 on 2022-11-21 09:21 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('organization', '0011_organization_source'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='organization', 15 | name='popularity', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/organization/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/organization/migrations/__init__.py -------------------------------------------------------------------------------- /apps/organization/tasks.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from celery import shared_task 4 | from django.core.management import call_command 5 | from utils.common import redis_lock 6 | 7 | 8 | logger = logging.getLogger(__name__) 9 | 10 | 11 | @shared_task 12 | @redis_lock('sync_organization_with_relief_web') 13 | def sync_organization_with_relief_web(): 14 | call_command('load_organizations') 15 | return True 16 | 17 | 18 | @shared_task 19 | @redis_lock('update_organization_popularity') 20 | def update_organization_popularity(): 21 | call_command('update_organization_popularity') 22 | return True 23 | -------------------------------------------------------------------------------- /apps/organization/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/organization/tests/__init__.py -------------------------------------------------------------------------------- /apps/profiling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/profiling/__init__.py -------------------------------------------------------------------------------- /apps/profiling/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ProfilingConfig(AppConfig): 5 | name = 'profiling' 6 | -------------------------------------------------------------------------------- /apps/profiling/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/profiling/management/__init__.py -------------------------------------------------------------------------------- /apps/profiling/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/profiling/management/commands/__init__.py -------------------------------------------------------------------------------- /apps/project/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/project/__init__.py -------------------------------------------------------------------------------- /apps/project/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ProjectConfig(AppConfig): 5 | name = 'project' 6 | 7 | def ready(self): 8 | import project.receivers # noqa 9 | -------------------------------------------------------------------------------- /apps/project/migrations/0001_project_is_test.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.12 on 2022-06-24 06:34 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', 'rename_duplicate_project_name'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='is_test', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0004_project_enable_publicly_viewable_analysis_report_snapshot.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-10-06 04:56 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0003_auto_20230508_0608'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='enable_publicly_viewable_analysis_report_snapshot', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0004_project_is_assessment_enabled.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-11-29 05:46 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0003_auto_20230508_0608'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='is_assessment_enabled', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0005_auto_20171004_0818.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-10-04 08:18 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0004_auto_20170921_0753'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='project', 17 | options={'ordering': ['-modified_at', '-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/project/migrations/0005_merge_20231227_0610.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-12-27 06:10 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0004_project_enable_publicly_viewable_analysis_report_snapshot'), 10 | ('project', 'set_is_assessment_enabled_true'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/project/migrations/0006_projectpinned_modified_at.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2024-01-09 06:11 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0005_projectpinned'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='projectpinned', 15 | name='modified_at', 16 | field=models.DateTimeField(auto_now=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0007_merge_20240218_0618.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2024-02-18 06:18 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0005_merge_20231227_0610'), 10 | ('project', '0006_projectpinned_modified_at'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/project/migrations/0008_alter_projectpinned_unique_together.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.25 on 2024-05-21 04:56 2 | 3 | from django.conf import settings 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 11 | ('project', '0007_merge_20240218_0618'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterUniqueTogether( 16 | name='projectpinned', 17 | unique_together={('project', 'user')}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/project/migrations/0012_auto_20180216_0931.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-02-16 09:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0011_project_category_editor'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='project', 17 | options={'ordering': ['-created_at']}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/project/migrations/0015_project_dummy.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-03-20 11:41 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0014_auto_20180308_0630'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='project', 17 | name='dummy', 18 | field=models.BooleanField(default=False), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0016_auto_20180320_1145.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-03-20 11:45 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0015_project_dummy'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='project', 17 | old_name='dummy', 18 | new_name='is_default', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0023_auto_20180605_0827.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-06-05 08:27 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0022_auto_20180605_0822'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='projectstatuscondition', 17 | old_name='value', 18 | new_name='days', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0024_auto_20180612_0859.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-06-12 08:59 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0023_auto_20180605_0827'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterModelOptions( 16 | name='projectstatus', 17 | options={'verbose_name_plural': 'project statuses'}, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/project/migrations/0027_merge_20180708_0706.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-07-08 07:06 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0026_auto_20180707_1209'), 12 | ('project', '0025_projectjoinrequest_role'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/project/migrations/0031_remove_project_user_groups.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-09-13 10:59 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0030_auto_20180913_1050'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='project', 17 | name='user_groups', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/project/migrations/0032_auto_20180913_1100.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-09-13 11:00 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0031_remove_project_user_groups'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='project', 17 | old_name='user_group_new', 18 | new_name='user_groups', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0035_auto_20180815_1014.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Created by bewakes 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('project', '0034_auto_20180815_1013'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name='projectmembership', 18 | name='is_directly_added', 19 | field=models.BooleanField(default=False), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /apps/project/migrations/0039_projectrole_assessment_permissions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-08-30 10:03 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0038_auto_20180819_1038'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='projectrole', 17 | name='assessment_permissions', 18 | field=models.IntegerField(default=0), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0041_merge_20180930_0624.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-09-30 06:24 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0034_auto_20180913_1116'), 12 | ('project', '0040_auto_20180902_0709'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/project/migrations/0049_projectrole_level.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-11-27 09:00 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0048_auto_20181123_0928'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='projectrole', 17 | name='level', 18 | field=models.IntegerField(blank=True, default=None, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0050_auto_20181127_0954.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-11-27 10:04 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0049_projectrole_level'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='projectrole', 17 | name='title', 18 | field=models.CharField(max_length=255), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0052_auto_20181127_1015.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-11-27 10:15 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0051_auto_20181127_1005'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='projectrole', 17 | name='title', 18 | field=models.CharField(max_length=255, unique=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0053_auto_20181127_1114.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-11-27 11:14 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('project', '0052_auto_20181127_1015'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='projectrole', 17 | name='level', 18 | field=models.IntegerField(default=0), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/project/migrations/0055_project_is_private.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-06-17 11:28 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0054_auto_20181227_0506'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='is_private', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0060_project_is_visualization_enabled.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-12-17 06:08 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0059_auto_20191202_0826'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='is_visualization_enabled', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0061_projectarystats_confidential_file.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-04-03 10:06 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0060_project_is_visualization_enabled'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='projectarystats', 15 | name='confidential_file', 16 | field=models.FileField(blank=True, max_length=255, null=True, upload_to='entry-stats/'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0063_auto_20200715_1131.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-07-15 11:31 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0062_auto_20200715_1015'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='project', 15 | name='organizations', 16 | field=models.ManyToManyField(blank=True, through='project.ProjectOrganization', to='organization.Organization'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0064_merge_20200917_1003.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-09-17 10:03 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0063_auto_20200715_1131'), 10 | ('project', '0063_projectjoinrequest_data_squashed_0064_auto_20200902_0438'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/project/migrations/0065_project_stats_cache.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-01-26 10:21 2 | 3 | import django.contrib.postgres.fields.jsonb 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('project', '0064_merge_20200917_1003'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='project', 16 | name='stats_cache', 17 | field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/project/migrations/0066_projectstats_token.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-03-22 04:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0065_project_stats_cache'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='projectstats', 15 | name='token', 16 | field=models.UUIDField(null=True, unique=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0068_project_status.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-04-06 09:17 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0067_auto_20210406_0916'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='status', 16 | field=models.CharField(choices=[('active', 'Active'), ('inactive', 'Inactive')], default='inactive', max_length=30), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0069_projectstats_public_share.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-04-09 04:23 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0068_project_status'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='projectstats', 15 | name='public_share', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0070_merge_20210603_0624.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-03 06:24 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0067_auto_20210503_0431'), 10 | ('project', '0069_projectstats_public_share'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/project/migrations/0072_merge_20210805_0715.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-08-05 07:15 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0070_merge_20210603_0624'), 10 | ('project', '0071_projectusergroupmembership_badges'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/project/migrations/0075_project_has_publicly_viewable_leads.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-04-13 09:24 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0074_projectrole_type'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='project', 15 | name='has_publicly_viewable_leads', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/project/migrations/0077_merge_0076_auto_20220520_0834_0076_auto_20220524_0523.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.12 on 2022-05-27 08:00 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('project', '0076_auto_20220520_0834'), 10 | ('project', '0076_auto_20220524_0523'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/project/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/project/migrations/__init__.py -------------------------------------------------------------------------------- /apps/project/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/project/tests/__init__.py -------------------------------------------------------------------------------- /apps/project/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/project/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/quality_assurance/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/quality_assurance/__init__.py -------------------------------------------------------------------------------- /apps/quality_assurance/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class QualityAssuranceConfig(AppConfig): 5 | name = 'quality_assurance' 6 | -------------------------------------------------------------------------------- /apps/quality_assurance/factories.py: -------------------------------------------------------------------------------- 1 | import factory 2 | from factory.django import DjangoModelFactory 3 | 4 | from .models import EntryReviewComment, EntryReviewCommentText 5 | 6 | 7 | class EntryReviewCommentFactory(DjangoModelFactory): 8 | class Meta: 9 | model = EntryReviewComment 10 | 11 | 12 | class EntryReviewCommentTextFactory(DjangoModelFactory): 13 | text = factory.Sequence(lambda n: f'Text-{n}') 14 | 15 | class Meta: 16 | model = EntryReviewCommentText 17 | -------------------------------------------------------------------------------- /apps/quality_assurance/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/quality_assurance/migrations/__init__.py -------------------------------------------------------------------------------- /apps/quality_assurance/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/quality_assurance/tests/__init__.py -------------------------------------------------------------------------------- /apps/questionnaire/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/questionnaire/__init__.py -------------------------------------------------------------------------------- /apps/questionnaire/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import ( 4 | CrisisType, 5 | ) 6 | 7 | 8 | @admin.register(CrisisType) 9 | class CrisisTypeAdmin(admin.ModelAdmin): 10 | pass 11 | -------------------------------------------------------------------------------- /apps/questionnaire/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class QuestionnaireConfig(AppConfig): 5 | name = 'questionnaire' 6 | -------------------------------------------------------------------------------- /apps/questionnaire/migrations/0008_auto_20200519_0922.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2020-05-19 09:22 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('questionnaire', '0007_auto_20200519_0915'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterUniqueTogether( 14 | name='question', 15 | unique_together={('questionnaire', 'name')}, 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /apps/questionnaire/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/questionnaire/migrations/__init__.py -------------------------------------------------------------------------------- /apps/questionnaire/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/questionnaire/utils/__init__.py -------------------------------------------------------------------------------- /apps/redis_store/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'redis_store.apps.RedisStoreConfig' 2 | -------------------------------------------------------------------------------- /apps/redis_store/admin.py: -------------------------------------------------------------------------------- 1 | # from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/redis_store/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | from redis_store import redis 3 | 4 | 5 | class RedisStoreConfig(AppConfig): 6 | name = 'redis_store' 7 | 8 | def ready(self): 9 | redis.init() 10 | -------------------------------------------------------------------------------- /apps/redis_store/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/redis_store/migrations/__init__.py -------------------------------------------------------------------------------- /apps/redis_store/models.py: -------------------------------------------------------------------------------- 1 | # from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /apps/redis_store/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/redis_store/tests/__init__.py -------------------------------------------------------------------------------- /apps/redis_store/tests/test_redis.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | from redis_store import redis 3 | 4 | 5 | class RedisConnectionTest(TestCase): 6 | """ 7 | A redis connection test 8 | """ 9 | 10 | def test_set_and_del(self): 11 | """ 12 | Test redis connection by writing, reading and deleting a value 13 | """ 14 | r = redis.get_connection() 15 | r.set('foo', 'bar') 16 | self.assertEqual(r.get('foo'), b'bar') 17 | r.delete('foo') 18 | self.assertEqual(r.get('foo'), None) 19 | -------------------------------------------------------------------------------- /apps/redis_store/tests/tests.py: -------------------------------------------------------------------------------- 1 | # from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /apps/redis_store/views.py: -------------------------------------------------------------------------------- 1 | # from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /apps/static/doc_export/template.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/doc_export/template.docx -------------------------------------------------------------------------------- /apps/static/doc_export/template_02.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/doc_export/template_02.docx -------------------------------------------------------------------------------- /apps/static/image/deep-logo-long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/deep-logo-long.png -------------------------------------------------------------------------------- /apps/static/image/deep-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/deep-logo.png -------------------------------------------------------------------------------- /apps/static/image/deep_chart_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/deep_chart_preview.png -------------------------------------------------------------------------------- /apps/static/image/drop-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/drop-icon.png -------------------------------------------------------------------------------- /apps/static/image/skype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/skype.png -------------------------------------------------------------------------------- /apps/static/image/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/slack.png -------------------------------------------------------------------------------- /apps/static/image/zendesk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/static/image/zendesk.png -------------------------------------------------------------------------------- /apps/static/js/jsoneditor-init.js: -------------------------------------------------------------------------------- 1 | django_jsoneditor_init = { 2 | mode: 'view', 3 | modes: ['code', 'form', 'text', 'tree', 'view'] // all modes 4 | } 5 | -------------------------------------------------------------------------------- /apps/tabular/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'tabular.apps.TabularConfig' 2 | -------------------------------------------------------------------------------- /apps/tabular/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class TabularConfig(AppConfig): 5 | name = 'tabular' 6 | 7 | def ready(self): 8 | import tabular.receivers # noqa 9 | -------------------------------------------------------------------------------- /apps/tabular/extractor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/tabular/extractor/__init__.py -------------------------------------------------------------------------------- /apps/tabular/migrations/0003_remove_book_pending.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-10-24 09:50 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('tabular', '0002_auto_20181024_0902'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='book', 17 | name='pending', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0004_auto_20181024_1303.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-10-24 13:03 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('tabular', '0003_remove_book_pending'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RenameField( 16 | model_name='field', 17 | old_name='label', 18 | new_name='title', 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0010_remove_sheet_data.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-12-30 07:07 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('tabular', '0009_auto_20181121_0626'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='sheet', 17 | name='data', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0014_merge_20190205_0951.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.18 on 2019-02-05 09:51 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('tabular', '0013_auto_20190131_1019'), 12 | ('tabular', '0013_auto_20190131_0852'), 13 | ] 14 | 15 | operations = [ 16 | ] 17 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0015_remove_book_meta_status.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.18 on 2019-02-10 06:37 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('tabular', '0014_merge_20190205_0951'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='book', 17 | name='meta_status', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0018_auto_20190308_1400.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-08 14:00 2 | 3 | import django.contrib.postgres.fields.jsonb 4 | from django.db import migrations 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('tabular', '0017_field_cache'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='field', 16 | name='data', 17 | field=django.contrib.postgres.fields.jsonb.JSONField(default=list), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0019_auto_20190313_0705.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-13 07:05 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('tabular', '0018_auto_20190308_1400'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='book', 15 | name='file_type', 16 | field=models.CharField(choices=[('csv', 'CSV'), ('xlsx', 'XLSX'), ('ods', 'ODS')], max_length=30), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/tabular/migrations/0020_sheet_data_row_index.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-05-06 09:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('tabular', '0019_auto_20190313_0705'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='sheet', 15 | name='data_row_index', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/tabular/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/tabular/migrations/__init__.py -------------------------------------------------------------------------------- /apps/tabular/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/tabular/tests/__init__.py -------------------------------------------------------------------------------- /apps/tabular/viz/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/tabular/viz/__init__.py -------------------------------------------------------------------------------- /apps/tabular/viz/timeseries.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/tabular/viz/timeseries.py -------------------------------------------------------------------------------- /apps/templates/admin/organization_change_list.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/change_list.html" %} 2 | {% block object-tools-items %} 3 | 4 | {{ block.super }} 5 |
  • Re-Sync
  • 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /apps/templates/ary/ary_change_list.html: -------------------------------------------------------------------------------- 1 | {% extends "reversion/change_list.html" %} 2 | {% block object-tools-items %} 3 | 4 | {{ block.super }} 5 |
  • Export
  • 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /apps/templates/base.html: -------------------------------------------------------------------------------- 1 | {% extends "admin/base.html" %} 2 | {% load i18n static %} 3 | 4 | {% block extrastyle %} 5 | {{ block.super }} 6 | 7 | {% endblock %} 8 | 9 | {% block branding %}

    DEEP ({{ DEEP_ENVIRONMENT | title }})

    {% endblock %} 10 | {% block breadcrumbs %} {% endblock %} 11 | {% block content_title %}

    {{ title }}

    {% endblock %} 12 | -------------------------------------------------------------------------------- /apps/templates/entry/comment_notification_email.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Entry Comment #ENTRY-{{comment.entry_id}} 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /apps/templates/entry/review_comment_notification_email.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Entry Review Comment #ENTRY-{{comment.entry_id}} 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /apps/templates/organization/merge_tree_view.html: -------------------------------------------------------------------------------- 1 | {% load admin_urls %} 2 | 3 |
  • 4 | {{obj}} 5 | 12 |
  • 13 | -------------------------------------------------------------------------------- /apps/templates/password_changed/subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Password Changed 4 | {% endautoescape %} -------------------------------------------------------------------------------- /apps/templates/project/project_join_accept.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Project Request Accept 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /apps/templates/project/project_join_accept_email.html: -------------------------------------------------------------------------------- 1 | {% extends "base_email.html" %} 2 | 3 | {% block title %} 4 |

    5 | Hi there {{ user.get_display_name }}, 6 | Your request to join {{ project.title }} have been accepted for role {{ role }}. 7 |

    8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /apps/templates/project/project_join_reject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Project Request Reject 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /apps/templates/project/project_join_reject_email.html: -------------------------------------------------------------------------------- 1 | {% extends "base_email.html" %} 2 | 3 | {% block title %} 4 |

    5 | Hi there {{ user.get_display_name }}, 6 | Your request to join {{ project.title }} have been rejected for role {{ role }}. 7 |

    8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /apps/templates/project/project_join_request.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Project Request 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /apps/templates/registration/base_email.html: -------------------------------------------------------------------------------- 1 | {% extends "base_email.html" %} 2 | {% block body %} 3 | {% block container %}{% endblock %} 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /apps/templates/registration/password_reset_subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | {% if welcome %}Welcome to DEEP{% else %}DEEP Password Reset{% endif %} 3 | {% endautoescape %} 4 | -------------------------------------------------------------------------------- /apps/templates/registration/user_activation_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n static %} 3 | 4 | {% block content %} 5 | 6 | {% if success %} 7 |

    {% trans "Thank you for confirming your email. You may now login to DEEP." %}

    8 | {% else %} 9 |

    {% trans "Activation link is invalid!" %}

    10 | {% endif %} 11 | Login 12 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /apps/templates/registration/user_activation_subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% autoescape off %} 3 | DEEP Account Activation 4 | {% endautoescape %} 5 | -------------------------------------------------------------------------------- /apps/templates/rest_framework/api.html: -------------------------------------------------------------------------------- 1 | {% extends "rest_framework/base.html" %} 2 | 3 | {% block branding %} 4 | 5 | DEEP API ({{ DEEP_ENVIRONMENT | title }}) 6 | 7 | {% endblock %} 8 | 9 | 10 | -------------------------------------------------------------------------------- /apps/templates/rest_framework/login_base.html: -------------------------------------------------------------------------------- 1 | {% extends "rest_framework/login_base.html" %} 2 | 3 | 4 | {% block branding %} 5 |

    DEEP API ({{ DEEP_ENVIRONMENT | title }})

    6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /apps/templates/user/unsubscribe_email__confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% load i18n static %} 3 | 4 | {% block content %} 5 | 6 | {% if success %} 7 |

    8 | Successfully unsubscribed 9 |

    10 | {% else %} 11 |

    12 | Unsubscribe link is invalid! you must be already unsubscribed 13 |

    14 | {% endif %} 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /apps/unified_connector/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/unified_connector/__init__.py -------------------------------------------------------------------------------- /apps/unified_connector/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UnifiedConnectorConfig(AppConfig): 5 | name = 'unified_connector' 6 | -------------------------------------------------------------------------------- /apps/unified_connector/migrations/0004_connectorlead_website.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.10 on 2022-03-08 18:01 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('unified_connector', '0003_alter_connectorleadpreviewimage_connector_lead'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='connectorlead', 15 | name='website', 16 | field=models.CharField(blank=True, max_length=255), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/unified_connector/migrations/0008_connectorlead_text_extraction_id.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.17 on 2023-12-22 06:38 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('unified_connector', '0007_alter_connectorsource_source'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='connectorlead', 15 | name='text_extraction_id', 16 | field=models.UUIDField(blank=True, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/unified_connector/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/unified_connector/migrations/__init__.py -------------------------------------------------------------------------------- /apps/unified_connector/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/unified_connector/tests/__init__.py -------------------------------------------------------------------------------- /apps/unified_connector/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/unified_connector/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/user/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user/__init__.py -------------------------------------------------------------------------------- /apps/user/migrations/0002_profile_hid.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-10-04 09:54 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('user', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='profile', 17 | name='hid', 18 | field=models.TextField(blank=True, default=None, null=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/user/migrations/0004_auto_20171129_0851.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2017-11-29 08:51 3 | from __future__ import unicode_literals 4 | 5 | from django.contrib.postgres.operations import CreateExtension 6 | from django.db import migrations 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('user', '0003_auto_20171016_1028'), 13 | ] 14 | 15 | operations = [ 16 | CreateExtension('pg_trgm'), 17 | CreateExtension('postgis'), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/user/migrations/0007_profile_login_attempts.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-02-16 09:31 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('user', '0006_profile_last_active_project'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='profile', 17 | name='login_attempts', 18 | field=models.IntegerField(default=0), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/user/migrations/0010_profile_receive_email.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-08-01 05:45 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('user', '0009_profile_language'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='profile', 17 | name='receive_email', 18 | field=models.BooleanField(default=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/user/migrations/0013_profile_experimental.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.15 on 2018-12-30 09:12 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('user', '0012_auto_20181120_0559'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='profile', 17 | name='experimental', 18 | field=models.BooleanField(default=False), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/user/migrations/0016_profile_invalid_email.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.8 on 2019-04-25 09:21 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user', '0015_auto_20190221_0525'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='profile', 15 | name='invalid_email', 16 | field=models.BooleanField(default=False, help_text='Flagged as bounce email'), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/user/migrations/0018_auto_20190624_1017.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-06-24 10:17 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user', '0017_emaildomain_feature_featureaccess'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='profile', 15 | name='is_early_access', 16 | ), 17 | migrations.RemoveField( 18 | model_name='profile', 19 | name='is_experimental', 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /apps/user/migrations/0024_feature_is_available_for_all.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.15 on 2021-01-12 07:06 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user', '0023_auto_20200120_0834'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='feature', 15 | name='is_available_for_all', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/user/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user/migrations/__init__.py -------------------------------------------------------------------------------- /apps/user/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user/tests/__init__.py -------------------------------------------------------------------------------- /apps/user_group/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'user_group.apps.UserGroupConfig' 2 | -------------------------------------------------------------------------------- /apps/user_group/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserGroupConfig(AppConfig): 5 | name = 'user_group' 6 | 7 | def ready(self): 8 | from . import receivers # noqa 9 | -------------------------------------------------------------------------------- /apps/user_group/enums.py: -------------------------------------------------------------------------------- 1 | from utils.graphene.enums import ( 2 | convert_enum_to_graphene_enum, 3 | get_enum_name_from_django_field, 4 | ) 5 | 6 | from .models import GroupMembership 7 | 8 | GroupMembershipRoleEnum = convert_enum_to_graphene_enum(GroupMembership.Role, name='GroupMembershipRoleEnum') 9 | 10 | enum_map = { 11 | get_enum_name_from_django_field(field): enum 12 | for field, enum in ( 13 | (GroupMembership.role, GroupMembershipRoleEnum), 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /apps/user_group/migrations/0007_usergroup_description.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-11 10:49 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('user_group', '0006_auto_20171122_0522'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='usergroup', 17 | name='description', 18 | field=models.TextField(blank=True), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /apps/user_group/migrations/0008_remove_usergroup_display_picture.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.11.4 on 2018-01-30 04:32 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('user_group', '0007_usergroup_description'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='usergroup', 17 | name='display_picture', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /apps/user_group/migrations/0013_alter_usergroup_custom_project_fields.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-05-03 04:31 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user_group', '0012_auto_20180604_0732'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='usergroup', 15 | name='custom_project_fields', 16 | field=models.JSONField(blank=True, default=None, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /apps/user_group/migrations/0014_merge_20210625_0417.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2 on 2021-06-25 04:17 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('user_group', '0013_alter_usergroup_custom_project_fields'), 10 | ('user_group', '0013_auto_20210621_1515'), 11 | ] 12 | 13 | operations = [ 14 | ] 15 | -------------------------------------------------------------------------------- /apps/user_group/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user_group/migrations/__init__.py -------------------------------------------------------------------------------- /apps/user_group/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user_group/tests/__init__.py -------------------------------------------------------------------------------- /apps/user_group/tests/snapshots/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user_group/tests/snapshots/__init__.py -------------------------------------------------------------------------------- /apps/user_resource/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user_resource/__init__.py -------------------------------------------------------------------------------- /apps/user_resource/admin.py: -------------------------------------------------------------------------------- 1 | # from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /apps/user_resource/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserResourceConfig(AppConfig): 5 | name = 'user_resource' 6 | -------------------------------------------------------------------------------- /apps/user_resource/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/apps/user_resource/migrations/__init__.py -------------------------------------------------------------------------------- /apps/user_resource/views.py: -------------------------------------------------------------------------------- 1 | # from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | github_checks: 2 | annotations: false -------------------------------------------------------------------------------- /deep/__init__.py: -------------------------------------------------------------------------------- 1 | # This will make sure the app is always imported when 2 | # Django starts so that shared_task will use this app. 3 | from .celery import app as celery_app 4 | 5 | __all__ = ['celery_app'] 6 | -------------------------------------------------------------------------------- /deep/authentication.py: -------------------------------------------------------------------------------- 1 | from rest_framework.authentication import SessionAuthentication 2 | 3 | 4 | class CSRFExemptSessionAuthentication(SessionAuthentication): 5 | def enforce_csrf(self, _): 6 | # Enforce for all request 7 | return True 8 | -------------------------------------------------------------------------------- /deep/context_processor.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | 3 | 4 | def deep(request): 5 | return { 6 | 'request': request, 7 | 'DEEP_ENVIRONMENT': settings.DEEP_ENVIRONMENT, 8 | } 9 | -------------------------------------------------------------------------------- /deep/converters.py: -------------------------------------------------------------------------------- 1 | class FileNameRegex: 2 | regex = '.*' 3 | 4 | def to_python(self, value): 5 | return value 6 | 7 | def to_url(self, value): 8 | return value 9 | -------------------------------------------------------------------------------- /deep/error_codes.py: -------------------------------------------------------------------------------- 1 | TOKEN_INVALID = 4001 2 | NOT_AUTHENTICATED = 4011 3 | AUTHENTICATION_FAILED = 4012 4 | INVALID_CAPTCHA = 4004 5 | 6 | USER_INACTIVE = 4013 7 | USER_NOT_FOUND = 4014 8 | USER_CREDENDIALS_MISSMATCH = 4015 9 | 10 | 11 | ENTRY_VALIDATION_VERSION_MISMATCH = 4016 12 | -------------------------------------------------------------------------------- /deep/number_generator.py: -------------------------------------------------------------------------------- 1 | import string 2 | import random 3 | 4 | 5 | def client_id_generator(size=16, chars=string.ascii_uppercase + string.digits): 6 | return ''.join(random.choice(chars) for _ in range(size)) 7 | -------------------------------------------------------------------------------- /deep/paginations.py: -------------------------------------------------------------------------------- 1 | from rest_framework import pagination 2 | 3 | 4 | class AutocompleteSetPagination(pagination.LimitOffsetPagination): 5 | default_limit = 10 6 | max_limit = 15 7 | 8 | 9 | class SmallSizeSetPagination(pagination.LimitOffsetPagination): 10 | default_limit = 10 11 | max_limit = 50 12 | 13 | 14 | class AssignmentPagination(pagination.LimitOffsetPagination): 15 | default_limit = 5 16 | max_limit = 10 17 | -------------------------------------------------------------------------------- /deep/s3_storages.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from storages.backends.s3boto3 import S3Boto3Storage 3 | 4 | 5 | class StaticStorage(S3Boto3Storage): 6 | location = settings.STATICFILES_LOCATION 7 | default_acl = 'public-read' 8 | bucket_name = settings.AWS_STORAGE_BUCKET_NAME_STATIC 9 | querystring_auth = False 10 | 11 | 12 | class MediaStorage(S3Boto3Storage): 13 | location = settings.MEDIAFILES_LOCATION 14 | bucket_name = settings.AWS_STORAGE_BUCKET_NAME_MEDIA 15 | -------------------------------------------------------------------------------- /deep/test_files/documents/doc.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/deep/test_files/documents/doc.docx -------------------------------------------------------------------------------- /deep/test_files/documents/doc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/deep/test_files/documents/doc.pdf -------------------------------------------------------------------------------- /deep/test_files/documents/doc.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/deep/test_files/documents/doc.pptx -------------------------------------------------------------------------------- /deep/test_files/documents/pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "pdf": 2, 3 | "docx": 14, 4 | "pptx": 21 5 | } 6 | -------------------------------------------------------------------------------- /deep/test_files/documents_urls/pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "pdf": 1, 3 | "docx": 3, 4 | "pptx": 2, 5 | "html": 1 6 | } 7 | -------------------------------------------------------------------------------- /deep/test_files/geo.json: -------------------------------------------------------------------------------- 1 | { 2 | "testKey": "testValue" 3 | } 4 | -------------------------------------------------------------------------------- /deep/tests/__init__.py: -------------------------------------------------------------------------------- 1 | from .test_case import * # noqa 2 | -------------------------------------------------------------------------------- /deep/tests/test_api_exception.py: -------------------------------------------------------------------------------- 1 | from deep.tests import TestCase 2 | from deep.error_codes import NOT_AUTHENTICATED 3 | 4 | 5 | class ApiExceptionTests(TestCase): 6 | def test_notoken_exception(self): 7 | url = '/api/v1/users/{}/'.format(self.user.pk) 8 | data = { 9 | 'password': 'newpassword', 10 | } 11 | 12 | response = self.client.patch(url, data) 13 | self.assertEqual(response.status_code, 401) 14 | self.assertIsNotNone(response.data['timestamp']) 15 | self.assertEqual(response.data['error_code'], NOT_AUTHENTICATED) 16 | -------------------------------------------------------------------------------- /deep/tests/test_fake.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | 4 | class FakeTest(TestCase): 5 | """ 6 | This test is for running migrations only 7 | docker-compose run --rm server ./manage.py test -v 2 --pattern="deep/tests/test_fake.py" 8 | """ 9 | def test_fake(self): 10 | pass 11 | -------------------------------------------------------------------------------- /deep/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for deep project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "deep.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /deploy/configs/log_files.yml-sample: -------------------------------------------------------------------------------- 1 | files: 2 | - path: /var/log/uwsgi/access.log 3 | tag: uwsgi/access 4 | - path: /var/log/uwsgi/error.log 5 | tag: uwsgi/error 6 | - path: /var/log/celery/celery.log 7 | tag: celery 8 | - path: /var/log/daphne/access.log 9 | tag: django-channel 10 | - path: /var/log/deep.log 11 | tag: deep-info 12 | 13 | hostname: 14 | destination: 15 | host: 16 | port: 17 | protocol: tls 18 | -------------------------------------------------------------------------------- /deploy/configs/uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | 3 | chdir = /code/ 4 | module = deep.wsgi 5 | 6 | master = true 7 | processes = 10 8 | http = 0.0.0.0:80 9 | chmod = 666 10 | 11 | vacuum = true 12 | harakiri = 60 13 | -------------------------------------------------------------------------------- /deploy/cronjobs: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | * * * * * /aws-script/aws-scripts-mon/mon-put-instance-data.pl --mem-util --mem-used --mem-avail --swap-util --swap-used --disk-space-util --disk-space-used --disk-space-avail --disk-path=/ --from-cron --auto-scaling=only 4 | -------------------------------------------------------------------------------- /deploy/scripts/in_web_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$EBS_ENV_TYPE" == "web" ]; then 4 | exit 0 5 | fi 6 | 7 | exit 1 8 | -------------------------------------------------------------------------------- /deploy/scripts/run_web.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # /code/deploy/scripts/ -> /code/ 4 | BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | ROOT_DIR=$(dirname "$(dirname "$BASE_DIR")") 6 | 7 | # echo '>> [Running] Django Collectstatic and Migrate' 8 | # python3 $ROOT_DIR/manage.py collectstatic --no-input >> /var/log/deep.log 2>&1 9 | # python3 $ROOT_DIR/manage.py migrate --no-input >> /var/log/deep.log 2>&1 10 | uwsgi --ini $ROOT_DIR/deploy/configs/uwsgi.ini # Start uwsgi server 11 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | # Global options: 2 | # TODO: Complete this configuration 3 | 4 | [mypy] 5 | mypy_path = ./apps/ 6 | plugins = 7 | mypy_django_plugin.main 8 | 9 | [mypy-*.migrations.*] 10 | ignore_errors = True 11 | 12 | [mypy.plugins.django-stubs] 13 | django_settings_module = "deep.settings" 14 | -------------------------------------------------------------------------------- /postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:9.6 2 | 3 | RUN apt update && apt install -y postgis postgresql-9.6-postgis-2.4-scripts 4 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | DJANGO_SETTINGS_MODULE = deep.settings 3 | ;addopts = --reuse-db 4 | log_cli = true 5 | -------------------------------------------------------------------------------- /scripts/list_relief_web_countries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function get_countries_data { 4 | curl 'https://api.reliefweb.int/v1/countries?fields[include][]=name&fields[include][]=iso3&limit=300' \ 5 | --globoff 6 | } 7 | 8 | COUNTRIES_DATA=`get_countries_data` 9 | 10 | echo $COUNTRIES_DATA | jq -r '.data[].fields | [.iso3, .name] | @csv' 11 | -------------------------------------------------------------------------------- /scripts/run_web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | export DOCKER_HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 4 | 5 | # python3 manage.py migrate --no-input 6 | # python3 manage.py createinitialrevisions 7 | 8 | python3 manage.py runserver 0.0.0.0:8000 9 | -------------------------------------------------------------------------------- /scripts/run_worker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | export DOCKER_HOST_IP=$(/sbin/ip route|awk '/default/ { print $3 }') 4 | 5 | mkdir -p /var/run/celery/ 6 | 7 | python3 manage.py run_celery_dev 8 | -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/__init__.py -------------------------------------------------------------------------------- /utils/db/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/db/__init__.py -------------------------------------------------------------------------------- /utils/external_storages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/external_storages/__init__.py -------------------------------------------------------------------------------- /utils/external_storages/dropbox.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from utils.common import write_file, DEFAULT_HEADERS 3 | import tempfile 4 | 5 | 6 | def download(file_url, SUPPORTED_MIME_TYPES): 7 | """ 8 | Download/Export file from google drive 9 | 10 | params: 11 | file_url: file url from dropbox 12 | """ 13 | 14 | outfp = tempfile.NamedTemporaryFile() 15 | 16 | # TODO: verify url 17 | r = requests.get(file_url, stream=True, headers=DEFAULT_HEADERS) 18 | mime_type = r.headers["content-type"] 19 | write_file(r, outfp) 20 | return outfp, mime_type 21 | -------------------------------------------------------------------------------- /utils/extractor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/extractor/__init__.py -------------------------------------------------------------------------------- /utils/extractor/exception.py: -------------------------------------------------------------------------------- 1 | class ExtractError(Exception): 2 | def __init__(self, *args, **kwargs): 3 | super().__init__(*args, **kwargs) 4 | -------------------------------------------------------------------------------- /utils/extractor/formats/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/extractor/formats/__init__.py -------------------------------------------------------------------------------- /utils/extractor/formats/ods.py: -------------------------------------------------------------------------------- 1 | import pyexcel_ods 2 | 3 | 4 | def extract_meta(xlsx_file): 5 | workbook = pyexcel_ods.get_data(xlsx_file) 6 | wb_sheets = [] 7 | for index, wb_sheet in enumerate(workbook): 8 | wb_sheets.append({ 9 | 'key': str(index), 10 | 'title': wb_sheet, 11 | }) 12 | return { 13 | 'sheets': wb_sheets, 14 | } 15 | -------------------------------------------------------------------------------- /utils/extractor/formats/xlsx.py: -------------------------------------------------------------------------------- 1 | from openpyxl import load_workbook 2 | 3 | 4 | def extract_meta(xlsx_file): 5 | workbook = load_workbook(xlsx_file, data_only=True, read_only=True) 6 | wb_sheets = [] 7 | for index, wb_sheet in enumerate(workbook.worksheets): 8 | if wb_sheet.sheet_state != 'hidden': 9 | wb_sheets.append({ 10 | 'key': str(index), 11 | 'title': wb_sheet.title, 12 | }) 13 | return { 14 | 'sheets': wb_sheets, 15 | } 16 | -------------------------------------------------------------------------------- /utils/extractor/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/extractor/tests/__init__.py -------------------------------------------------------------------------------- /utils/graphene/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/graphene/__init__.py -------------------------------------------------------------------------------- /utils/graphene/dataloaders.py: -------------------------------------------------------------------------------- 1 | from promise.dataloader import DataLoader 2 | 3 | 4 | class WithContextMixin(): 5 | def __init__(self, *args, **kwargs): 6 | self.context = kwargs.pop('context') 7 | super().__init__(*args, **kwargs) 8 | 9 | 10 | class DataLoaderWithContext(WithContextMixin, DataLoader): 11 | # def batch_load_fn TODO: Add logging for errors traceback (for graphene v3) 12 | pass 13 | -------------------------------------------------------------------------------- /utils/graphene/options.py: -------------------------------------------------------------------------------- 1 | from graphene.types.base import BaseOptions 2 | 3 | 4 | class CustomObjectTypeOptions(BaseOptions): 5 | fields = None 6 | interfaces = () 7 | base_type = None 8 | registry = None 9 | connection = None 10 | create_container = None 11 | results_field_name = None 12 | input_for = None 13 | filterset_class = None 14 | -------------------------------------------------------------------------------- /utils/hid/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/hid/__init__.py -------------------------------------------------------------------------------- /utils/hid/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/hid/tests/__init__.py -------------------------------------------------------------------------------- /utils/logger.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-deep/server/6833c015c6d85d210d08e292dee415f662475f33/utils/logger.py -------------------------------------------------------------------------------- /utils/web_info_extractor/__init__.py: -------------------------------------------------------------------------------- 1 | from urllib.parse import urlparse 2 | 3 | from .default import DefaultWebInfoExtractor 4 | from .redhum import RedhumWebInfoExtractor 5 | 6 | 7 | EXTRACTORS = { 8 | 'redhum.org': RedhumWebInfoExtractor, 9 | } 10 | 11 | 12 | def get_web_info_extractor(url): 13 | website = urlparse(url).netloc 14 | return EXTRACTORS.get(website, DefaultWebInfoExtractor)(url) 15 | --------------------------------------------------------------------------------