diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile.example | 25 | ||||
| -rw-r--r-- | UPGRADE.md | 30 | ||||
| -rw-r--r-- | archaeological_context_records/forms.py | 7 | ||||
| -rw-r--r-- | archaeological_context_records/migrations/0001_initial.py | 893 | ||||
| -rw-r--r-- | archaeological_context_records/migrations/0002_auto_20170414_2123.py | 46 | ||||
| -rw-r--r-- | archaeological_context_records/migrations/0003_auto_20170414_2123.py | 104 | ||||
| -rw-r--r-- | archaeological_context_records/migrations/0004_views.py | 17 | ||||
| -rw-r--r-- | archaeological_context_records/migrations/0034_auto__chg_field_contextrecordsource_external_id.py | 681 | ||||
| -rw-r--r-- | archaeological_context_records/models.py | 68 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0001_initial.py | 587 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0002_auto__add_field_contextrecordsource_reference__add_field_contextrecord.py (renamed from archaeological_context_records/migrations/0002_auto__add_field_contextrecordsource_reference__add_field_contextrecord.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0003_auto__add_field_contextrecord_history_creator__add_field_historicalcon.py (renamed from archaeological_context_records/migrations/0003_auto__add_field_contextrecord_history_creator__add_field_historicalcon.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0004_init_history_creator.py (renamed from archaeological_context_records/migrations/0004_init_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0005_reinit_history_creator.py (renamed from archaeological_context_records/migrations/0005_reinit_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0006_auto__chg_field_contextrecord_history_creator__chg_field_contextrecord.py (renamed from archaeological_context_records/migrations/0006_auto__chg_field_contextrecord_history_creator__chg_field_contextrecord.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0007_auto__add_relationtype__add_recordrelations.py (renamed from archaeological_context_records/migrations/0007_auto__add_relationtype__add_recordrelations.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0008_auto__add_field_contextrecord_external_id__add_field_contextrecord_com.py (renamed from archaeological_context_records/migrations/0008_auto__add_field_contextrecord_external_id__add_field_contextrecord_com.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0009_auto__add_field_contextrecordsource_external_id.py (renamed from archaeological_context_records/migrations/0009_auto__add_field_contextrecordsource_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0010_auto.py (renamed from archaeological_context_records/migrations/0010_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py (renamed from archaeological_context_records/migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0012_auto__add_field_dating_precise_dating.py (renamed from archaeological_context_records/migrations/0012_auto__add_field_dating_precise_dating.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0013_auto__add_field_contextrecordsource_duplicate__chg_field_contextrecord.py (renamed from archaeological_context_records/migrations/0013_auto__add_field_contextrecordsource_duplicate__chg_field_contextrecord.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0014_auto__add_field_contextrecordsource_receipt_date_in_documentation.py (renamed from archaeological_context_records/migrations/0014_auto__add_field_contextrecordsource_receipt_date_in_documentation.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0015_auto__add_field_contextrecord_point__add_field_contextrecord_polygon__.py (renamed from archaeological_context_records/migrations/0015_auto__add_field_contextrecord_point__add_field_contextrecord_polygon__.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0016_auto__add_field_relationtype_short_label.py (renamed from archaeological_context_records/migrations/0016_auto__add_field_relationtype_short_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0017_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py (renamed from archaeological_context_records/migrations/0017_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0018_auto__chg_field_contextrecord_external_id__chg_field_historicalcontext.py (renamed from archaeological_context_records/migrations/0018_auto__chg_field_contextrecord_external_id__chg_field_historicalcontext.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0019_auto__add_field_contextrecord_auto_external_id__add_field_historicalco.py (renamed from archaeological_context_records/migrations/0019_auto__add_field_contextrecord_auto_external_id__add_field_historicalco.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0020_auto__add_field_contextrecord_datings_comment__add_field_historicalcon.py (renamed from archaeological_context_records/migrations/0020_auto__add_field_contextrecord_datings_comment__add_field_historicalcon.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0021_auto__chg_field_contextrecord_depth__chg_field_contextrecord_thickness.py (renamed from archaeological_context_records/migrations/0021_auto__chg_field_contextrecord_depth__chg_field_contextrecord_thickness.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0022_auto__add_field_contextrecord_image__add_field_contextrecord_thumbnail.py (renamed from archaeological_context_records/migrations/0022_auto__add_field_contextrecord_image__add_field_contextrecord_thumbnail.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0023_clean_parcels.py (renamed from archaeological_context_records/migrations/0023_clean_parcels.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0024_auto__add_field_contextrecord_cached_label__add_field_historicalcontex.py (renamed from archaeological_context_records/migrations/0024_auto__add_field_contextrecord_cached_label__add_field_historicalcontex.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0025_generate_cached_label.py (renamed from archaeological_context_records/migrations/0025_generate_cached_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0026_auto__chg_field_contextrecord_image__chg_field_contextrecord_thumbnail.py (renamed from archaeological_context_records/migrations/0026_auto__chg_field_contextrecord_image__chg_field_contextrecord_thumbnail.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0027_view_record_relations.py (renamed from archaeological_context_records/migrations/0027_view_record_relations.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0028_auto__chg_field_contextrecord_location__chg_field_historicalcontextrec.py (renamed from archaeological_context_records/migrations/0028_auto__chg_field_contextrecord_location__chg_field_historicalcontextrec.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0029_create_bulk_update_view.py (renamed from archaeological_context_records/migrations/0029_create_bulk_update_view.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0030_auto__add_excavationtechnictype__add_field_contextrecord_excavation_te.py (renamed from archaeological_context_records/migrations/0030_auto__add_excavationtechnictype__add_field_contextrecord_excavation_te.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0031_auto__add_documentationtype__add_field_contextrecord_diameter__add_fie.py (renamed from archaeological_context_records/migrations/0031_auto__add_documentationtype__add_field_contextrecord_diameter__add_fie.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0032_has_furniture_to_documentations.py (renamed from archaeological_context_records/migrations/0032_has_furniture_to_documentations.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/0033_auto__del_field_contextrecord_has_furniture__del_field_historicalconte.py (renamed from archaeological_context_records/migrations/0033_auto__del_field_contextrecord_has_furniture__del_field_historicalconte.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/old_migrations/__init__.py (renamed from archaeological_files_pdl/migrations/__init__.py) | 0 | ||||
| -rw-r--r-- | archaeological_context_records/templates/ishtar/sheet_contextrecord.html | 2 | ||||
| -rw-r--r-- | archaeological_context_records/tests.py | 2 | ||||
| -rw-r--r-- | archaeological_context_records/urls.py | 2 | ||||
| -rw-r--r-- | archaeological_context_records/views.py | 6 | ||||
| -rw-r--r-- | archaeological_files/migrations/0001_initial.py | 503 | ||||
| -rw-r--r-- | archaeological_files/migrations/0002_auto_20170414_2123.py | 188 | ||||
| -rw-r--r-- | archaeological_files/migrations/0003_views.py | 16 | ||||
| -rw-r--r-- | archaeological_files/models.py | 41 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0001_initial.py | 348 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0002_views.py (renamed from archaeological_files/migrations/0002_views.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0003_auto__add_field_file_name__add_field_historicalfile_name.py (renamed from archaeological_files/migrations/0003_auto__add_field_file_name__add_field_historicalfile_name.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0004_auto__chg_field_file_numeric_reference__chg_field_historicalfile_numer.py (renamed from archaeological_files/migrations/0004_auto__chg_field_file_numeric_reference__chg_field_historicalfile_numer.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0005_auto__chg_field_file_internal_reference__chg_field_historicalfile_inte.py (renamed from archaeological_files/migrations/0005_auto__chg_field_file_internal_reference__chg_field_historicalfile_inte.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0006_auto__chg_field_file_in_charge.py (renamed from archaeological_files/migrations/0006_auto__chg_field_file_in_charge.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0007_auto__add_field_file_cached_label__add_field_historicalfile_cached_lab.py (renamed from archaeological_files/migrations/0007_auto__add_field_file_cached_label__add_field_historicalfile_cached_lab.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0008_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py (renamed from archaeological_files/migrations/0008_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0009_auto__add_field_file_responsible_town_planning_service__add_field_hist.py (renamed from archaeological_files/migrations/0009_auto__add_field_file_responsible_town_planning_service__add_field_hist.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0010_responsible_town_planning_service_transition.py (renamed from archaeological_files/migrations/0010_responsible_town_planning_service_transition.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0011_auto__del_field_file_town_planning_service__del_field_historicalfile_t.py (renamed from archaeological_files/migrations/0011_auto__del_field_file_town_planning_service__del_field_historicalfile_t.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0012_auto__del_unique_file_internal_reference__add_unique_file_year_interna.py (renamed from archaeological_files/migrations/0012_auto__del_unique_file_internal_reference__add_unique_file_year_interna.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0013_auto__del_unique_file_year_internal_reference.py (renamed from archaeological_files/migrations/0013_auto__del_unique_file_year_internal_reference.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py (renamed from archaeological_files/migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0015_auto__add_field_file_history_creator__add_field_historicalfile_history.py (renamed from archaeological_files/migrations/0015_auto__add_field_file_history_creator__add_field_historicalfile_history.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0016_init_history_creator.py (renamed from archaeological_files/migrations/0016_init_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0017_reinit_history_creator.py (renamed from archaeological_files/migrations/0017_reinit_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0018_auto__add_field_file_imported_line__chg_field_file_responsible_town_pl.py (renamed from archaeological_files/migrations/0018_auto__add_field_file_imported_line__chg_field_file_responsible_town_pl.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0019_auto__chg_field_file_history_creator__chg_field_file_history_modifier.py (renamed from archaeological_files/migrations/0019_auto__chg_field_file_history_creator__chg_field_file_history_modifier.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0020_auto.py (renamed from archaeological_files/migrations/0020_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py (renamed from archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0022_auto__add_field_file_corporation_general_contractor__add_field_file_co.py (renamed from archaeological_files/migrations/0022_auto__add_field_file_corporation_general_contractor__add_field_file_co.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0023_auto__del_field_file_corporation_responsible_town_planning_service__ad.py (renamed from archaeological_files/migrations/0023_auto__del_field_file_corporation_responsible_town_planning_service__ad.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0024_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py (renamed from archaeological_files/migrations/0024_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0025_auto__add_field_file_external_id__chg_field_file_name__add_field_histo.py (renamed from archaeological_files/migrations/0025_auto__add_field_file_external_id__chg_field_file_name__add_field_histo.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0026_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py (renamed from archaeological_files/migrations/0026_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0027_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py (renamed from archaeological_files/migrations/0027_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0028_auto__chg_field_file_requested_operation_type.py (renamed from archaeological_files/migrations/0028_auto__chg_field_file_requested_operation_type.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0029_auto__chg_field_file_creation_date__chg_field_historicalfile_creation_.py (renamed from archaeological_files/migrations/0029_auto__chg_field_file_creation_date__chg_field_historicalfile_creation_.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0030_reference_number_to_permit_reference.py (renamed from archaeological_files/migrations/0030_reference_number_to_permit_reference.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0031_auto__del_field_file_reference_number__chg_field_file_permit_reference.py (renamed from archaeological_files/migrations/0031_auto__del_field_file_reference_number__chg_field_file_permit_reference.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0032_auto__add_field_file_auto_external_id__add_field_historicalfile_auto_e.py (renamed from archaeological_files/migrations/0032_auto__add_field_file_auto_external_id__add_field_historicalfile_auto_e.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/0033_auto__chg_field_file_total_surface__chg_field_file_total_developed_sur.py (renamed from archaeological_files/migrations/0033_auto__chg_field_file_total_surface__chg_field_file_total_developed_sur.py) | 0 | ||||
| -rw-r--r-- | archaeological_files/old_migrations/__init__.py | 0 | ||||
| -rw-r--r-- | archaeological_files/templates/ishtar/blocks/window_file_nav.html | 1 | ||||
| -rw-r--r-- | archaeological_files/templates/ishtar/sheet_file.html | 5 | ||||
| -rw-r--r-- | archaeological_files/tests.py | 54 | ||||
| -rw-r--r-- | archaeological_files/urls.py | 2 | ||||
| -rw-r--r-- | archaeological_files/views.py | 6 | ||||
| -rw-r--r-- | archaeological_files_pdl/templates/ishtar/wizard/file_confirm_wizard.html | 1 | ||||
| -rw-r--r-- | archaeological_files_pdl/urls.py | 2 | ||||
| -rw-r--r-- | archaeological_finds/forms_treatments.py | 55 | ||||
| -rw-r--r-- | archaeological_finds/migrations/0001_initial.py | 1408 | ||||
| -rw-r--r-- | archaeological_finds/migrations/0002_auto_20170414_2123.py | 503 | ||||
| -rw-r--r-- | archaeological_finds/migrations/0003_views.py | 22 | ||||
| -rw-r--r-- | archaeological_finds/migrations/0086_auto__chg_field_treatmentsource_external_id__chg_field_treatmentfileso.py | 1251 | ||||
| -rw-r--r-- | archaeological_finds/models_finds.py | 92 | ||||
| -rw-r--r-- | archaeological_finds/models_treatments.py | 70 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0001_initial.py | 814 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0002_auto__add_field_findsource_reference__add_field_findsource_internal_re.py (renamed from archaeological_finds/migrations/0002_auto__add_field_findsource_reference__add_field_findsource_internal_re.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0003_auto__add_field_materialtype_code.py (renamed from archaeological_finds/migrations/0003_auto__add_field_materialtype_code.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0004_auto__add_field_historicalfind_image__add_field_historicalfind_thumbna.py (renamed from archaeological_finds/migrations/0004_auto__add_field_historicalfind_image__add_field_historicalfind_thumbna.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0005_auto__add_conservatorystate__add_field_historicalfind_conservatory_sta.py (renamed from archaeological_finds/migrations/0005_auto__add_conservatorystate__add_field_historicalfind_conservatory_sta.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0006_auto__add_field_historicalfind_history_creator_id__add_field_treatment.py (renamed from archaeological_finds/migrations/0006_auto__add_field_historicalfind_history_creator_id__add_field_treatment.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0007_init_history_creator.py (renamed from archaeological_finds/migrations/0007_init_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0008_reinit_history_creator.py (renamed from archaeological_finds/migrations/0008_reinit_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0009_auto__chg_field_materialtype_recommendation__chg_field_treatment_perso.py (renamed from archaeological_finds/migrations/0009_auto__chg_field_materialtype_recommendation__chg_field_treatment_perso.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0010_auto__chg_field_treatment_history_creator__chg_field_treatment_history.py (renamed from archaeological_finds/migrations/0010_auto__chg_field_treatment_history_creator__chg_field_treatment_history.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0011_auto__add_field_historicalfind_weight_unit__add_field_historicalfind_d.py (renamed from archaeological_finds/migrations/0011_auto__add_field_historicalfind_weight_unit__add_field_historicalfind_d.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0012_auto__add_preservationtype__add_field_historicalfind_preservation_to_c.py (renamed from archaeological_finds/migrations/0012_auto__add_preservationtype__add_field_historicalfind_preservation_to_c.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0013_auto__del_field_historicalfind_discovery_date__del_field_find_discover.py (renamed from archaeological_finds/migrations/0013_auto__del_field_historicalfind_discovery_date__del_field_find_discover.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0014_auto__chg_field_find_dating.py (renamed from archaeological_finds/migrations/0014_auto__chg_field_find_dating.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0015_auto__add_field_historicalfind_external_id__add_field_find_external_id.py (renamed from archaeological_finds/migrations/0015_auto__add_field_historicalfind_external_id__add_field_find_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0016_auto__add_field_treatment_external_id__add_field_historicaltreatment_e.py (renamed from archaeological_finds/migrations/0016_auto__add_field_treatment_external_id__add_field_historicaltreatment_e.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0017_auto__add_field_findsource_external_id__add_field_treatmentsource_exte.py (renamed from archaeological_finds/migrations/0017_auto__add_field_findsource_external_id__add_field_treatmentsource_exte.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0018_auto.py (renamed from archaeological_finds/migrations/0018_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py (renamed from archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0020_auto__chg_field_historicalfind_weight_unit__chg_field_find_weight_unit.py (renamed from archaeological_finds/migrations/0020_auto__chg_field_historicalfind_weight_unit__chg_field_find_weight_unit.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0021_auto__add_objecttype__add_field_historicalfind_is_complete__add_field_.py (renamed from archaeological_finds/migrations/0021_auto__add_objecttype__add_field_historicalfind_is_complete__add_field_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0022_auto__add_field_objecttype_parent.py (renamed from archaeological_finds/migrations/0022_auto__add_field_objecttype_parent.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0023_auto__del_field_historicalfind_heigth__add_field_historicalfind_height.py (renamed from archaeological_finds/migrations/0023_auto__del_field_historicalfind_heigth__add_field_historicalfind_height.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0024_auto.py (renamed from archaeological_finds/migrations/0024_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0025_find_to_finds.py (renamed from archaeological_finds/migrations/0025_find_to_finds.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0026_auto__del_field_historicalfind_material_type_id__del_field_find_materi.py (renamed from archaeological_finds/migrations/0026_auto__del_field_historicalfind_material_type_id__del_field_find_materi.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0027_auto__add_field_historicalfind_index__add_field_find_index.py (renamed from archaeological_finds/migrations/0027_auto__add_field_historicalfind_index__add_field_find_index.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0028_auto.py (renamed from archaeological_finds/migrations/0028_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0029_dating_to_datings.py (renamed from archaeological_finds/migrations/0029_dating_to_datings.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0030_auto__del_field_historicalfind_dating_id__del_field_find_dating.py (renamed from archaeological_finds/migrations/0030_auto__del_field_historicalfind_dating_id__del_field_find_dating.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0031_auto__add_field_historicalfind_dating_comment__add_field_find_dating_c.py (renamed from archaeological_finds/migrations/0031_auto__add_field_historicalfind_dating_comment__add_field_find_dating_c.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0032_auto__add_field_historicalfind_checked__add_field_find_checked.py (renamed from archaeological_finds/migrations/0032_auto__add_field_historicalfind_checked__add_field_find_checked.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0033_auto__add_field_historicalfind_check_date__add_field_find_check_date.py (renamed from archaeological_finds/migrations/0033_auto__add_field_historicalfind_check_date__add_field_find_check_date.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0034_auto__add_field_historicalbasefind_cache_short_id__add_field_historica.py (renamed from archaeological_finds/migrations/0034_auto__add_field_historicalbasefind_cache_short_id__add_field_historica.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0035_auto.py (renamed from archaeological_finds/migrations/0035_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0036_preservation_to_preservations.py (renamed from archaeological_finds/migrations/0036_preservation_to_preservations.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0037_auto__del_field_historicalfind_preservation_to_consider_id__del_field_.py (renamed from archaeological_finds/migrations/0037_auto__del_field_historicalfind_preservation_to_consider_id__del_field_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0038_auto__add_field_historicalbasefind_batch__add_field_basefind_batch.py (renamed from archaeological_finds/migrations/0038_auto__add_field_historicalbasefind_batch__add_field_basefind_batch.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0039_is_isolated_batch.py (renamed from archaeological_finds/migrations/0039_is_isolated_batch.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0040_auto__del_field_historicalbasefind_is_isolated__del_field_basefind_is_.py (renamed from archaeological_finds/migrations/0040_auto__del_field_historicalbasefind_is_isolated__del_field_basefind_is_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0041_auto__add_integritytype.py (renamed from archaeological_finds/migrations/0041_auto__add_integritytype.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0042_auto__chg_field_historicalfind_label__chg_field_find_label__chg_field_.py (renamed from archaeological_finds/migrations/0042_auto__chg_field_historicalfind_label__chg_field_find_label__chg_field_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0043_auto__add_field_findsource_duplicate__chg_field_findsource_internal_re.py (renamed from archaeological_finds/migrations/0043_auto__add_field_findsource_duplicate__chg_field_findsource_internal_re.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0044_auto__add_field_findsource_receipt_date_in_documentation__add_field_tr.py (renamed from archaeological_finds/migrations/0044_auto__add_field_findsource_receipt_date_in_documentation__add_field_tr.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0045_auto__add_findbasket__add_unique_findbasket_label_user.py (renamed from archaeological_finds/migrations/0045_auto__add_findbasket__add_unique_findbasket_label_user.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0046_auto__add_field_basefind_point__add_field_basefind_line__add_field_bas.py (renamed from archaeological_finds/migrations/0046_auto__add_field_basefind_point__add_field_basefind_line__add_field_bas.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0047_auto__add_field_historicalfind_conservatory_comment__add_field_histori.py (renamed from archaeological_finds/migrations/0047_auto__add_field_historicalfind_conservatory_comment__add_field_histori.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0048_auto__add_field_treatmenttype_upstream_is_many__add_field_treatmenttyp.py (renamed from archaeological_finds/migrations/0048_auto__add_field_treatmenttype_upstream_is_many__add_field_treatmenttyp.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0049_auto__chg_field_historicalfind_external_id__chg_field_find_external_id.py (renamed from archaeological_finds/migrations/0049_auto__chg_field_historicalfind_external_id__chg_field_find_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0050_auto__add_field_historicalfind_auto_external_id__add_field_find_auto_e.py (renamed from archaeological_finds/migrations/0050_auto__add_field_historicalfind_auto_external_id__add_field_find_auto_e.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0051_auto__add_remarkabilitytype.py (renamed from archaeological_finds/migrations/0051_auto__add_remarkabilitytype.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0052_auto__add_field_historicalfind_estimated_value__add_field_find_estimat.py (renamed from archaeological_finds/migrations/0052_auto__add_field_historicalfind_estimated_value__add_field_find_estimat.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0053_view_find_treatments.py (renamed from archaeological_finds/migrations/0053_view_find_treatments.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0054_rename_treatment_views.py (renamed from archaeological_finds/migrations/0054_rename_treatment_views.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0055_auto__add_field_findsource_image__add_field_findsource_thumbnail__add_.py (renamed from archaeological_finds/migrations/0055_auto__add_field_findsource_image__add_field_findsource_thumbnail__add_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0056_auto__add_field_historicalfind_cached_label__add_field_find_cached_lab.py (renamed from archaeological_finds/migrations/0056_auto__add_field_historicalfind_cached_label__add_field_find_cached_lab.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0057_generate_cached_label.py (renamed from archaeological_finds/migrations/0057_generate_cached_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0058_auto__chg_field_historicalfind_image__chg_field_historicalfind_thumbna.py (renamed from archaeological_finds/migrations/0058_auto__chg_field_historicalfind_image__chg_field_historicalfind_thumbna.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0059_auto__add_field_historicalfind_thickness__add_field_find_thickness.py (renamed from archaeological_finds/migrations/0059_auto__add_field_historicalfind_thickness__add_field_find_thickness.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0060_auto__add_field_historicalfind_topographic_reference_point__add_field_.py (renamed from archaeological_finds/migrations/0060_auto__add_field_historicalfind_topographic_reference_point__add_field_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0061_auto__add_field_historicalfind_min_number_of_individuals__add_field_fi.py (renamed from archaeological_finds/migrations/0061_auto__add_field_historicalfind_min_number_of_individuals__add_field_fi.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0062_auto__del_field_historicaltreatment_other_location__add_field_historic.py (renamed from archaeological_finds/migrations/0062_auto__del_field_historicaltreatment_other_location__add_field_historic.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0063_treats_generate_year_index.py (renamed from archaeological_finds/migrations/0063_treats_generate_year_index.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0064_auto__add_unique_treatment_index_year.py (renamed from archaeological_finds/migrations/0064_auto__add_unique_treatment_index_year.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0065_copy_treatment_types.py (renamed from archaeological_finds/migrations/0065_copy_treatment_types.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0066_auto__del_field_historicaltreatment_treatment_type_id__del_field_treat.py (renamed from archaeological_finds/migrations/0066_auto__del_field_historicaltreatment_treatment_type_id__del_field_treat.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0067_on_delete_for_views.py (renamed from archaeological_finds/migrations/0067_on_delete_for_views.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0068_auto__add_treatmentfile__add_unique_treatmentfile_year_index__add_hist.py (renamed from archaeological_finds/migrations/0068_auto__add_treatmentfile__add_unique_treatmentfile_year_index__add_hist.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0069_auto__add_field_historicaltreatment_file_id__add_field_treatment_file.py (renamed from archaeological_finds/migrations/0069_auto__add_field_historicaltreatment_file_id__add_field_treatment_file.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0070_auto__add_treatmentfilesource.py (renamed from archaeological_finds/migrations/0070_auto__add_treatmentfilesource.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0071_auto__add_field_historicaltreatment_cached_label__add_field_treatment_.py (renamed from archaeological_finds/migrations/0071_auto__add_field_historicaltreatment_cached_label__add_field_treatment_.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0072_auto__add_field_treatmentfile_applicant__add_field_treatmentfile_appli.py (renamed from archaeological_finds/migrations/0072_auto__add_field_treatmentfile_applicant__add_field_treatmentfile_appli.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0073_auto__add_treatmentstate__add_field_historicaltreatment_treatment_stat.py (renamed from archaeological_finds/migrations/0073_auto__add_treatmentstate__add_field_historicaltreatment_treatment_stat.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0074_auto__add_field_find_collection__add_field_historicalfind_collection_i.py (renamed from archaeological_finds/migrations/0074_auto__add_field_find_collection__add_field_historicalfind_collection_i.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0075_auto__chg_field_find_container__chg_field_find_upstream_treatment__chg.py (renamed from archaeological_finds/migrations/0075_auto__chg_field_find_container__chg_field_find_upstream_treatment__chg.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0076_auto__add_field_treatmenttype_order__add_field_treatmenttype_parent.py (renamed from archaeological_finds/migrations/0076_auto__add_field_treatmenttype_order__add_field_treatmenttype_parent.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0077_auto__add_field_historicaltreatment_estimated_cost__add_field_historic.py (renamed from archaeological_finds/migrations/0077_auto__add_field_historicaltreatment_estimated_cost__add_field_historic.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0078_fix_treatment_views.py (renamed from archaeological_finds/migrations/0078_fix_treatment_views.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0079_auto__del_field_find_topographic_reference_point__del_field_historical.py (renamed from archaeological_finds/migrations/0079_auto__del_field_find_topographic_reference_point__del_field_historical.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0080_auto__add_field_basefind_x__add_field_basefind_y__add_field_basefind_z.py (renamed from archaeological_finds/migrations/0080_auto__add_field_basefind_x__add_field_basefind_y__add_field_basefind_z.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0081_regenerate_treatment_views.py (renamed from archaeological_finds/migrations/0081_regenerate_treatment_views.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0082_auto__add_batchtype__add_field_basefind_new_batch__add_field_historica.py (renamed from archaeological_finds/migrations/0082_auto__add_batchtype__add_field_basefind_new_batch__add_field_historica.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0083_batch_to_new_batch.py (renamed from archaeological_finds/migrations/0083_batch_to_new_batch.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0084_auto__del_field_basefind_new_batch__chg_field_basefind_batch__del_fiel.py (renamed from archaeological_finds/migrations/0084_auto__del_field_basefind_new_batch__chg_field_basefind_batch__del_fiel.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/0085_create_bulk_update_view.py (renamed from archaeological_finds/migrations/0085_create_bulk_update_view.py) | 0 | ||||
| -rw-r--r-- | archaeological_finds/old_migrations/__init__.py | 0 | ||||
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 1 | ||||
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_treatment.html | 1 | ||||
| -rw-r--r-- | archaeological_finds/templates/ishtar/sheet_treatmentfile.html | 1 | ||||
| -rw-r--r-- | archaeological_finds/tests.py | 9 | ||||
| -rw-r--r-- | archaeological_finds/urls.py | 2 | ||||
| -rw-r--r-- | archaeological_finds/views.py | 6 | ||||
| -rw-r--r-- | archaeological_operations/forms.py | 67 | ||||
| -rw-r--r-- | archaeological_operations/migrations/0001_initial.py | 1038 | ||||
| -rw-r--r-- | archaeological_operations/migrations/0002_auto_20170414_2123.py | 365 | ||||
| -rw-r--r-- | archaeological_operations/migrations/0003_views.py | 16 | ||||
| -rw-r--r-- | archaeological_operations/migrations/0068_auto__chg_field_historicaloperation_code_patriarche__chg_field_operati.py | 873 | ||||
| -rw-r--r-- | archaeological_operations/migrations/0069_auto__chg_field_operationsource_external_id.py | 846 | ||||
| -rw-r--r-- | archaeological_operations/models.py | 82 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0001_initial.py | 655 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0002_views.py (renamed from archaeological_operations/migrations/0002_views.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0003_auto__add_field_operationtype_preventive.py (renamed from archaeological_operations/migrations/0003_auto__add_field_operationtype_preventive.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0004_auto__chg_field_historicaloperation_year__chg_field_operation_year.py (renamed from archaeological_operations/migrations/0004_auto__chg_field_historicaloperation_year__chg_field_operation_year.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0005_auto__chg_field_historicaloperation_operation_code__chg_field_operatio.py (renamed from archaeological_operations/migrations/0005_auto__chg_field_historicaloperation_operation_code__chg_field_operatio.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0006_auto__add_field_operationsource_reference__add_field_operationsource_i.py (renamed from archaeological_operations/migrations/0006_auto__add_field_operationsource_reference__add_field_operationsource_i.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0007_auto__chg_field_administrativeact_ref_sra__chg_field_historicaladminis.py (renamed from archaeological_operations/migrations/0007_auto__chg_field_administrativeact_ref_sra__chg_field_historicaladminis.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0008_auto__chg_field_operationsource_index__chg_field_operationsource_title.py (renamed from archaeological_operations/migrations/0008_auto__chg_field_operationsource_index__chg_field_operationsource_title.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0009_auto__add_field_historicaloperation_cached_label__add_field_operation_.py (renamed from archaeological_operations/migrations/0009_auto__add_field_historicaloperation_cached_label__add_field_operation_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0010_auto__chg_field_historicaloperation_cached_label__chg_field_operation_.py (renamed from archaeological_operations/migrations/0010_auto__chg_field_historicaloperation_cached_label__chg_field_operation_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0011_auto__add_field_historicaloperation_report_delivery_date__add_field_op.py (renamed from archaeological_operations/migrations/0011_auto__add_field_historicaloperation_report_delivery_date__add_field_op.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0012_auto.py (renamed from archaeological_operations/migrations/0012_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0013_auto__add_field_acttype_code.py (renamed from archaeological_operations/migrations/0013_auto__add_field_acttype_code.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0014_auto__add_archaeologicalsite.py (renamed from archaeological_operations/migrations/0014_auto__add_archaeologicalsite.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0015_auto__add_unique_archaeologicalsite_reference.py (renamed from archaeological_operations/migrations/0015_auto__add_unique_archaeologicalsite_reference.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0016_auto__add_field_acttype_indexed__add_field_historicaladministrativeact.py (renamed from archaeological_operations/migrations/0016_auto__add_field_acttype_indexed__add_field_historicaladministrativeact.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0017_rename_in_charge_to_scientist.py (renamed from archaeological_operations/migrations/0017_rename_in_charge_to_scientist.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0018_auto__add_field_historicaloperation_in_charge_id__add_field_operation_.py (renamed from archaeological_operations/migrations/0018_auto__add_field_historicaloperation_in_charge_id__add_field_operation_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0019_auto__add_field_historicaloperation_operator_id__add_field_operation_o.py (renamed from archaeological_operations/migrations/0019_auto__add_field_historicaloperation_operator_id__add_field_operation_o.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0020_auto__add_field_parcel_history_creator__add_field_historicaloperation_.py (renamed from archaeological_operations/migrations/0020_auto__add_field_parcel_history_creator__add_field_historicaloperation_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0021_init_history_creator.py (renamed from archaeological_operations/migrations/0021_init_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0022_auto__add_field_operationtype_order.py (renamed from archaeological_operations/migrations/0022_auto__add_field_operationtype_order.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0023_add_year_administrativact.py (renamed from archaeological_operations/migrations/0023_add_year_administrativact.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0024_reinit_history_creator.py (renamed from archaeological_operations/migrations/0024_reinit_history_creator.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0025_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py (renamed from archaeological_operations/migrations/0025_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0026_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py (renamed from archaeological_operations/migrations/0026_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0027_auto__add_field_historicaloperation_creation_date__add_field_operation.py (renamed from archaeological_operations/migrations/0027_auto__add_field_historicaloperation_creation_date__add_field_operation.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0028_init_creation_date.py (renamed from archaeological_operations/migrations/0028_init_creation_date.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0029_auto__chg_field_historicaloperation_creation_date__chg_field_operation.py (renamed from archaeological_operations/migrations/0029_auto__chg_field_historicaloperation_creation_date__chg_field_operation.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0030_auto__chg_field_parcel_history_creator__chg_field_parcel_history_modif.py (renamed from archaeological_operations/migrations/0030_auto__chg_field_parcel_history_creator__chg_field_parcel_history_modif.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0031_auto__add_field_parcel_address.py (renamed from archaeological_operations/migrations/0031_auto__add_field_parcel_address.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0032_auto__add_field_operationsource_support_type__add_field_operationsourc.py (renamed from archaeological_operations/migrations/0032_auto__add_field_operationsource_support_type__add_field_operationsourc.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0033_auto__add_field_parcel_external_id.py (renamed from archaeological_operations/migrations/0033_auto__add_field_parcel_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0034_auto__add_field_operationsource_external_id.py (renamed from archaeological_operations/migrations/0034_auto__add_field_operationsource_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0035_auto.py (renamed from archaeological_operations/migrations/0035_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0036_auto.py (renamed from archaeological_operations/migrations/0036_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py (renamed from archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0038_auto__add_unique_operation_code_patriarche.py (renamed from archaeological_operations/migrations/0038_auto__add_unique_operation_code_patriarche.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0039_auto__add_recordrelations__add_relationtype.py (renamed from archaeological_operations/migrations/0039_auto__add_recordrelations__add_relationtype.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0040_auto__chg_field_parcel_external_id.py (renamed from archaeological_operations/migrations/0040_auto__chg_field_parcel_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0041_rename_ope_type_2_ope_type_old.py (renamed from archaeological_operations/migrations/0041_rename_ope_type_2_ope_type_old.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0042_rename_ope_type_2_ope_type_old_2.py (renamed from archaeological_operations/migrations/0042_rename_ope_type_2_ope_type_old_2.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0043_auto__add_field_historicaladministrativeact_departments_label__add_fie.py (renamed from archaeological_operations/migrations/0043_auto__add_field_historicaladministrativeact_departments_label__add_fie.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0044_auto__add_field_historicaloperation_virtual_operation__add_field_histo.py (renamed from archaeological_operations/migrations/0044_auto__add_field_historicaloperation_virtual_operation__add_field_histo.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0045_auto__chg_field_historicaloperation_common_name__chg_field_operation_c.py (renamed from archaeological_operations/migrations/0045_auto__chg_field_historicaloperation_common_name__chg_field_operation_c.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0046_auto__add_reportstate__add_field_historicaloperation_report_processing.py (renamed from archaeological_operations/migrations/0046_auto__add_reportstate__add_field_historicaloperation_report_processing.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0047_auto__add_field_operationsource_duplicate__chg_field_operationsource_i.py (renamed from archaeological_operations/migrations/0047_auto__add_field_operationsource_duplicate__chg_field_operationsource_i.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0048_auto__add_field_operationsource_receipt_date_in_documentation.py (renamed from archaeological_operations/migrations/0048_auto__add_field_operationsource_receipt_date_in_documentation.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0049_auto__add_field_historicaloperation_abstract__add_field_operation_abst.py (renamed from archaeological_operations/migrations/0049_auto__add_field_historicaloperation_abstract__add_field_operation_abst.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0050_auto__chg_field_historicaloperation_code_dracar__chg_field_operation_c.py (renamed from archaeological_operations/migrations/0050_auto__chg_field_historicaloperation_code_dracar__chg_field_operation_c.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0051_auto__add_field_historicaloperation_point__add_field_historicaloperati.py (renamed from archaeological_operations/migrations/0051_auto__add_field_historicaloperation_point__add_field_historicaloperati.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0052_auto__add_field_relationtype_short_label.py (renamed from archaeological_operations/migrations/0052_auto__add_field_relationtype_short_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0053_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py (renamed from archaeological_operations/migrations/0053_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0054_auto__add_field_parcel_auto_external_id.py (renamed from archaeological_operations/migrations/0054_auto__add_field_parcel_auto_external_id.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0055_auto__add_field_parcel_public_domain.py (renamed from archaeological_operations/migrations/0055_auto__add_field_parcel_public_domain.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0056_auto__chg_field_parcel_section.py (renamed from archaeological_operations/migrations/0056_auto__chg_field_parcel_section.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0057_rename_code_dracar_to_old_code.py (renamed from archaeological_operations/migrations/0057_rename_code_dracar_to_old_code.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0058_auto__add_field_operationsource_image__add_field_operationsource_thumb.py (renamed from archaeological_operations/migrations/0058_auto__add_field_operationsource_image__add_field_operationsource_thumb.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0059_auto__add_field_historicaloperation_documentation_deadline__add_field_.py (renamed from archaeological_operations/migrations/0059_auto__add_field_historicaloperation_documentation_deadline__add_field_.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0060_auto__add_field_historicaloperation_scientific_documentation_comment__.py (renamed from archaeological_operations/migrations/0060_auto__add_field_historicaloperation_scientific_documentation_comment__.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0061_regenerate_cached_label.py (renamed from archaeological_operations/migrations/0061_regenerate_cached_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0062_auto__chg_field_operationsource_image__chg_field_operationsource_thumb.py (renamed from archaeological_operations/migrations/0062_auto__chg_field_operationsource_image__chg_field_operationsource_thumb.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py (renamed from archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0064_fix_old_operationtype.py (renamed from archaeological_operations/migrations/0064_fix_old_operationtype.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0065_auto__add_field_historicaloperation_address__add_field_operation_addre.py (renamed from archaeological_operations/migrations/0065_auto__add_field_historicaloperation_address__add_field_operation_addre.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0066_regenerate_cached_label.py (renamed from archaeological_operations/migrations/0066_regenerate_cached_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/0067_auto.py (renamed from archaeological_operations/migrations/0067_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_operations/old_migrations/__init__.py | 0 | ||||
| -rw-r--r-- | archaeological_operations/tests.py | 202 | ||||
| -rwxr-xr-x | archaeological_operations/tests/document_reference.odt | bin | 0 -> 11155 bytes | |||
| -rw-r--r-- | archaeological_operations/urls.py | 2 | ||||
| -rw-r--r-- | archaeological_operations/views.py | 32 | ||||
| -rw-r--r-- | archaeological_operations/wizards.py | 4 | ||||
| -rw-r--r-- | archaeological_warehouse/forms.py | 14 | ||||
| -rw-r--r-- | archaeological_warehouse/migrations/0001_initial.py | 399 | ||||
| -rw-r--r-- | archaeological_warehouse/migrations/0002_auto_20170414_2123.py | 105 | ||||
| -rw-r--r-- | archaeological_warehouse/models.py | 22 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0001_initial.py | 229 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0002_auto__add_field_warehouse_history_creator__add_field_container_history.py (renamed from archaeological_warehouse/migrations/0002_auto__add_field_warehouse_history_creator__add_field_container_history.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0003_auto__add_field_warehouse_email.py (renamed from archaeological_warehouse/migrations/0003_auto__add_field_warehouse_email.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0004_auto__chg_field_warehouse_history_creator__chg_field_warehouse_person_.py (renamed from archaeological_warehouse/migrations/0004_auto__chg_field_warehouse_history_creator__chg_field_warehouse_person_.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0005_auto__chg_field_warehouse_town.py (renamed from archaeological_warehouse/migrations/0005_auto__chg_field_warehouse_town.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0006_auto.py (renamed from archaeological_warehouse/migrations/0006_auto.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py (renamed from archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0008_auto__add_field_warehouse_alt_address__add_field_warehouse_alt_address.py (renamed from archaeological_warehouse/migrations/0008_auto__add_field_warehouse_alt_address__add_field_warehouse_alt_address.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0009_auto__chg_field_warehouse_phone_desc3__chg_field_warehouse_phone_desc2.py (renamed from archaeological_warehouse/migrations/0009_auto__chg_field_warehouse_phone_desc3__chg_field_warehouse_phone_desc2.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0010_auto__add_warehousedivisionlink__add_warehousedivision__chg_field_ware.py (renamed from archaeological_warehouse/migrations/0010_auto__add_warehousedivisionlink__add_warehousedivision__chg_field_ware.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py (renamed from archaeological_warehouse/migrations/0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0012_auto__add_field_container_cached_label.py (renamed from archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0013_auto__add_collection.py (renamed from archaeological_warehouse/migrations/0013_auto__add_collection.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0014_auto__add_field_container_cached_location__add_field_container_index.py (renamed from archaeological_warehouse/migrations/0014_auto__add_field_container_cached_location__add_field_container_index.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0015_auto_increment_existing_indexes.py (renamed from archaeological_warehouse/migrations/0015_auto_increment_existing_indexes.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0016_auto__add_unique_container_index_location.py (renamed from archaeological_warehouse/migrations/0016_auto__add_unique_container_index_location.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0017_auto__chg_field_container_comment.py (renamed from archaeological_warehouse/migrations/0017_auto__chg_field_container_comment.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0018_generate_cache_lbl_for_containers.py (renamed from archaeological_warehouse/migrations/0018_generate_cache_lbl_for_containers.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0019_auto__add_field_container_responsible.py (renamed from archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0020_generate_cache_lbl_for_containers.py (renamed from archaeological_warehouse/migrations/0020_generate_cache_lbl_for_containers.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0021_auto__chg_field_container_responsible.py (renamed from archaeological_warehouse/migrations/0021_auto__chg_field_container_responsible.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0022_auto__chg_field_containertype_volume.py (renamed from archaeological_warehouse/migrations/0022_auto__chg_field_containertype_volume.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0023_auto__add_field_container_external_id__add_field_container_auto_extern.py (renamed from archaeological_warehouse/migrations/0023_auto__add_field_container_external_id__add_field_container_auto_extern.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0024_generate_cache_lbl_for_containers.py (renamed from archaeological_warehouse/migrations/0024_generate_cache_lbl_for_containers.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0025_auto__add_field_container_image__add_field_container_thumbnail.py (renamed from archaeological_warehouse/migrations/0025_auto__add_field_container_image__add_field_container_thumbnail.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/0026_generate_cache_lbl_for_containers.py (renamed from archaeological_warehouse/migrations/0026_generate_cache_lbl_for_containers.py) | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/old_migrations/__init__.py | 0 | ||||
| -rw-r--r-- | archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html | 1 | ||||
| -rw-r--r-- | archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html | 1 | ||||
| -rw-r--r-- | archaeological_warehouse/urls.py | 2 | ||||
| -rw-r--r-- | archaeological_warehouse/views.py | 12 | ||||
| -rw-r--r-- | django-simple-history/AUTHORS | 14 | ||||
| -rw-r--r-- | django-simple-history/CHANGELOG | 5 | ||||
| -rw-r--r-- | django-simple-history/LICENSE.txt | 28 | ||||
| -rw-r--r-- | django-simple-history/MANIFEST.in | 5 | ||||
| -rw-r--r-- | django-simple-history/README | 77 | ||||
| -rw-r--r-- | django-simple-history/setup.py | 41 | ||||
| -rwxr-xr-x | django-simple-history/simple_history/__init__.py | 22 | ||||
| -rw-r--r-- | django-simple-history/simple_history/admin.py | 139 | ||||
| -rwxr-xr-x | django-simple-history/simple_history/manager.py | 75 | ||||
| -rw-r--r-- | django-simple-history/simple_history/models.py | 169 | ||||
| -rw-r--r-- | django-simple-history/simple_history/templates/simple_history/object_history.html | 38 | ||||
| -rw-r--r-- | django-simple-history/simple_history/templates/simple_history/object_history_form.html | 24 | ||||
| -rw-r--r-- | example_project/__init__.py | 3 | ||||
| -rw-r--r-- | example_project/local_settings.py.gitlab-ci | 4 | ||||
| -rw-r--r-- | example_project/local_settings.py.sample | 3 | ||||
| -rwxr-xr-x | example_project/manage.py | 17 | ||||
| -rw-r--r-- | example_project/settings.py | 24 | ||||
| -rw-r--r-- | example_project/urls.py | 2 | ||||
| -rw-r--r-- | install/README | 9 | ||||
| -rw-r--r-- | install/README.md | 33 | ||||
| -rw-r--r-- | install/django.wsgi.template | 7 | ||||
| -rwxr-xr-x | install/install.sh | 271 | ||||
| -rwxr-xr-x | install/ishtar-delete-instance | 101 | ||||
| -rwxr-xr-x[-rw-r--r--] | install/ishtar-install (renamed from install/install-ishtar.sh) | 236 | ||||
| -rwxr-xr-x | install/ishtar-prepare-instance | 329 | ||||
| -rwxr-xr-x | install/ishtar-update | 103 | ||||
| -rw-r--r-- | install/local_settings.py.sample | 16 | ||||
| -rw-r--r-- | install/nginx.conf.template | 18 | ||||
| -rw-r--r-- | install/post_install_script.py | 28 | ||||
| -rwxr-xr-x | install/uninstall.sh | 36 | ||||
| -rw-r--r-- | install/uwsgi.ini.template | 2 | ||||
| -rw-r--r-- | ishtar_common/__init__.py | 2 | ||||
| -rw-r--r-- | ishtar_common/admin.py | 10 | ||||
| -rw-r--r-- | ishtar_common/backend.py | 8 | ||||
| -rw-r--r-- | ishtar_common/context_processors.py | 3 | ||||
| -rw-r--r-- | ishtar_common/data_importer.py | 10 | ||||
| -rw-r--r-- | ishtar_common/forms.py | 4 | ||||
| -rw-r--r-- | ishtar_common/forms_common.py | 4 | ||||
| -rw-r--r-- | ishtar_common/management/commands/ishtar_migrate_odts.py | 91 | ||||
| -rw-r--r-- | ishtar_common/menus.py | 3 | ||||
| -rw-r--r-- | ishtar_common/migrations/0001_initial.py | 1238 | ||||
| -rw-r--r-- | ishtar_common/migrations/0002_change_ishtaruser_management.py | 25 | ||||
| -rw-r--r-- | ishtar_common/migrations/0003_auto_20170421_1613.py | 20 | ||||
| -rw-r--r-- | ishtar_common/migrations/0077_auto__add_administrationscript__add_administrationtask.py | 530 | ||||
| -rw-r--r-- | ishtar_common/model_merging.py | 22 | ||||
| -rw-r--r-- | ishtar_common/models.py | 260 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0001_initial.py | 408 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0002_auto__chg_field_person_surname.py (renamed from ishtar_common/migrations/0002_auto__chg_field_person_surname.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0003_auto__del_field_person_person_type.py (renamed from ishtar_common/migrations/0003_auto__del_field_person_person_type.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0004_auto.py (renamed from ishtar_common/migrations/0004_auto.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0005_auto__add_documenttemplate.py (renamed from ishtar_common/migrations/0005_auto__add_documenttemplate.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0006_auto__chg_field_organization_name__chg_field_historicalorganization_na.py (renamed from ishtar_common/migrations/0006_auto__chg_field_organization_name__chg_field_historicalorganization_na.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0007_auto__add_field_organization_history_creator__add_field_historicalorga.py (renamed from ishtar_common/migrations/0007_auto__add_field_organization_history_creator__add_field_historicalorga.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0008_init_history_creator.py (renamed from ishtar_common/migrations/0008_init_history_creator.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0009_auto__add_field_organization_email__add_field_historicalorganization_e.py (renamed from ishtar_common/migrations/0009_auto__add_field_organization_email__add_field_historicalorganization_e.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0010_auto__del_wizardstep__del_wizard__add_globalvar__chg_field_person_atta.py (renamed from ishtar_common/migrations/0010_auto__del_wizardstep__del_wizard__add_globalvar__chg_field_person_atta.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0011_auto__chg_field_person_surname__chg_field_person_name.py (renamed from ishtar_common/migrations/0011_auto__chg_field_person_surname__chg_field_person_name.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0012_auto__add_field_person_raw_name__chg_field_person_name.py (renamed from ishtar_common/migrations/0012_auto__add_field_person_raw_name__chg_field_person_name.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0013_auto__add_field_organization_merge_key__add_field_historicalorganizati.py (renamed from ishtar_common/migrations/0013_auto__add_field_organization_merge_key__add_field_historicalorganizati.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0014_auto__chg_field_organization_history_creator__chg_field_organization_h.py (renamed from ishtar_common/migrations/0014_auto__chg_field_organization_history_creator__chg_field_organization_h.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0015_auto__chg_field_organization_town__chg_field_historicalorganization_to.py (renamed from ishtar_common/migrations/0015_auto__chg_field_organization_town__chg_field_historicalorganization_to.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0016_auto__add_import.py (renamed from ishtar_common/migrations/0016_auto__add_import.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0017_auto__add_supporttype__add_format.py (renamed from ishtar_common/migrations/0017_auto__add_supporttype__add_format.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0018_auto__add_itemkey.py (renamed from ishtar_common/migrations/0018_auto__add_itemkey.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0019_auto__add_field_itemkey_importer.py (renamed from ishtar_common/migrations/0019_auto__add_field_itemkey_importer.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0020_auto__chg_field_person_title.py (renamed from ishtar_common/migrations/0020_auto__chg_field_person_title.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0021_auto__add_importerdefault__add_importertype__add_importtarget__add_for.py (renamed from ishtar_common/migrations/0021_auto__add_importerdefault__add_importertype__add_importtarget__add_for.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0022_auto__add_field_import_importer_type.py (renamed from ishtar_common/migrations/0022_auto__add_field_import_importer_type.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0023_auto__add_importerdefaultvalues__del_field_importerdefault_value.py (renamed from ishtar_common/migrations/0023_auto__add_importerdefaultvalues__del_field_importerdefault_value.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0024_auto__add_importerduplicatefield__chg_field_importerdefault_target__ad.py (renamed from ishtar_common/migrations/0024_auto__add_importerduplicatefield__chg_field_importerdefault_target__ad.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0025_auto__add_unique_formatertype_formater_type_many_split_options.py (renamed from ishtar_common/migrations/0025_auto__add_unique_formatertype_formater_type_many_split_options.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0026_auto__add_targetkey__add_unique_targetkey_target_value__add_field_impo.py (renamed from ishtar_common/migrations/0026_auto__add_targetkey__add_unique_targetkey_target_value__add_field_impo.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0027_auto__chg_field_targetkey_target.py (renamed from ishtar_common/migrations/0027_auto__chg_field_targetkey_target.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0028_auto__chg_field_targetkey_key__chg_field_targetkey_value.py (renamed from ishtar_common/migrations/0028_auto__chg_field_targetkey_key__chg_field_targetkey_value.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0029_auto.py (renamed from ishtar_common/migrations/0029_auto.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py (renamed from ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0031_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py (renamed from ishtar_common/migrations/0031_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0033_auto__add_field_targetkey_associated_import__add_field_targetkey_assoc.py (renamed from ishtar_common/migrations/0033_auto__add_field_targetkey_associated_import__add_field_targetkey_assoc.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0034_auto__add_field_import_encoding.py (renamed from ishtar_common/migrations/0034_auto__add_field_import_encoding.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0035_auto__add_field_importtarget_force_new__add_field_importerduplicatefie.py (renamed from ishtar_common/migrations/0035_auto__add_field_importtarget_force_new__add_field_importerduplicatefie.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0036_auto__add_field_import_imported_images.py (renamed from ishtar_common/migrations/0036_auto__add_field_import_imported_images.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0037_auto__add_field_importertype_slug.py (renamed from ishtar_common/migrations/0037_auto__add_field_importertype_slug.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0038_auto__add_field_importtarget_comment.py (renamed from ishtar_common/migrations/0038_auto__add_field_importtarget_comment.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0039_auto__add_field_import_match_file.py (renamed from ishtar_common/migrations/0039_auto__add_field_import_match_file.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0040_auto__chg_field_person_title.py (renamed from ishtar_common/migrations/0040_auto__chg_field_person_title.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0041_auto__add_field_importertype_unicity_keys__add_field_importtarget_conc.py (renamed from ishtar_common/migrations/0041_auto__add_field_importertype_unicity_keys__add_field_importtarget_conc.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0042_auto__add_field_importtarget_concat_str__add_unique_importercolumn_col.py (renamed from ishtar_common/migrations/0042_auto__add_field_importtarget_concat_str__add_unique_importercolumn_col.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0043_auto__add_field_importerduplicatefield_concat__add_field_importerdupli.py (renamed from ishtar_common/migrations/0043_auto__add_field_importerduplicatefield_concat__add_field_importerdupli.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0044_auto__add_operationtype.py (renamed from ishtar_common/migrations/0044_auto__add_operationtype.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0045_auto__chg_field_person_merge_key__chg_field_historicalorganization_mer.py (renamed from ishtar_common/migrations/0045_auto__chg_field_person_merge_key__chg_field_historicalorganization_mer.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0046_auto__add_field_person_exclude_from_merge__add_field_historicalorganiz.py (renamed from ishtar_common/migrations/0046_auto__add_field_person_exclude_from_merge__add_field_historicalorganiz.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0047_auto__chg_field_person_exclude_from_merge__chg_field_historicalorganiz.py (renamed from ishtar_common/migrations/0047_auto__chg_field_person_exclude_from_merge__chg_field_historicalorganiz.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0048_auto__add_ishtarsiteprofile.py (renamed from ishtar_common/migrations/0048_auto__add_ishtarsiteprofile.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0049_auto__add_field_person_alt_address__add_field_person_alt_address_compl.py (renamed from ishtar_common/migrations/0049_auto__add_field_person_alt_address__add_field_person_alt_address_compl.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0050_auto__chg_field_person_phone_desc3__chg_field_person_phone_desc2__chg_.py (renamed from ishtar_common/migrations/0050_auto__chg_field_person_phone_desc3__chg_field_person_phone_desc2__chg_.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0051_auto__add_field_ishtarsiteprofile_homepage.py (renamed from ishtar_common/migrations/0051_auto__add_field_ishtarsiteprofile_homepage.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0052_auto__add_field_ishtarsiteprofile_file_external_id__add_field_ishtarsi.py (renamed from ishtar_common/migrations/0052_auto__add_field_ishtarsiteprofile_file_external_id__add_field_ishtarsi.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0053_auto__add_field_ishtarsiteprofile_currency.py (renamed from ishtar_common/migrations/0053_auto__add_field_ishtarsiteprofile_currency.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0054_auto__add_field_ishtarsiteprofile_person_raw_name.py (renamed from ishtar_common/migrations/0054_auto__add_field_ishtarsiteprofile_person_raw_name.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0055_auto.py (renamed from ishtar_common/migrations/0055_auto.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0056_auto__add_titletype__add_field_person_pretitle.py (renamed from ishtar_common/migrations/0056_auto__add_titletype__add_field_person_pretitle.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0057_rename_pretitle_old_title.py (renamed from ishtar_common/migrations/0057_rename_pretitle_old_title.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0058_generate_title.py (renamed from ishtar_common/migrations/0058_generate_title.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0059_rename_exc_from_merge_to_archived.py (renamed from ishtar_common/migrations/0059_rename_exc_from_merge_to_archived.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0060_auto__add_historicalperson.py (renamed from ishtar_common/migrations/0060_auto__add_historicalperson.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0061_auto__add_field_historicalperson_salutation__add_field_person_salutati.py (renamed from ishtar_common/migrations/0061_auto__add_field_historicalperson_salutation__add_field_person_salutati.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0062_remove_ishtar_local_prefix.py (renamed from ishtar_common/migrations/0062_remove_ishtar_local_prefix.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0063_auto__add_field_ishtaruser_advanced_shortcut_menu.py (renamed from ishtar_common/migrations/0063_auto__add_field_ishtaruser_advanced_shortcut_menu.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0064_auto__add_field_importercolumn_label.py (renamed from ishtar_common/migrations/0064_auto__add_field_importercolumn_label.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0065_auto__add_spatialreferencesystem__add_field_ishtarsiteprofile_mapping.py (renamed from ishtar_common/migrations/0065_auto__add_spatialreferencesystem__add_field_ishtarsiteprofile_mapping.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0066_auto__add_field_ishtarsiteprofile_base_color__add_field_ishtarsiteprof.py (renamed from ishtar_common/migrations/0066_auto__add_field_ishtarsiteprofile_base_color__add_field_ishtarsiteprof.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0067_auto__add_field_ishtarsiteprofile_container_external_id__add_field_ish.py (renamed from ishtar_common/migrations/0067_auto__add_field_ishtarsiteprofile_container_external_id__add_field_ish.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0068_auto__add_field_spatialreferencesystem_auth_name.py (renamed from ishtar_common/migrations/0068_auto__add_field_spatialreferencesystem_auth_name.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0069_auto__chg_field_import_error_file__chg_field_import_match_file__chg_fi.py (renamed from ishtar_common/migrations/0069_auto__chg_field_import_error_file__chg_field_import_match_file__chg_fi.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0070_auto__add_importermodel__add_field_importertype_new_associated_models.py (renamed from ishtar_common/migrations/0070_auto__add_importermodel__add_field_importertype_new_associated_models.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0071_migrate_importermodels.py (renamed from ishtar_common/migrations/0071_migrate_importermodels.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0072_auto__del_field_importertype_new_associated_models__chg_field_importer.py (renamed from ishtar_common/migrations/0072_auto__del_field_importertype_new_associated_models__chg_field_importer.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0073_auto__add_field_importercolumn_export_field_name.py (renamed from ishtar_common/migrations/0073_auto__add_field_importercolumn_export_field_name.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0074_auto__add_field_import_name.py (renamed from ishtar_common/migrations/0074_auto__add_field_import_name.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0075_auto__add_field_authortype_order.py (renamed from ishtar_common/migrations/0075_auto__add_field_authortype_order.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/0076_auto__add_field_ishtarsiteprofile_find_index.py (renamed from ishtar_common/migrations/0076_auto__add_field_ishtarsiteprofile_find_index.py) | 0 | ||||
| -rw-r--r-- | ishtar_common/old_migrations/__init__.py | 0 | ||||
| -rw-r--r-- | ishtar_common/templates/base.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/blocks/JQueryAdvancedTown.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/shortcut_menu.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_nav.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/dashboards/dashboard_main.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/import_delete.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/import_list.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/manage_basket.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/merge.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/merge_organization.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/merge_person.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/organization_form.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/organization_person_form.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/person_form.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/sheet_organization.html | 2 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/sheet_source.html | 4 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/default_wizard.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/wizard/validation_bar.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/registration/activation_complete.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templates/registration/login.html | 4 | ||||
| -rw-r--r-- | ishtar_common/templates/welcome.html | 1 | ||||
| -rw-r--r-- | ishtar_common/templatetags/link_to_window.py | 10 | ||||
| -rw-r--r-- | ishtar_common/templatetags/window_field.py | 6 | ||||
| -rw-r--r-- | ishtar_common/tests.py | 171 | ||||
| -rw-r--r-- | ishtar_common/tests/old.odt | bin | 0 -> 9048 bytes | |||
| -rw-r--r-- | ishtar_common/urls.py | 8 | ||||
| -rw-r--r-- | ishtar_common/utils.py | 19 | ||||
| -rw-r--r-- | ishtar_common/views.py | 127 | ||||
| -rw-r--r-- | ishtar_common/widgets.py | 2 | ||||
| -rw-r--r-- | ishtar_common/wizards.py | 73 | ||||
| -rw-r--r-- | old/__init__.py | 0 | ||||
| -rw-r--r-- | old/ooo_replace.py (renamed from ishtar_common/ooo_replace.py) | 45 | ||||
| -rw-r--r-- | old/ooo_translation.py (renamed from ishtar_common/ooo_translation.py) | 0 | ||||
| -rw-r--r-- | requirements.txt | 29 | ||||
| l--------- | simple_history | 1 | ||||
| -rw-r--r-- | version.py | 3 | 
467 files changed, 8897 insertions, 8989 deletions
diff --git a/.gitignore b/.gitignore index bfc61f6ac..a1984e0ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@  *.pyc  *.mo  *~ +.~*  django-simple-history/*  django-formwizard/*  ishtar-docs diff --git a/Makefile.example b/Makefile.example index 8f0e2e72c..f5a096392 100644 --- a/Makefile.example +++ b/Makefile.example @@ -8,6 +8,7 @@ project=example_project  # list used apps  apps="ishtar_common" "archaeological_operations" "archaeological_context_records" "archaeological_files" "archaeological_finds" "archaeological_warehouse" "archaeological_files_pdl"  default_data='fr' +version=`head -n 1 version.py | cut -d' ' -f2`  help:  	# Actions available: @@ -51,7 +52,6 @@ coverage: clean  			archaeological_files_pdl" ./manage.py test $(apps) && coverage report  build_gitlab: -	cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null  	cd $(project); $(PYTHON) ./manage.py migrate  test_gitlab: clean @@ -66,10 +66,6 @@ pylint:  	done  fresh_syncdb: -	cd $(project); $(PYTHON) ./manage.py syncdb --noinput 2> /dev/null > /dev/null -	cd $(project); $(PYTHON) ./manage.py migrate ishtar_common 2> /dev/null > /dev/null -	if [[ '$(apps)' == *archaeological_files* ]]; then cd $(project); $(PYTHON) ./manage.py migrate archaeological_files 2> /dev/null > /dev/null; fi -	$(PYTHON) ./manage.py migrate archaeological_operations 2> /dev/null > /dev/null  	cd $(project); $(PYTHON) ./manage.py migrate 2> /dev/null > /dev/null  	echo "* load default data"  	# data migrations have created some default data - return to a clean state @@ -103,7 +99,6 @@ fresh_syncdb:  	rm /tmp/site.json  syncdb: -	cd $(project); $(PYTHON) manage.py syncdb --noinput  	cd $(project); $(PYTHON) manage.py migrate  shell: @@ -128,18 +123,11 @@ compilemessages:  collectstatic:  	cd $(project);$(PYTHON) manage.py collectstatic --noinput -schemamigrations: +migrations:  	cd $(project);\  	for APP in $(apps); do \ -		echo "* schemamigration for "$$APP; \ -		$(PYTHON) manage.py schemamigration --auto $$APP; \ -	done - -schemamigrations_initial: -	cd $(project);\ -	for APP in $(apps); do \ -		echo "* schemamigration for "$$APP; \ -		$(PYTHON) manage.py schemamigration --initial $$APP; \ +		echo "* makemigrations for "$$APP; \ +		$(PYTHON) ./manage.py makemigrations $$APP; \  	done  generate_doc: @@ -269,3 +257,8 @@ distribute_main: sdist  deb: clean  	debuild -i -us -uc -b + +push_install: clean +	tar cvjf install-ishtar-$(version).tar.bz2 install/ +	scp install-ishtar-$(version).tar.bz2 root@git:/var/www/ishtar/install/ +	rm install-ishtar-$(version).tar.bz2 diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 000000000..516e5ad24 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,30 @@ +v1 to v2.0 +---------- + +Before upgrading to v2.0, update to the last v1 version. Then apply all  +databases migrations: + +``` +cd <application-path> +./manage.py migrate +``` + +Upgrade to ishtar sources and fake initial migrations. + +``` +cd <application-path> +./manage.py migrate --fake admin +./manage.py migrate --fake auth +./manage.py migrate --fake contenttypes +./manage.py migrate --fake registration +./manage.py migrate --fake sessions +./manage.py migrate --fake sites +./manage.py migrate --fake ishtar_common 0001_initial +./manage.py migrate --fake archaeological_operations 0003_views +./manage.py migrate --fake archaeological_files 0003_views +./manage.py migrate --fake archaeological_context_records 0004_views +./manage.py migrate --fake archaeological_finds 0003_views +./manage.py migrate --fake archaeological_warehouse 0002_auto_20170414_2123 +./manage.py migrate +``` + diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py index 77b42b609..0ecd5b28d 100644 --- a/archaeological_context_records/forms.py +++ b/archaeological_context_records/forms.py @@ -289,13 +289,6 @@ class RecordRelationsForm(OpeRecordRelationsForm):          crs = None          if 'data' in kwargs and 'CONTEXT_RECORDS' in kwargs['data']:              crs = kwargs['data']['CONTEXT_RECORDS'] -            # clean data if not "real" data -            prefix_value = kwargs['prefix'] + '-right_record' -            if not [k for k in kwargs['data'].keys() -                    if k.startswith(prefix_value) and kwargs['data'][k]]: -                kwargs['data'] = None -                if 'files' in kwargs: -                    kwargs.pop('files')          super(RecordRelationsForm, self).__init__(*args, **kwargs)          self.fields['relation_type'].choices = \              models.RelationType.get_types( diff --git a/archaeological_context_records/migrations/0001_initial.py b/archaeological_context_records/migrations/0001_initial.py index 599a6d4f7..743659f01 100644 --- a/archaeological_context_records/migrations/0001_initial.py +++ b/archaeological_context_records/migrations/0001_initial.py @@ -1,587 +1,318 @@  # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals +from django.db import models, migrations +import re +import django.contrib.gis.db.models.fields +import django.db.models.deletion +from django.conf import settings +import ishtar_common.models +import django.core.validators -class Migration(SchemaMigration): -    def forwards(self, orm): -        # Adding model 'DatingType' -        db.create_table('archaeological_context_records_datingtype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_context_records', ['DatingType']) +class Migration(migrations.Migration): -        # Adding model 'DatingQuality' -        db.create_table('archaeological_context_records_datingquality', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_context_records', ['DatingQuality']) +    dependencies = [ +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +    ] -        # Adding model 'Dating' -        db.create_table('archaeological_context_records_dating', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('period', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Period'])), -            ('start_date', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('dating_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.DatingType'], null=True, blank=True)), -            ('quality', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.DatingQuality'], null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_context_records', ['Dating']) - -        # Adding model 'Unit' -        db.create_table('archaeological_context_records_unit', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.Unit'], null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_context_records', ['Unit']) - -        # Adding model 'ActivityType' -        db.create_table('archaeological_context_records_activitytype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -        )) -        db.send_create_signal('archaeological_context_records', ['ActivityType']) - -        # Adding model 'IdentificationType' -        db.create_table('archaeological_context_records_identificationtype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -        )) -        db.send_create_signal('archaeological_context_records', ['IdentificationType']) - -        # Adding model 'HistoricalContextRecord' -        db.create_table('archaeological_context_records_historicalcontextrecord', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('parcel_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('operation_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('thickness', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('depth', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('location', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)), -            ('unit_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('has_furniture', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('filling', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('interpretation', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('taq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('taq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('tpq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('tpq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('identification_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('activity_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_context_records', ['HistoricalContextRecord']) - -        # Adding model 'ContextRecord' -        db.create_table('archaeological_context_records_contextrecord', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('parcel', self.gf('django.db.models.fields.related.ForeignKey')(related_name='context_record', to=orm['archaeological_operations.Parcel'])), -            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(related_name='context_record', to=orm['archaeological_operations.Operation'])), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('thickness', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('depth', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('location', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)), -            ('unit', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['archaeological_context_records.Unit'])), -            ('has_furniture', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('filling', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('interpretation', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('taq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('taq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('tpq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('tpq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('identification', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.IdentificationType'], null=True, blank=True)), -            ('activity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.ActivityType'], null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_context_records', ['ContextRecord']) - -        # Adding M2M table for field datings on 'ContextRecord' -        db.create_table('archaeological_context_records_contextrecord_datings', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('contextrecord', models.ForeignKey(orm['archaeological_context_records.contextrecord'], null=False)), -            ('dating', models.ForeignKey(orm['archaeological_context_records.dating'], null=False)) -        )) -        db.create_unique('archaeological_context_records_contextrecord_datings', ['contextrecord_id', 'dating_id']) - -        # Adding model 'ContextRecordSource' -        db.create_table('archaeological_context_records_contextrecordsource', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), -            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), -            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('context_record', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_context_records.ContextRecord'])), -        )) -        db.send_create_signal('archaeological_context_records', ['ContextRecordSource']) - -        # Adding M2M table for field authors on 'ContextRecordSource' -        db.create_table('archaeological_context_records_contextrecordsource_authors', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('contextrecordsource', models.ForeignKey(orm['archaeological_context_records.contextrecordsource'], null=False)), -            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) -        )) -        db.create_unique('archaeological_context_records_contextrecordsource_authors', ['contextrecordsource_id', 'author_id']) - - -    def backwards(self, orm): -        # Deleting model 'DatingType' -        db.delete_table('archaeological_context_records_datingtype') - -        # Deleting model 'DatingQuality' -        db.delete_table('archaeological_context_records_datingquality') - -        # Deleting model 'Dating' -        db.delete_table('archaeological_context_records_dating') - -        # Deleting model 'Unit' -        db.delete_table('archaeological_context_records_unit') - -        # Deleting model 'ActivityType' -        db.delete_table('archaeological_context_records_activitytype') - -        # Deleting model 'IdentificationType' -        db.delete_table('archaeological_context_records_identificationtype') - -        # Deleting model 'HistoricalContextRecord' -        db.delete_table('archaeological_context_records_historicalcontextrecord') - -        # Deleting model 'ContextRecord' -        db.delete_table('archaeological_context_records_contextrecord') - -        # Removing M2M table for field datings on 'ContextRecord' -        db.delete_table('archaeological_context_records_contextrecord_datings') - -        # Deleting model 'ContextRecordSource' -        db.delete_table('archaeological_context_records_contextrecordsource') - -        # Removing M2M table for field authors on 'ContextRecordSource' -        db.delete_table('archaeological_context_records_contextrecordsource_authors') - - -    models = { -        'archaeological_context_records.activitytype': { -            'Meta': {'object_name': 'ActivityType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.contextrecord': { -            'Meta': {'object_name': 'ContextRecord'}, -            'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}), -            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}), -            'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}), -            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Parcel']"}), -            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.contextrecordsource': { -            'Meta': {'object_name': 'ContextRecordSource'}, -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), -            'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'archaeological_context_records.dating': { -            'Meta': {'object_name': 'Dating'}, -            'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}), -            'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.datingquality': { -            'Meta': {'object_name': 'DatingQuality'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.datingtype': { -            'Meta': {'object_name': 'DatingType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.historicalcontextrecord': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalContextRecord'}, -            'activity_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'identification_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'parcel_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'unit_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.identificationtype': { -            'Meta': {'object_name': 'IdentificationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.unit': { -            'Meta': {'object_name': 'Unit'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.file': { -            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), -            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'object_name': 'Operation'}, -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operationtype': { -            'Meta': {'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'object_name': 'Parcel'}, -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.period': { -            'Meta': {'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.wizard': { -            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) -        }, -        'ishtar_common.wizardstep': { -            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) -        } -    } - -    complete_apps = ['archaeological_context_records']
\ No newline at end of file +    operations = [ +        migrations.CreateModel( +            name='RecordRelationView', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +            ], +            options={ +                'db_table': 'record_relations', +                'managed': False, +            }, +        ), +        migrations.CreateModel( +            name='ActivityType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(verbose_name='Order')), +            ], +            options={ +                'ordering': ('order',), +                'verbose_name': 'Activity Type', +                'verbose_name_plural': 'Activity Types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='ContextRecord', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('label', models.CharField(max_length=200, verbose_name='ID')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='General comment', blank=True)), +                ('opening_date', models.DateField(null=True, verbose_name="Date d'ouverture", blank=True)), +                ('closing_date', models.DateField(null=True, verbose_name='End date', blank=True)), +                ('length', models.FloatField(null=True, verbose_name='Length (m)', blank=True)), +                ('width', models.FloatField(null=True, verbose_name='Width (m)', blank=True)), +                ('thickness', models.FloatField(null=True, verbose_name='Thickness (m)', blank=True)), +                ('diameter', models.FloatField(null=True, verbose_name='Diameter (m)', blank=True)), +                ('depth', models.FloatField(null=True, verbose_name='Depth (m)', blank=True)), +                ('depth_of_appearance', models.FloatField(null=True, verbose_name='Depth of appearance (m)', blank=True)), +                ('location', models.TextField(help_text='A short description of the location of the context record', null=True, verbose_name='Location', blank=True)), +                ('datings_comment', models.TextField(null=True, verbose_name='Comment on datings', blank=True)), +                ('filling', models.TextField(null=True, verbose_name='Filling', blank=True)), +                ('interpretation', models.TextField(null=True, verbose_name='Interpretation', blank=True)), +                ('taq', models.IntegerField(help_text='"Terminus Ante Quem" the context record can\'t have been created after this date', null=True, verbose_name='TAQ', blank=True)), +                ('taq_estimated', models.IntegerField(help_text='Estimation of a "Terminus Ante Quem"', null=True, verbose_name='Estimated TAQ', blank=True)), +                ('tpq', models.IntegerField(help_text='"Terminus Post Quem" the context record can\'t have been created before this date', null=True, verbose_name='TPQ', blank=True)), +                ('tpq_estimated', models.IntegerField(help_text='Estimation of a "Terminus Post Quem"', null=True, verbose_name='Estimated TPQ', blank=True)), +                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, dim=3, null=True, verbose_name='Point', blank=True)), +                ('polygon', django.contrib.gis.db.models.fields.PolygonField(srid=4326, null=True, verbose_name='Polygon', blank=True)), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +            ], +            options={ +                'ordering': ('cached_label',), +                'verbose_name': 'Context Record', +                'verbose_name_plural': 'Context Record', +                'permissions': (('view_contextrecord', "Peut voir toutes les Unit\xe9s d'Enregistrement"), ('view_own_contextrecord', "Peut voir sa propre Unit\xe9 d'Enregistrement"), ('add_own_contextrecord', "Peut ajouter sa propre Unit\xe9 d'Enregistrement"), ('change_own_contextrecord', "Peut modifier sa propre Unit\xe9 d'Enregistrement"), ('delete_own_contextrecord', "Peut supprimer sa propre Unit\xe9 d'Enregistrement")), +            }, +            bases=(models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter, ishtar_common.models.ShortMenuItem), +        ), +        migrations.CreateModel( +            name='ContextRecordSource', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('title', models.CharField(max_length=300, verbose_name='Title')), +                ('external_id', models.TextField(max_length=300, null=True, verbose_name='External ID', blank=True)), +                ('scale', models.CharField(max_length=30, null=True, verbose_name='Scale', blank=True)), +                ('associated_url', models.URLField(null=True, verbose_name='Numerical ressource (web address)', blank=True)), +                ('receipt_date', models.DateField(null=True, verbose_name='Receipt date', blank=True)), +                ('creation_date', models.DateField(null=True, verbose_name='Creation date', blank=True)), +                ('receipt_date_in_documentation', models.DateField(null=True, verbose_name='Receipt date in documentation', blank=True)), +                ('item_number', models.IntegerField(default=1, verbose_name='Item number')), +                ('reference', models.CharField(max_length=100, null=True, verbose_name='Ref.', blank=True)), +                ('internal_reference', models.CharField(max_length=100, null=True, verbose_name='Internal ref.', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('additional_information', models.TextField(null=True, verbose_name='Additional information', blank=True)), +                ('duplicate', models.BooleanField(default=False, verbose_name='Has a duplicate')), +            ], +            options={ +                'verbose_name': 'Context record documentation', +                'verbose_name_plural': 'Context record documentations', +                'permissions': (('view_contextrecordsource', 'Can view all Context record sources'), ('view_own_contextrecordsource', 'Can view own Context record source'), ('add_own_contextrecordsource', 'Can add own Context record source'), ('change_own_contextrecordsource', 'Can change own Context record source'), ('delete_own_contextrecordsource', 'Can delete own Context record source')), +            }, +            bases=(ishtar_common.models.OwnPerms, models.Model), +        ), +        migrations.CreateModel( +            name='Dating', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('start_date', models.IntegerField(null=True, verbose_name='Start date', blank=True)), +                ('end_date', models.IntegerField(null=True, verbose_name='End date', blank=True)), +                ('precise_dating', models.TextField(null=True, verbose_name='Precise dating', blank=True)), +            ], +            options={ +                'verbose_name': 'Dating', +                'verbose_name_plural': 'Datings', +            }, +        ), +        migrations.CreateModel( +            name='DatingQuality', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Dating quality type', +                'verbose_name_plural': 'Dating quality types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='DatingType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Dating type', +                'verbose_name_plural': 'Dating types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='DocumentationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Documentation type', +                'verbose_name_plural': 'Documentation types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='ExcavationTechnicType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Excavation technique type', +                'verbose_name_plural': 'Excavation technique types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='HistoricalContextRecord', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('image', models.TextField(max_length=255, null=True, blank=True)), +                ('thumbnail', models.TextField(max_length=255, null=True, blank=True)), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('label', models.CharField(max_length=200, verbose_name='ID')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='General comment', blank=True)), +                ('opening_date', models.DateField(null=True, verbose_name="Date d'ouverture", blank=True)), +                ('closing_date', models.DateField(null=True, verbose_name='End date', blank=True)), +                ('length', models.FloatField(null=True, verbose_name='Length (m)', blank=True)), +                ('width', models.FloatField(null=True, verbose_name='Width (m)', blank=True)), +                ('thickness', models.FloatField(null=True, verbose_name='Thickness (m)', blank=True)), +                ('diameter', models.FloatField(null=True, verbose_name='Diameter (m)', blank=True)), +                ('depth', models.FloatField(null=True, verbose_name='Depth (m)', blank=True)), +                ('depth_of_appearance', models.FloatField(null=True, verbose_name='Depth of appearance (m)', blank=True)), +                ('location', models.TextField(help_text='A short description of the location of the context record', null=True, verbose_name='Location', blank=True)), +                ('datings_comment', models.TextField(null=True, verbose_name='Comment on datings', blank=True)), +                ('filling', models.TextField(null=True, verbose_name='Filling', blank=True)), +                ('interpretation', models.TextField(null=True, verbose_name='Interpretation', blank=True)), +                ('taq', models.IntegerField(help_text='"Terminus Ante Quem" the context record can\'t have been created after this date', null=True, verbose_name='TAQ', blank=True)), +                ('taq_estimated', models.IntegerField(help_text='Estimation of a "Terminus Ante Quem"', null=True, verbose_name='Estimated TAQ', blank=True)), +                ('tpq', models.IntegerField(help_text='"Terminus Post Quem" the context record can\'t have been created before this date', null=True, verbose_name='TPQ', blank=True)), +                ('tpq_estimated', models.IntegerField(help_text='Estimation of a "Terminus Post Quem"', null=True, verbose_name='Estimated TPQ', blank=True)), +                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, dim=3, null=True, verbose_name='Point', blank=True)), +                ('polygon', django.contrib.gis.db.models.fields.PolygonField(srid=4326, null=True, verbose_name='Polygon', blank=True)), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +                ('activity', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_context_records.ActivityType', null=True)), +                ('excavation_technic', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_context_records.ExcavationTechnicType', null=True)), +                ('history_creator', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('history_modifier', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('history_user', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Context Record', +            }, +        ), +        migrations.CreateModel( +            name='IdentificationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(verbose_name='Order')), +            ], +            options={ +                'ordering': ('order', 'label'), +                'verbose_name': 'Identification Type', +                'verbose_name_plural': 'Identification Types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='RecordRelations', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('left_record', models.ForeignKey(related_name='right_relations', to='archaeological_context_records.ContextRecord')), +            ], +            options={ +                'verbose_name': 'Record relation', +                'verbose_name_plural': 'Record relations', +            }, +            bases=(ishtar_common.models.GeneralRecordRelations, models.Model), +        ), +        migrations.CreateModel( +            name='RelationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +                ('symmetrical', models.BooleanField(verbose_name='Symmetrical')), +                ('tiny_label', models.CharField(max_length=50, null=True, verbose_name='Tiny label', blank=True)), +                ('inverse_relation', models.ForeignKey(verbose_name='Inverse relation', blank=True, to='archaeological_context_records.RelationType', null=True)), +            ], +            options={ +                'ordering': ('order', 'label'), +                'verbose_name': 'Relation type', +                'verbose_name_plural': 'Relation types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Unit', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(verbose_name='Order')), +                ('parent', models.ForeignKey(verbose_name='Parent context record type', blank=True, to='archaeological_context_records.Unit', null=True)), +            ], +            options={ +                'ordering': ('order', 'label'), +                'verbose_name': 'Context record Type', +                'verbose_name_plural': 'Context record Types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.AddField( +            model_name='recordrelations', +            name='relation_type', +            field=models.ForeignKey(to='archaeological_context_records.RelationType'), +        ), +        migrations.AddField( +            model_name='recordrelations', +            name='right_record', +            field=models.ForeignKey(related_name='left_relations', to='archaeological_context_records.ContextRecord'), +        ), +        migrations.AddField( +            model_name='historicalcontextrecord', +            name='identification', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_context_records.IdentificationType', null=True), +        ), +    ] diff --git a/archaeological_context_records/migrations/0002_auto_20170414_2123.py b/archaeological_context_records/migrations/0002_auto_20170414_2123.py new file mode 100644 index 000000000..ba54b3e65 --- /dev/null +++ b/archaeological_context_records/migrations/0002_auto_20170414_2123.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_operations', '0001_initial'), +        ('archaeological_context_records', '0001_initial'), +    ] + +    operations = [ +        migrations.AddField( +            model_name='historicalcontextrecord', +            name='operation', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_operations.Operation', null=True), +        ), +        migrations.AddField( +            model_name='historicalcontextrecord', +            name='parcel', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_operations.Parcel', null=True), +        ), +        migrations.AddField( +            model_name='historicalcontextrecord', +            name='unit', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_context_records.Unit', null=True), +        ), +        migrations.AddField( +            model_name='dating', +            name='dating_type', +            field=models.ForeignKey(verbose_name='Dating type', blank=True, to='archaeological_context_records.DatingType', null=True), +        ), +        migrations.AddField( +            model_name='dating', +            name='period', +            field=models.ForeignKey(verbose_name='Period', to='archaeological_operations.Period'), +        ), +        migrations.AddField( +            model_name='dating', +            name='quality', +            field=models.ForeignKey(verbose_name='Quality', blank=True, to='archaeological_context_records.DatingQuality', null=True), +        ), +    ] diff --git a/archaeological_context_records/migrations/0003_auto_20170414_2123.py b/archaeological_context_records/migrations/0003_auto_20170414_2123.py new file mode 100644 index 000000000..9595b8997 --- /dev/null +++ b/archaeological_context_records/migrations/0003_auto_20170414_2123.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_operations', '0001_initial'), +        ('archaeological_context_records', '0002_auto_20170414_2123'), +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +        ('ishtar_common', '0001_initial'), +    ] + +    operations = [ +        migrations.AddField( +            model_name='contextrecordsource', +            name='authors', +            field=models.ManyToManyField(related_name='contextrecordsource_related', verbose_name='Authors', to='ishtar_common.Author'), +        ), +        migrations.AddField( +            model_name='contextrecordsource', +            name='context_record', +            field=models.ForeignKey(related_name='source', verbose_name='Context record', to='archaeological_context_records.ContextRecord'), +        ), +        migrations.AddField( +            model_name='contextrecordsource', +            name='format_type', +            field=models.ForeignKey(verbose_name='Format', blank=True, to='ishtar_common.Format', null=True), +        ), +        migrations.AddField( +            model_name='contextrecordsource', +            name='source_type', +            field=models.ForeignKey(verbose_name='Type', to='ishtar_common.SourceType'), +        ), +        migrations.AddField( +            model_name='contextrecordsource', +            name='support_type', +            field=models.ForeignKey(verbose_name='Support', blank=True, to='ishtar_common.SupportType', null=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='activity', +            field=models.ForeignKey(verbose_name='Activity', blank=True, to='archaeological_context_records.ActivityType', null=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='datings', +            field=models.ManyToManyField(to='archaeological_context_records.Dating'), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='documentations', +            field=models.ManyToManyField(to='archaeological_context_records.DocumentationType', blank=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='excavation_technic', +            field=models.ForeignKey(verbose_name='Excavation technique', blank=True, to='archaeological_context_records.ExcavationTechnicType', null=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='identification', +            field=models.ForeignKey(verbose_name='Identification', blank=True, to='archaeological_context_records.IdentificationType', null=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_context_records_contextrecord', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='operation', +            field=models.ForeignKey(related_name='context_record', verbose_name='Operation', to='archaeological_operations.Operation'), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='parcel', +            field=models.ForeignKey(related_name='context_record', verbose_name='Parcel', to='archaeological_operations.Parcel'), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='related_context_records', +            field=models.ManyToManyField(to='archaeological_context_records.ContextRecord', through='archaeological_context_records.RecordRelations', blank=True), +        ), +        migrations.AddField( +            model_name='contextrecord', +            name='unit', +            field=models.ForeignKey(related_name='+', verbose_name='Context record type', blank=True, to='archaeological_context_records.Unit', null=True), +        ), +    ] diff --git a/archaeological_context_records/migrations/0004_views.py b/archaeological_context_records/migrations/0004_views.py new file mode 100644 index 000000000..77116ef85 --- /dev/null +++ b/archaeological_context_records/migrations/0004_views.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations +from archaeological_context_records.models import RecordRelationView, CRBulkView + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_context_records', '0003_auto_20170414_2123'), +    ] + +    operations = [ +        migrations.RunSQL(RecordRelationView.CREATE_SQL + +                          CRBulkView.CREATE_SQL), +    ] diff --git a/archaeological_context_records/migrations/0034_auto__chg_field_contextrecordsource_external_id.py b/archaeological_context_records/migrations/0034_auto__chg_field_contextrecordsource_external_id.py deleted file mode 100644 index 1c8348bbd..000000000 --- a/archaeological_context_records/migrations/0034_auto__chg_field_contextrecordsource_external_id.py +++ /dev/null @@ -1,681 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): - -        # Changing field 'ContextRecordSource.external_id' -        db.alter_column('archaeological_context_records_contextrecordsource', 'external_id', self.gf('django.db.models.fields.TextField')(max_length=300, null=True)) - -    def backwards(self, orm): - -        # Changing field 'ContextRecordSource.external_id' -        db.alter_column('archaeological_context_records_contextrecordsource', 'external_id', self.gf('django.db.models.fields.CharField')(max_length=12, null=True)) - -    models = { -        'archaeological_context_records.activitytype': { -            'Meta': {'ordering': "('order',)", 'object_name': 'ActivityType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.contextrecord': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'ContextRecord'}, -            'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'closing_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}), -            'datings_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'depth': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'depth_of_appearance': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'diameter': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'documentations': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_context_records.DocumentationType']", 'null': 'True', 'blank': 'True'}), -            'excavation_technic': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ExcavationTechnicType']", 'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_context_records_contextrecord'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'length': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'opening_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Parcel']"}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'dim': '3', 'null': 'True', 'blank': 'True'}), -            'polygon': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True', 'blank': 'True'}), -            'related_context_records': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_context_records.ContextRecord']", 'null': 'True', 'through': "orm['archaeological_context_records.RecordRelations']", 'blank': 'True'}), -            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}), -            'width': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.contextrecordsource': { -            'Meta': {'object_name': 'ContextRecordSource'}, -            'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'contextrecordsource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}) -        }, -        'archaeological_context_records.dating': { -            'Meta': {'object_name': 'Dating'}, -            'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}), -            'precise_dating': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.datingquality': { -            'Meta': {'ordering': "('label',)", 'object_name': 'DatingQuality'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.datingtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'DatingType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.documentationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'DocumentationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.excavationtechnictype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ExcavationTechnicType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.historicalcontextrecord': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalContextRecord'}, -            'activity_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'closing_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'datings_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'depth': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'depth_of_appearance': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'diameter': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_technic_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'identification_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'length': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'opening_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'parcel_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'dim': '3', 'null': 'True', 'blank': 'True'}), -            'polygon': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True', 'blank': 'True'}), -            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'unit_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.identificationtype': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'IdentificationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.recordrelations': { -            'Meta': {'object_name': 'RecordRelations'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'left_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'right_relations'", 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'relation_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.RelationType']"}), -            'right_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'left_relations'", 'to': "orm['archaeological_context_records.ContextRecord']"}) -        }, -        'archaeological_context_records.recordrelationview': { -            'Meta': {'unique_together': "(('id', 'right_record'),)", 'object_name': 'RecordRelationView', 'db_table': "'record_relations'", 'managed': 'False'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'left_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'on_delete': 'models.DO_NOTHING', 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'relation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'on_delete': 'models.DO_NOTHING', 'to': "orm['archaeological_context_records.RelationType']"}), -            'right_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'on_delete': 'models.DO_NOTHING', 'to': "orm['archaeological_context_records.ContextRecord']"}) -        }, -        'archaeological_context_records.relationtype': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'RelationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'inverse_relation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.RelationType']", 'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'symmetrical': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'tiny_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.unit': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'Unit'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.file': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cira_advised': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'classified_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'corporation_general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'departments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_line': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_files_file'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'instruction_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'locality': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'main_town': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_main'", 'null': 'True', 'to': "orm['ishtar_common.Town']"}), -            'mh_listing': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'mh_register': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'permit_reference': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'protected_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'raw_general_contractor': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'raw_town_planning_service': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.OperationType']"}), -            'research_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'responsible_town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'responsible_town_planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'total_developed_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {'default': '30'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.archaeologicalsite': { -            'Meta': {'object_name': 'ArchaeologicalSite'}, -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_archaeologicalsite'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'Operation'}, -            'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.ArchaeologicalSite']", 'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'cira_rapporteur': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cira_rapporteur'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'code_patriarche': ('django.db.models.fields.TextField', [], {'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'collaborators': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'operation_collaborator'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Person']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_operation'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), -            'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.OperationType']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}), -            'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'report_processing': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ReportState']", 'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_scientist_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operations'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'ordering': "('year', 'section', 'parcel_number')", 'object_name': 'Parcel'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcel'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), -            'public_domain': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.period': { -            'Meta': {'ordering': "('order',)", 'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.reportstate': { -            'Meta': {'ordering': "('order',)", 'object_name': 'ReportState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'ordering': "('author_type__order', 'person__name')", 'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'ordering': "['order', 'label']", 'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}), -            'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.format': { -            'Meta': {'ordering': "['label']", 'object_name': 'Format'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.import': { -            'Meta': {'object_name': 'Import'}, -            'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), -            'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), -            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '220'}), -            'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '220', 'null': 'True', 'blank': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), -            'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), -            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) -        }, -        'ishtar_common.importermodel': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterModel'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'klass': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'ishtar_common.importertype': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterType'}, -            'associated_models': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.ImporterModel']"}), -            'created_models': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.ImporterModel']"}), -            'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.ishtaruser': { -            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, -            'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), -            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) -        }, -        'ishtar_common.operationtype': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'ordering': "['label']", 'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.state': { -            'Meta': {'ordering': "['number']", 'object_name': 'State'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.supporttype': { -            'Meta': {'object_name': 'SupportType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.titletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_town'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        } -    } - -    complete_apps = ['archaeological_context_records']
\ No newline at end of file diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 940330d86..483d77883 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -17,6 +17,8 @@  # See the file COPYING for details. +import time +  from django.conf import settings  from django.contrib.gis.db import models  from django.core.urlresolvers import reverse @@ -30,7 +32,7 @@ from ishtar_common.utils import cached_label_changed  from ishtar_common.models import GeneralType, BaseHistorizedItem, \      HistoricalRecords, OwnPerms, ShortMenuItem, Source, GeneralRelationType,\      GeneralRecordRelations, post_delete_record_relation, get_external_id, \ -    ImageModel, post_save_cache, ValueGetter +    ImageModel, post_save_cache, ValueGetter, BulkUpdatedItem  from archaeological_operations.models import Operation, Period, Parcel @@ -158,7 +160,7 @@ class CRBulkView(object):      """ -class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, +class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, ImageModel, OwnPerms,                      ValueGetter, ShortMenuItem):      SHOW_URL = 'show-contextrecord'      SLUG = 'contextrecord' @@ -235,8 +237,7 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,          help_text=_(u"A short description of the location of the context "                      u"record"))      datings = models.ManyToManyField(Dating) -    documentations = models.ManyToManyField(DocumentationType, blank=True, -                                            null=True) +    documentations = models.ManyToManyField(DocumentationType, blank=True)      datings_comment = models.TextField(_(u"Comment on datings"), blank=True,                                         null=True)      unit = models.ForeignKey(Unit, verbose_name=_(u"Context record type"), @@ -267,7 +268,7 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,          ExcavationTechnicType, blank=True, null=True,          verbose_name=_(u"Excavation technique"))      related_context_records = models.ManyToManyField( -        'ContextRecord', through='RecordRelations', blank=True, null=True) +        'ContextRecord', through='RecordRelations', blank=True)      point = models.PointField(_(u"Point"), blank=True, null=True, dim=3)      polygon = models.PolygonField(_(u"Polygon"), blank=True, null=True)      cached_label = models.TextField(_(u"Cached name"), null=True, blank=True) @@ -277,15 +278,11 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,          verbose_name = _(u"Context Record")          verbose_name_plural = _(u"Context Record")          permissions = ( -            ("view_contextrecord", ugettext(u"Can view all Context Records")), -            ("view_own_contextrecord", -             ugettext(u"Can view own Context Record")), -            ("add_own_contextrecord", -             ugettext(u"Can add own Context Record")), -            ("change_own_contextrecord", -             ugettext(u"Can change own Context Record")), -            ("delete_own_contextrecord", -             ugettext(u"Can delete own Context Record")), +            ("view_contextrecord", u"Can view all Context Records"), +            ("view_own_contextrecord", u"Can view own Context Record"), +            ("add_own_contextrecord", u"Can add own Context Record"), +            ("change_own_contextrecord", u"Can change own Context Record"), +            ("delete_own_contextrecord", u"Can delete own Context Record"),          )          ordering = ('cached_label',) @@ -301,7 +298,13 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,          return self.short_label      @classmethod -    def cached_label_bulk_update(cls, operation_id=None, parcel_id=None): +    def cached_label_bulk_update(cls, operation_id=None, parcel_id=None, +                                 transaction_id=None): +        transaction_id, is_recursion = cls.bulk_recursion( +            transaction_id, [operation_id, parcel_id]) +        if is_recursion: +            return +          if operation_id:              where = "operation_id = %s"              args = [int(operation_id)] @@ -312,6 +315,8 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,              kwargs = {'parcel_id': parcel_id}          else:              return +        kwargs['transaction_id'] = transaction_id +          sql = """          UPDATE "archaeological_context_records_contextrecord" AS cr              SET cached_label = @@ -348,12 +353,10 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,          """.format(main_ope_prefix=settings.ISHTAR_OPE_PREFIX,                     ope_prefix=settings.ISHTAR_DEF_OPE_PREFIX,                     join=settings.JOINT, where=where) -        # with connection.cursor() as c:  # django 1.8 -        c = connection.cursor() -        c.execute(sql, args) -        transaction.commit_unless_managed() +        with connection.cursor() as c: +            c.execute(sql, args)          cls._meta.get_field_by_name( -            'base_finds')[0].model.cached_label_bulk_update(**kwargs) +            'base_finds')[0].related_model.cached_label_bulk_update(**kwargs)      @property      def short_label(self): @@ -365,11 +368,11 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,          return reverse('show-contextrecord', args=[self.pk, ''])      @classmethod -    def get_query_owns(cls, user): -        return (Q(operation__scientist=user.ishtaruser.person) | -                Q(operation__in_charge=user.ishtaruser.person) | -                Q(operation__collaborators__pk=user.ishtaruser.person.pk) | -                Q(history_creator=user)) \ +    def get_query_owns(cls, ishtaruser): +        return (Q(operation__scientist=ishtaruser.person) | +                Q(operation__in_charge=ishtaruser.person) | +                Q(operation__collaborators__pk=ishtaruser.person.pk) | +                Q(history_creator=ishtaruser.user_ptr)) \              & Q(operation__end_date__isnull=True)      @classmethod @@ -547,7 +550,7 @@ post_delete.connect(post_delete_record_relation, sender=RecordRelations)  class RecordRelationView(models.Model): -    """ +    CREATE_SQL = """      CREATE VIEW record_relations AS          SELECT DISTINCT right_record_id as id,              right_record_id, @@ -559,6 +562,9 @@ class RecordRelationView(models.Model):      CREATE RULE record_relations_del AS ON DELETE TO record_relations          DO INSTEAD DELETE FROM record_relations where id=NULL;      """ +    DELETE_SQL = """ +        DROP VIEW record_relations; +    """      TABLE_COLS = [          "relation_type",          "right_record__label", "right_record__unit", "right_record__parcel", @@ -628,15 +634,15 @@ class ContextRecordSource(Source):          verbose_name_plural = _(u"Context record documentations")          permissions = (              ("view_contextrecordsource", -             ugettext(u"Can view all Context record sources")), +             u"Can view all Context record sources"),              ("view_own_contextrecordsource", -             ugettext(u"Can view own Context record source")), +              u"Can view own Context record source"),              ("add_own_contextrecordsource", -             ugettext(u"Can add own Context record source")), +             u"Can add own Context record source"),              ("change_own_contextrecordsource", -             ugettext(u"Can change own Context record source")), +             u"Can change own Context record source"),              ("delete_own_contextrecordsource", -             ugettext(u"Can delete own Context record source")), +             u"Can delete own Context record source"),          )      context_record = models.ForeignKey(          ContextRecord, verbose_name=_(u"Context record"), diff --git a/archaeological_context_records/old_migrations/0001_initial.py b/archaeological_context_records/old_migrations/0001_initial.py new file mode 100644 index 000000000..599a6d4f7 --- /dev/null +++ b/archaeological_context_records/old_migrations/0001_initial.py @@ -0,0 +1,587 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + +    def forwards(self, orm): +        # Adding model 'DatingType' +        db.create_table('archaeological_context_records_datingtype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_context_records', ['DatingType']) + +        # Adding model 'DatingQuality' +        db.create_table('archaeological_context_records_datingquality', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_context_records', ['DatingQuality']) + +        # Adding model 'Dating' +        db.create_table('archaeological_context_records_dating', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('period', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Period'])), +            ('start_date', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('dating_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.DatingType'], null=True, blank=True)), +            ('quality', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.DatingQuality'], null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_context_records', ['Dating']) + +        # Adding model 'Unit' +        db.create_table('archaeological_context_records_unit', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.Unit'], null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_context_records', ['Unit']) + +        # Adding model 'ActivityType' +        db.create_table('archaeological_context_records_activitytype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +        )) +        db.send_create_signal('archaeological_context_records', ['ActivityType']) + +        # Adding model 'IdentificationType' +        db.create_table('archaeological_context_records_identificationtype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +        )) +        db.send_create_signal('archaeological_context_records', ['IdentificationType']) + +        # Adding model 'HistoricalContextRecord' +        db.create_table('archaeological_context_records_historicalcontextrecord', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('parcel_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('operation_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('thickness', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('depth', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('location', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)), +            ('unit_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('has_furniture', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('filling', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('interpretation', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('taq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('taq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('tpq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('tpq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('identification_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('activity_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_context_records', ['HistoricalContextRecord']) + +        # Adding model 'ContextRecord' +        db.create_table('archaeological_context_records_contextrecord', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('parcel', self.gf('django.db.models.fields.related.ForeignKey')(related_name='context_record', to=orm['archaeological_operations.Parcel'])), +            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(related_name='context_record', to=orm['archaeological_operations.Operation'])), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('thickness', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('depth', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('location', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)), +            ('unit', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['archaeological_context_records.Unit'])), +            ('has_furniture', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('filling', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('interpretation', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('taq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('taq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('tpq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('tpq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('identification', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.IdentificationType'], null=True, blank=True)), +            ('activity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.ActivityType'], null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_context_records', ['ContextRecord']) + +        # Adding M2M table for field datings on 'ContextRecord' +        db.create_table('archaeological_context_records_contextrecord_datings', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('contextrecord', models.ForeignKey(orm['archaeological_context_records.contextrecord'], null=False)), +            ('dating', models.ForeignKey(orm['archaeological_context_records.dating'], null=False)) +        )) +        db.create_unique('archaeological_context_records_contextrecord_datings', ['contextrecord_id', 'dating_id']) + +        # Adding model 'ContextRecordSource' +        db.create_table('archaeological_context_records_contextrecordsource', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), +            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), +            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('context_record', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_context_records.ContextRecord'])), +        )) +        db.send_create_signal('archaeological_context_records', ['ContextRecordSource']) + +        # Adding M2M table for field authors on 'ContextRecordSource' +        db.create_table('archaeological_context_records_contextrecordsource_authors', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('contextrecordsource', models.ForeignKey(orm['archaeological_context_records.contextrecordsource'], null=False)), +            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) +        )) +        db.create_unique('archaeological_context_records_contextrecordsource_authors', ['contextrecordsource_id', 'author_id']) + + +    def backwards(self, orm): +        # Deleting model 'DatingType' +        db.delete_table('archaeological_context_records_datingtype') + +        # Deleting model 'DatingQuality' +        db.delete_table('archaeological_context_records_datingquality') + +        # Deleting model 'Dating' +        db.delete_table('archaeological_context_records_dating') + +        # Deleting model 'Unit' +        db.delete_table('archaeological_context_records_unit') + +        # Deleting model 'ActivityType' +        db.delete_table('archaeological_context_records_activitytype') + +        # Deleting model 'IdentificationType' +        db.delete_table('archaeological_context_records_identificationtype') + +        # Deleting model 'HistoricalContextRecord' +        db.delete_table('archaeological_context_records_historicalcontextrecord') + +        # Deleting model 'ContextRecord' +        db.delete_table('archaeological_context_records_contextrecord') + +        # Removing M2M table for field datings on 'ContextRecord' +        db.delete_table('archaeological_context_records_contextrecord_datings') + +        # Deleting model 'ContextRecordSource' +        db.delete_table('archaeological_context_records_contextrecordsource') + +        # Removing M2M table for field authors on 'ContextRecordSource' +        db.delete_table('archaeological_context_records_contextrecordsource_authors') + + +    models = { +        'archaeological_context_records.activitytype': { +            'Meta': {'object_name': 'ActivityType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.contextrecord': { +            'Meta': {'object_name': 'ContextRecord'}, +            'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}), +            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}), +            'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}), +            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}), +            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Parcel']"}), +            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}), +            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_context_records.contextrecordsource': { +            'Meta': {'object_name': 'ContextRecordSource'}, +            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), +            'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_context_records.ContextRecord']"}), +            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) +        }, +        'archaeological_context_records.dating': { +            'Meta': {'object_name': 'Dating'}, +            'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}), +            'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_context_records.datingquality': { +            'Meta': {'object_name': 'DatingQuality'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.datingtype': { +            'Meta': {'object_name': 'DatingType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.historicalcontextrecord': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalContextRecord'}, +            'activity_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'identification_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'parcel_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'unit_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_context_records.identificationtype': { +            'Meta': {'object_name': 'IdentificationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.unit': { +            'Meta': {'object_name': 'Unit'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.file': { +            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), +            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), +            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), +            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), +            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), +            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), +            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), +            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) +        }, +        'archaeological_files.filetype': { +            'Meta': {'object_name': 'FileType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.permittype': { +            'Meta': {'object_name': 'PermitType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.saisinetype': { +            'Meta': {'object_name': 'SaisineType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'delay': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.operation': { +            'Meta': {'object_name': 'Operation'}, +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), +            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), +            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'operation_code': ('django.db.models.fields.IntegerField', [], {}), +            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}), +            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), +            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}), +            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}), +            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}), +            'year': ('django.db.models.fields.IntegerField', [], {}), +            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.operationtype': { +            'Meta': {'object_name': 'OperationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.parcel': { +            'Meta': {'object_name': 'Parcel'}, +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), +            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}), +            'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}), +            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.period': { +            'Meta': {'object_name': 'Period'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.remaintype': { +            'Meta': {'object_name': 'RemainType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'auth.group': { +            'Meta': {'object_name': 'Group'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), +            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) +        }, +        'auth.permission': { +            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, +            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) +        }, +        'auth.user': { +            'Meta': {'object_name': 'User'}, +            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), +            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), +            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), +            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'contenttypes.contenttype': { +            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, +            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) +        }, +        'ishtar_common.arrondissement': { +            'Meta': {'object_name': 'Arrondissement'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.author': { +            'Meta': {'object_name': 'Author'}, +            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) +        }, +        'ishtar_common.authortype': { +            'Meta': {'object_name': 'AuthorType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.canton': { +            'Meta': {'object_name': 'Canton'}, +            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.department': { +            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) +        }, +        'ishtar_common.organization': { +            'Meta': {'object_name': 'Organization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.organizationtype': { +            'Meta': {'object_name': 'OrganizationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.person': { +            'Meta': {'object_name': 'Person'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.persontype': { +            'Meta': {'object_name': 'PersonType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.sourcetype': { +            'Meta': {'object_name': 'SourceType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.town': { +            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, +            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), +            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), +            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.wizard': { +            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) +        }, +        'ishtar_common.wizardstep': { +            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) +        } +    } + +    complete_apps = ['archaeological_context_records']
\ No newline at end of file diff --git a/archaeological_context_records/migrations/0002_auto__add_field_contextrecordsource_reference__add_field_contextrecord.py b/archaeological_context_records/old_migrations/0002_auto__add_field_contextrecordsource_reference__add_field_contextrecord.py index 07be02460..07be02460 100644 --- a/archaeological_context_records/migrations/0002_auto__add_field_contextrecordsource_reference__add_field_contextrecord.py +++ b/archaeological_context_records/old_migrations/0002_auto__add_field_contextrecordsource_reference__add_field_contextrecord.py diff --git a/archaeological_context_records/migrations/0003_auto__add_field_contextrecord_history_creator__add_field_historicalcon.py b/archaeological_context_records/old_migrations/0003_auto__add_field_contextrecord_history_creator__add_field_historicalcon.py index e00de4865..e00de4865 100644 --- a/archaeological_context_records/migrations/0003_auto__add_field_contextrecord_history_creator__add_field_historicalcon.py +++ b/archaeological_context_records/old_migrations/0003_auto__add_field_contextrecord_history_creator__add_field_historicalcon.py diff --git a/archaeological_context_records/migrations/0004_init_history_creator.py b/archaeological_context_records/old_migrations/0004_init_history_creator.py index b231214a4..b231214a4 100644 --- a/archaeological_context_records/migrations/0004_init_history_creator.py +++ b/archaeological_context_records/old_migrations/0004_init_history_creator.py diff --git a/archaeological_context_records/migrations/0005_reinit_history_creator.py b/archaeological_context_records/old_migrations/0005_reinit_history_creator.py index 7e4f62200..7e4f62200 100644 --- a/archaeological_context_records/migrations/0005_reinit_history_creator.py +++ b/archaeological_context_records/old_migrations/0005_reinit_history_creator.py diff --git a/archaeological_context_records/migrations/0006_auto__chg_field_contextrecord_history_creator__chg_field_contextrecord.py b/archaeological_context_records/old_migrations/0006_auto__chg_field_contextrecord_history_creator__chg_field_contextrecord.py index 0d9a3b5da..0d9a3b5da 100644 --- a/archaeological_context_records/migrations/0006_auto__chg_field_contextrecord_history_creator__chg_field_contextrecord.py +++ b/archaeological_context_records/old_migrations/0006_auto__chg_field_contextrecord_history_creator__chg_field_contextrecord.py diff --git a/archaeological_context_records/migrations/0007_auto__add_relationtype__add_recordrelations.py b/archaeological_context_records/old_migrations/0007_auto__add_relationtype__add_recordrelations.py index c9c7d2842..c9c7d2842 100644 --- a/archaeological_context_records/migrations/0007_auto__add_relationtype__add_recordrelations.py +++ b/archaeological_context_records/old_migrations/0007_auto__add_relationtype__add_recordrelations.py diff --git a/archaeological_context_records/migrations/0008_auto__add_field_contextrecord_external_id__add_field_contextrecord_com.py b/archaeological_context_records/old_migrations/0008_auto__add_field_contextrecord_external_id__add_field_contextrecord_com.py index 133406cf1..133406cf1 100644 --- a/archaeological_context_records/migrations/0008_auto__add_field_contextrecord_external_id__add_field_contextrecord_com.py +++ b/archaeological_context_records/old_migrations/0008_auto__add_field_contextrecord_external_id__add_field_contextrecord_com.py diff --git a/archaeological_context_records/migrations/0009_auto__add_field_contextrecordsource_external_id.py b/archaeological_context_records/old_migrations/0009_auto__add_field_contextrecordsource_external_id.py index cc0b83c99..cc0b83c99 100644 --- a/archaeological_context_records/migrations/0009_auto__add_field_contextrecordsource_external_id.py +++ b/archaeological_context_records/old_migrations/0009_auto__add_field_contextrecordsource_external_id.py diff --git a/archaeological_context_records/migrations/0010_auto.py b/archaeological_context_records/old_migrations/0010_auto.py index f04e73c4c..f04e73c4c 100644 --- a/archaeological_context_records/migrations/0010_auto.py +++ b/archaeological_context_records/old_migrations/0010_auto.py diff --git a/archaeological_context_records/migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py b/archaeological_context_records/old_migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py index dec4559be..dec4559be 100644 --- a/archaeological_context_records/migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py +++ b/archaeological_context_records/old_migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py diff --git a/archaeological_context_records/migrations/0012_auto__add_field_dating_precise_dating.py b/archaeological_context_records/old_migrations/0012_auto__add_field_dating_precise_dating.py index 3bd640ea3..3bd640ea3 100644 --- a/archaeological_context_records/migrations/0012_auto__add_field_dating_precise_dating.py +++ b/archaeological_context_records/old_migrations/0012_auto__add_field_dating_precise_dating.py diff --git a/archaeological_context_records/migrations/0013_auto__add_field_contextrecordsource_duplicate__chg_field_contextrecord.py b/archaeological_context_records/old_migrations/0013_auto__add_field_contextrecordsource_duplicate__chg_field_contextrecord.py index 2bed4037f..2bed4037f 100644 --- a/archaeological_context_records/migrations/0013_auto__add_field_contextrecordsource_duplicate__chg_field_contextrecord.py +++ b/archaeological_context_records/old_migrations/0013_auto__add_field_contextrecordsource_duplicate__chg_field_contextrecord.py diff --git a/archaeological_context_records/migrations/0014_auto__add_field_contextrecordsource_receipt_date_in_documentation.py b/archaeological_context_records/old_migrations/0014_auto__add_field_contextrecordsource_receipt_date_in_documentation.py index 61649e977..61649e977 100644 --- a/archaeological_context_records/migrations/0014_auto__add_field_contextrecordsource_receipt_date_in_documentation.py +++ b/archaeological_context_records/old_migrations/0014_auto__add_field_contextrecordsource_receipt_date_in_documentation.py diff --git a/archaeological_context_records/migrations/0015_auto__add_field_contextrecord_point__add_field_contextrecord_polygon__.py b/archaeological_context_records/old_migrations/0015_auto__add_field_contextrecord_point__add_field_contextrecord_polygon__.py index ba49c8e49..ba49c8e49 100644 --- a/archaeological_context_records/migrations/0015_auto__add_field_contextrecord_point__add_field_contextrecord_polygon__.py +++ b/archaeological_context_records/old_migrations/0015_auto__add_field_contextrecord_point__add_field_contextrecord_polygon__.py diff --git a/archaeological_context_records/migrations/0016_auto__add_field_relationtype_short_label.py b/archaeological_context_records/old_migrations/0016_auto__add_field_relationtype_short_label.py index 022de2e93..022de2e93 100644 --- a/archaeological_context_records/migrations/0016_auto__add_field_relationtype_short_label.py +++ b/archaeological_context_records/old_migrations/0016_auto__add_field_relationtype_short_label.py diff --git a/archaeological_context_records/migrations/0017_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py b/archaeological_context_records/old_migrations/0017_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py index fb49cce27..fb49cce27 100644 --- a/archaeological_context_records/migrations/0017_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py +++ b/archaeological_context_records/old_migrations/0017_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py diff --git a/archaeological_context_records/migrations/0018_auto__chg_field_contextrecord_external_id__chg_field_historicalcontext.py b/archaeological_context_records/old_migrations/0018_auto__chg_field_contextrecord_external_id__chg_field_historicalcontext.py index 0a5d3c569..0a5d3c569 100644 --- a/archaeological_context_records/migrations/0018_auto__chg_field_contextrecord_external_id__chg_field_historicalcontext.py +++ b/archaeological_context_records/old_migrations/0018_auto__chg_field_contextrecord_external_id__chg_field_historicalcontext.py diff --git a/archaeological_context_records/migrations/0019_auto__add_field_contextrecord_auto_external_id__add_field_historicalco.py b/archaeological_context_records/old_migrations/0019_auto__add_field_contextrecord_auto_external_id__add_field_historicalco.py index 8a0d056e3..8a0d056e3 100644 --- a/archaeological_context_records/migrations/0019_auto__add_field_contextrecord_auto_external_id__add_field_historicalco.py +++ b/archaeological_context_records/old_migrations/0019_auto__add_field_contextrecord_auto_external_id__add_field_historicalco.py diff --git a/archaeological_context_records/migrations/0020_auto__add_field_contextrecord_datings_comment__add_field_historicalcon.py b/archaeological_context_records/old_migrations/0020_auto__add_field_contextrecord_datings_comment__add_field_historicalcon.py index c4600591e..c4600591e 100644 --- a/archaeological_context_records/migrations/0020_auto__add_field_contextrecord_datings_comment__add_field_historicalcon.py +++ b/archaeological_context_records/old_migrations/0020_auto__add_field_contextrecord_datings_comment__add_field_historicalcon.py diff --git a/archaeological_context_records/migrations/0021_auto__chg_field_contextrecord_depth__chg_field_contextrecord_thickness.py b/archaeological_context_records/old_migrations/0021_auto__chg_field_contextrecord_depth__chg_field_contextrecord_thickness.py index c48d595a7..c48d595a7 100644 --- a/archaeological_context_records/migrations/0021_auto__chg_field_contextrecord_depth__chg_field_contextrecord_thickness.py +++ b/archaeological_context_records/old_migrations/0021_auto__chg_field_contextrecord_depth__chg_field_contextrecord_thickness.py diff --git a/archaeological_context_records/migrations/0022_auto__add_field_contextrecord_image__add_field_contextrecord_thumbnail.py b/archaeological_context_records/old_migrations/0022_auto__add_field_contextrecord_image__add_field_contextrecord_thumbnail.py index 616951092..616951092 100644 --- a/archaeological_context_records/migrations/0022_auto__add_field_contextrecord_image__add_field_contextrecord_thumbnail.py +++ b/archaeological_context_records/old_migrations/0022_auto__add_field_contextrecord_image__add_field_contextrecord_thumbnail.py diff --git a/archaeological_context_records/migrations/0023_clean_parcels.py b/archaeological_context_records/old_migrations/0023_clean_parcels.py index cd38a1deb..cd38a1deb 100644 --- a/archaeological_context_records/migrations/0023_clean_parcels.py +++ b/archaeological_context_records/old_migrations/0023_clean_parcels.py diff --git a/archaeological_context_records/migrations/0024_auto__add_field_contextrecord_cached_label__add_field_historicalcontex.py b/archaeological_context_records/old_migrations/0024_auto__add_field_contextrecord_cached_label__add_field_historicalcontex.py index 675326715..675326715 100644 --- a/archaeological_context_records/migrations/0024_auto__add_field_contextrecord_cached_label__add_field_historicalcontex.py +++ b/archaeological_context_records/old_migrations/0024_auto__add_field_contextrecord_cached_label__add_field_historicalcontex.py diff --git a/archaeological_context_records/migrations/0025_generate_cached_label.py b/archaeological_context_records/old_migrations/0025_generate_cached_label.py index 1c559b21a..1c559b21a 100644 --- a/archaeological_context_records/migrations/0025_generate_cached_label.py +++ b/archaeological_context_records/old_migrations/0025_generate_cached_label.py diff --git a/archaeological_context_records/migrations/0026_auto__chg_field_contextrecord_image__chg_field_contextrecord_thumbnail.py b/archaeological_context_records/old_migrations/0026_auto__chg_field_contextrecord_image__chg_field_contextrecord_thumbnail.py index d17c902c5..d17c902c5 100644 --- a/archaeological_context_records/migrations/0026_auto__chg_field_contextrecord_image__chg_field_contextrecord_thumbnail.py +++ b/archaeological_context_records/old_migrations/0026_auto__chg_field_contextrecord_image__chg_field_contextrecord_thumbnail.py diff --git a/archaeological_context_records/migrations/0027_view_record_relations.py b/archaeological_context_records/old_migrations/0027_view_record_relations.py index ebf4a1349..ebf4a1349 100644 --- a/archaeological_context_records/migrations/0027_view_record_relations.py +++ b/archaeological_context_records/old_migrations/0027_view_record_relations.py diff --git a/archaeological_context_records/migrations/0028_auto__chg_field_contextrecord_location__chg_field_historicalcontextrec.py b/archaeological_context_records/old_migrations/0028_auto__chg_field_contextrecord_location__chg_field_historicalcontextrec.py index ef2c330cb..ef2c330cb 100644 --- a/archaeological_context_records/migrations/0028_auto__chg_field_contextrecord_location__chg_field_historicalcontextrec.py +++ b/archaeological_context_records/old_migrations/0028_auto__chg_field_contextrecord_location__chg_field_historicalcontextrec.py diff --git a/archaeological_context_records/migrations/0029_create_bulk_update_view.py b/archaeological_context_records/old_migrations/0029_create_bulk_update_view.py index 1dc20a752..1dc20a752 100644 --- a/archaeological_context_records/migrations/0029_create_bulk_update_view.py +++ b/archaeological_context_records/old_migrations/0029_create_bulk_update_view.py diff --git a/archaeological_context_records/migrations/0030_auto__add_excavationtechnictype__add_field_contextrecord_excavation_te.py b/archaeological_context_records/old_migrations/0030_auto__add_excavationtechnictype__add_field_contextrecord_excavation_te.py index 3a4097451..3a4097451 100644 --- a/archaeological_context_records/migrations/0030_auto__add_excavationtechnictype__add_field_contextrecord_excavation_te.py +++ b/archaeological_context_records/old_migrations/0030_auto__add_excavationtechnictype__add_field_contextrecord_excavation_te.py diff --git a/archaeological_context_records/migrations/0031_auto__add_documentationtype__add_field_contextrecord_diameter__add_fie.py b/archaeological_context_records/old_migrations/0031_auto__add_documentationtype__add_field_contextrecord_diameter__add_fie.py index f56f26e9f..f56f26e9f 100644 --- a/archaeological_context_records/migrations/0031_auto__add_documentationtype__add_field_contextrecord_diameter__add_fie.py +++ b/archaeological_context_records/old_migrations/0031_auto__add_documentationtype__add_field_contextrecord_diameter__add_fie.py diff --git a/archaeological_context_records/migrations/0032_has_furniture_to_documentations.py b/archaeological_context_records/old_migrations/0032_has_furniture_to_documentations.py index 0b5de776a..0b5de776a 100644 --- a/archaeological_context_records/migrations/0032_has_furniture_to_documentations.py +++ b/archaeological_context_records/old_migrations/0032_has_furniture_to_documentations.py diff --git a/archaeological_context_records/migrations/0033_auto__del_field_contextrecord_has_furniture__del_field_historicalconte.py b/archaeological_context_records/old_migrations/0033_auto__del_field_contextrecord_has_furniture__del_field_historicalconte.py index 65c5d54da..65c5d54da 100644 --- a/archaeological_context_records/migrations/0033_auto__del_field_contextrecord_has_furniture__del_field_historicalconte.py +++ b/archaeological_context_records/old_migrations/0033_auto__del_field_contextrecord_has_furniture__del_field_historicalconte.py diff --git a/archaeological_files_pdl/migrations/__init__.py b/archaeological_context_records/old_migrations/__init__.py index e69de29bb..e69de29bb 100644 --- a/archaeological_files_pdl/migrations/__init__.py +++ b/archaeological_context_records/old_migrations/__init__.py diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 29e45d3a9..72e79dadc 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -92,7 +92,7 @@  <h3>{% trans "Localisation"%}</h3>  <p><label>{%trans "Towns"%}</label> <span class='value'>{{ item.operation.towns.all|join:", " }}</span></p>  <p><label>{%trans "Related operation"%}</label> -<span class='value'><a href="#" onclick='load_window("{% url show-operation item.operation.pk ''%}");'>{{ item.operation }}</a></span></p> +<span class='value'><a href="#" onclick='load_window("{% url "show-operation" item.operation.pk ''%}");'>{{ item.operation }}</a></span></p>  {% else %}<p class='alert'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <label>{%trans "No operation linked to this context unit!"%}</label></p>  {% endif %} diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py index b613b837e..60fbaa65e 100644 --- a/archaeological_context_records/tests.py +++ b/archaeological_context_records/tests.py @@ -595,7 +595,7 @@ class ContextRecordWizardCreationTest(WizardTest, ContextRecordInit, TestCase):              'relations',              {'right_record': self.related_cr.pk,               'relation_type': models.RelationType.objects.create( -                 label="Test").pk} +                 label="Test", symmetrical=False).pk}          )          self.cr_nb = models.ContextRecord.objects.count() diff --git a/archaeological_context_records/urls.py b/archaeological_context_records/urls.py index e89a76aef..ef8dea98c 100644 --- a/archaeological_context_records/urls.py +++ b/archaeological_context_records/urls.py @@ -17,7 +17,7 @@  # See the file COPYING for details. -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url  from archaeological_context_records import models  from ishtar_common.wizards import check_rights diff --git a/archaeological_context_records/views.py b/archaeological_context_records/views.py index 250fdafc0..3bfe544be 100644 --- a/archaeological_context_records/views.py +++ b/archaeological_context_records/views.py @@ -43,9 +43,9 @@ def autocomplete_contextrecord(request):          and not request.user.has_perm(              'archaeological_context_records.view_own_contextrecord',              models.ArchaeologicalSite)): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      if request.GET.get('operation__pk'): @@ -62,7 +62,7 @@ def autocomplete_contextrecord(request):      data = json.dumps([{'id': item.pk,                          'value': unicode(item)[:60]}                         for item in items]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  get_contextrecord = get_item(      models.ContextRecord, diff --git a/archaeological_files/migrations/0001_initial.py b/archaeological_files/migrations/0001_initial.py index b69998442..878be3902 100644 --- a/archaeological_files/migrations/0001_initial.py +++ b/archaeological_files/migrations/0001_initial.py @@ -1,348 +1,159 @@  # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): -        # Adding model 'FileType' -        db.create_table('archaeological_files_filetype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_files', ['FileType']) - -        # Adding model 'PermitType' -        db.create_table('archaeological_files_permittype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_files', ['PermitType']) - -        # Adding model 'SaisineType' -        db.create_table('archaeological_files_saisinetype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('delay', self.gf('django.db.models.fields.IntegerField')()), -        )) -        db.send_create_signal('archaeological_files', ['SaisineType']) - -        # Adding model 'HistoricalFile' -        db.create_table('archaeological_files_historicalfile', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('year', self.gf('django.db.models.fields.IntegerField')(default=2012)), -            ('numeric_reference', self.gf('django.db.models.fields.IntegerField')()), -            ('internal_reference', self.gf('django.db.models.fields.CharField')(max_length=60, db_index=True)), -            ('file_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('in_charge_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('general_contractor_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('town_planning_service_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('permit_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('permit_reference', self.gf('django.db.models.fields.CharField')(max_length=60, null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('creation_date', self.gf('django.db.models.fields.DateField')(default=datetime.date.today)), -            ('reception_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('related_file_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('saisine_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('reference_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('total_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('total_developed_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_files', ['HistoricalFile']) - -        # Adding model 'File' -        db.create_table('archaeological_files_file', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('year', self.gf('django.db.models.fields.IntegerField')(default=2012)), -            ('numeric_reference', self.gf('django.db.models.fields.IntegerField')()), -            ('internal_reference', self.gf('django.db.models.fields.CharField')(unique=True, max_length=60)), -            ('file_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.FileType'])), -            ('in_charge', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['ishtar_common.Person'])), -            ('general_contractor', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), -            ('town_planning_service', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Organization'])), -            ('permit_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.PermitType'], null=True, blank=True)), -            ('permit_reference', self.gf('django.db.models.fields.CharField')(max_length=60, null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('creation_date', self.gf('django.db.models.fields.DateField')(default=datetime.date.today)), -            ('reception_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('related_file', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.File'], null=True, blank=True)), -            ('saisine_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.SaisineType'], null=True, blank=True)), -            ('reference_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('total_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('total_developed_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_files', ['File']) - -        # Adding M2M table for field towns on 'File' -        db.create_table('archaeological_files_file_towns', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('file', models.ForeignKey(orm['archaeological_files.file'], null=False)), -            ('town', models.ForeignKey(orm['ishtar_common.town'], null=False)) -        )) -        db.create_unique('archaeological_files_file_towns', ['file_id', 'town_id']) - +from __future__ import unicode_literals -    def backwards(self, orm): -        # Deleting model 'FileType' -        db.delete_table('archaeological_files_filetype') - -        # Deleting model 'PermitType' -        db.delete_table('archaeological_files_permittype') - -        # Deleting model 'SaisineType' -        db.delete_table('archaeological_files_saisinetype') - -        # Deleting model 'HistoricalFile' -        db.delete_table('archaeological_files_historicalfile') - -        # Deleting model 'File' -        db.delete_table('archaeological_files_file') - -        # Removing M2M table for field towns on 'File' -        db.delete_table('archaeological_files_file_towns') - - -    models = { -        'archaeological_files.file': { -            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), -            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) -        }, -        'archaeological_files.filebydepartment': { -            'Meta': {'object_name': 'FileByDepartment', 'db_table': "'file_department'", 'managed': 'False'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.historicalfile': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFile'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'file_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'general_contractor_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'db_index': 'True'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), -            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'permit_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'related_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'saisine_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'town_planning_service_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.wizard': { -            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) -        }, -        'ishtar_common.wizardstep': { -            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) -        } -    } - -    complete_apps = ['archaeological_files']
\ No newline at end of file +from django.db import models, migrations +import datetime +import archaeological_operations.models +import ishtar_common.utils +import ishtar_common.models +import re +import django.core.validators + + +class Migration(migrations.Migration): + +    dependencies = [ +    ] + +    operations = [ +        migrations.CreateModel( +            name='FileByDepartment', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +            ], +            options={ +                'db_table': 'file_department', +                'managed': False, +            }, +        ), +        migrations.CreateModel( +            name='File', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('year', models.IntegerField(default=ishtar_common.utils.get_current_year, verbose_name='Year')), +                ('numeric_reference', models.IntegerField(null=True, verbose_name='Numeric reference', blank=True)), +                ('internal_reference', models.CharField(max_length=60, null=True, verbose_name='Internal reference', blank=True)), +                ('external_id', models.CharField(max_length=120, null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('name', models.TextField(null=True, verbose_name='Name', blank=True)), +                ('raw_general_contractor', models.CharField(max_length=200, null=True, verbose_name='General contractor (raw)', blank=True)), +                ('raw_town_planning_service', models.CharField(max_length=200, null=True, verbose_name='Planning service (raw)', blank=True)), +                ('permit_reference', models.TextField(null=True, verbose_name='Permit reference', blank=True)), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('creation_date', models.DateField(default=datetime.date.today, null=True, verbose_name='Creation date', blank=True)), +                ('reception_date', models.DateField(null=True, verbose_name='Reception date', blank=True)), +                ('instruction_deadline', models.DateField(null=True, verbose_name='Instruction deadline', blank=True)), +                ('total_surface', models.FloatField(null=True, verbose_name='Total surface (m2)', blank=True)), +                ('total_developed_surface', models.FloatField(null=True, verbose_name='Total developed surface (m2)', blank=True)), +                ('locality', models.CharField(max_length=100, null=True, verbose_name='Locality', blank=True)), +                ('address', models.TextField(null=True, verbose_name='Main address', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Main address - postal code', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('research_comment', models.TextField(null=True, verbose_name='Research archaeology comment', blank=True)), +                ('classified_area', models.NullBooleanField(verbose_name='Classified area')), +                ('protected_area', models.NullBooleanField(verbose_name='Protected area')), +                ('cira_advised', models.NullBooleanField(verbose_name='Passage en CIRA')), +                ('mh_register', models.NullBooleanField(verbose_name='Sur Monument Historique class\xe9')), +                ('mh_listing', models.NullBooleanField(verbose_name='Sur Monument Historique inscrit')), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +                ('imported_line', models.TextField(null=True, verbose_name='Imported line', blank=True)), +            ], +            options={ +                'ordering': ('cached_label',), +                'verbose_name': 'Archaeological file', +                'verbose_name_plural': 'Archaeological files', +                'permissions': (('view_file', 'Peut voir tous les Dossiers'), ('view_own_file', 'Peut voir son propre Dossier'), ('add_own_file', 'Peut ajouter son propre Dossier'), ('change_own_file', 'Peut modifier son propre Dossier'), ('delete_own_file', 'Peut supprimer son propre Dossier'), ('close_file', 'Peut clore un Dossier')), +            }, +            bases=(archaeological_operations.models.ClosedItem, models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter, ishtar_common.models.ShortMenuItem, ishtar_common.models.DashboardFormItem), +        ), +        migrations.CreateModel( +            name='FileType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Archaeological file type', +                'verbose_name_plural': 'Archaeological file types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='HistoricalFile', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('year', models.IntegerField(default=ishtar_common.utils.get_current_year, verbose_name='Year')), +                ('numeric_reference', models.IntegerField(null=True, verbose_name='Numeric reference', blank=True)), +                ('internal_reference', models.CharField(max_length=60, null=True, verbose_name='Internal reference', blank=True)), +                ('external_id', models.CharField(max_length=120, null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('name', models.TextField(null=True, verbose_name='Name', blank=True)), +                ('raw_general_contractor', models.CharField(max_length=200, null=True, verbose_name='General contractor (raw)', blank=True)), +                ('raw_town_planning_service', models.CharField(max_length=200, null=True, verbose_name='Planning service (raw)', blank=True)), +                ('permit_reference', models.TextField(null=True, verbose_name='Permit reference', blank=True)), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('creation_date', models.DateField(default=datetime.date.today, null=True, verbose_name='Creation date', blank=True)), +                ('reception_date', models.DateField(null=True, verbose_name='Reception date', blank=True)), +                ('instruction_deadline', models.DateField(null=True, verbose_name='Instruction deadline', blank=True)), +                ('total_surface', models.FloatField(null=True, verbose_name='Total surface (m2)', blank=True)), +                ('total_developed_surface', models.FloatField(null=True, verbose_name='Total developed surface (m2)', blank=True)), +                ('locality', models.CharField(max_length=100, null=True, verbose_name='Locality', blank=True)), +                ('address', models.TextField(null=True, verbose_name='Main address', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Main address - postal code', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('research_comment', models.TextField(null=True, verbose_name='Research archaeology comment', blank=True)), +                ('classified_area', models.NullBooleanField(verbose_name='Classified area')), +                ('protected_area', models.NullBooleanField(verbose_name='Protected area')), +                ('cira_advised', models.NullBooleanField(verbose_name='Passage en CIRA')), +                ('mh_register', models.NullBooleanField(verbose_name='Sur Monument Historique class\xe9')), +                ('mh_listing', models.NullBooleanField(verbose_name='Sur Monument Historique inscrit')), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +                ('imported_line', models.TextField(null=True, verbose_name='Imported line', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Archaeological file', +            }, +        ), +        migrations.CreateModel( +            name='PermitType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Permit type', +                'verbose_name_plural': 'Permit types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='SaisineType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('delay', models.IntegerField(default=30, verbose_name='Delay (in days)')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Type de saisine', +                'verbose_name_plural': 'Types de saisine', +            }, +            bases=(ishtar_common.models.Cached, models.Model, ishtar_common.models.ValueGetter), +        ), +    ] diff --git a/archaeological_files/migrations/0002_auto_20170414_2123.py b/archaeological_files/migrations/0002_auto_20170414_2123.py new file mode 100644 index 000000000..a8c8d7075 --- /dev/null +++ b/archaeological_files/migrations/0002_auto_20170414_2123.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_files', '0001_initial'), +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +        ('ishtar_common', '0001_initial'), +    ] + +    operations = [ +        migrations.AddField( +            model_name='historicalfile', +            name='corporation_general_contractor', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='file_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_files.FileType', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='general_contractor', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='in_charge', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='main_town', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Town', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='organization', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='permit_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_files.PermitType', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='planning_service', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='related_file', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='requested_operation_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.OperationType', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='responsible_town_planning_service', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='saisine_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_files.SaisineType', null=True), +        ), +        migrations.AddField( +            model_name='historicalfile', +            name='scientist', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='corporation_general_contractor', +            field=models.ForeignKey(related_name='general_contractor_files', on_delete=django.db.models.deletion.SET_NULL, verbose_name='General contractor organization', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='departments', +            field=models.ManyToManyField(to='ishtar_common.Department', verbose_name='Departments', blank=True), +        ), +        migrations.AddField( +            model_name='file', +            name='file_type', +            field=models.ForeignKey(verbose_name='File type', to='archaeological_files.FileType'), +        ), +        migrations.AddField( +            model_name='file', +            name='general_contractor', +            field=models.ForeignKey(related_name='general_contractor_files', on_delete=django.db.models.deletion.SET_NULL, verbose_name='General contractor', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_files_file', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='file', +            name='in_charge', +            field=models.ForeignKey(related_name='file_responsability', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Person in charge', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='main_town', +            field=models.ForeignKey(related_name='file_main', verbose_name='Town', blank=True, to='ishtar_common.Town', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='organization', +            field=models.ForeignKey(related_name='files', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Organization', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='permit_type', +            field=models.ForeignKey(verbose_name='Permit type', blank=True, to='archaeological_files.PermitType', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='planning_service', +            field=models.ForeignKey(related_name='planning_service_files', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Planning service organization', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='related_file', +            field=models.ForeignKey(verbose_name='Related file', blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='requested_operation_type', +            field=models.ForeignKey(related_name='+', verbose_name='Requested operation type', blank=True, to='ishtar_common.OperationType', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='responsible_town_planning_service', +            field=models.ForeignKey(related_name='responsible_town_planning_service_files', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Responsible for planning service', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='saisine_type', +            field=models.ForeignKey(verbose_name='Type de saisine', blank=True, to='archaeological_files.SaisineType', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='scientist', +            field=models.ForeignKey(related_name='scientist', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Scientist in charge', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='file', +            name='towns', +            field=models.ManyToManyField(related_name='file', verbose_name='Towns', to='ishtar_common.Town'), +        ), +    ] diff --git a/archaeological_files/migrations/0003_views.py b/archaeological_files/migrations/0003_views.py new file mode 100644 index 000000000..5e3d891ad --- /dev/null +++ b/archaeological_files/migrations/0003_views.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from archaeological_files.models import FileByDepartment + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_files', '0002_auto_20170414_2123'), +    ] + +    operations = [ +        migrations.RunSQL(FileByDepartment.CREATE_SQL) +    ] diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 195418bc8..a9a277280 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -26,7 +26,8 @@ from django.db.models import Q, Count, Sum  from django.db.models.signals import post_save, m2m_changed, post_delete  from django.utils.translation import ugettext_lazy as _, ugettext -from ishtar_common.utils import cached_label_changed, get_cache +from ishtar_common.utils import cached_label_changed, get_cache, \ +    get_current_year  from ishtar_common.models import GeneralType, BaseHistorizedItem, \      HistoricalRecords, OwnPerms, Person, Organization, Department, Town, \ @@ -105,8 +106,7 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,      }      # fields -    year = models.IntegerField(_(u"Year"), -                               default=lambda: datetime.datetime.now().year) +    year = models.IntegerField(_(u"Year"), default=get_current_year)      numeric_reference = models.IntegerField(          _(u"Numeric reference"), blank=True, null=True)      internal_reference = models.CharField(_(u"Internal reference"), blank=True, @@ -180,7 +180,7 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,      comment = models.TextField(_(u"Comment"), null=True, blank=True)      # research archaeology -->      departments = models.ManyToManyField( -        Department, verbose_name=_(u"Departments"), null=True, blank=True) +        Department, verbose_name=_(u"Departments"), blank=True)      requested_operation_type = models.ForeignKey(          OperationType, related_name='+', null=True,          blank=True, verbose_name=_(u"Requested operation type")) @@ -220,14 +220,12 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,          verbose_name = _(u"Archaeological file")          verbose_name_plural = _(u"Archaeological files")          permissions = ( -            ("view_file", ugettext(u"Can view all Archaeological files")), -            ("view_own_file", ugettext(u"Can view own Archaeological file")), -            ("add_own_file", ugettext(u"Can add own Archaeological file")), -            ("change_own_file", -             ugettext(u"Can change own Archaeological file")), -            ("delete_own_file", -             ugettext(u"Can delete own Archaeological file")), -            ("close_file", ugettext(u"Can close File")), +            ("view_file", u"Can view all Archaeological files"), +            ("view_own_file", u"Can view own Archaeological file"), +            ("add_own_file", u"Can add own Archaeological file"), +            ("change_own_file", u"Can change own Archaeological file"), +            ("delete_own_file", u"Can delete own Archaeological file"), +            ("close_file", u"Can close File"),          )          ordering = ('cached_label',) @@ -430,9 +428,9 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,          return self.towns.all()[0].numero_insee[:2]      @classmethod -    def get_query_owns(cls, user): -        return (Q(history_creator=user) | -                Q(in_charge__ishtaruser=user.ishtaruser)) \ +    def get_query_owns(cls, ishtaruser): +        return (Q(history_creator=ishtaruser.user_ptr) | +                Q(in_charge__ishtaruser=ishtaruser)) \              & Q(end_date__isnull=True)      def is_active(self): @@ -554,6 +552,19 @@ class FileByDepartment(models.Model):      """      Database view for dashboard      """ +    CREATE_SQL = """ +    CREATE VIEW file_department (id, department_id, file_id) as +        select town."id", town."departement_id", file_towns."file_id" +            from ishtar_common_town town +            inner join archaeological_files_file_towns file_towns +                on file_towns."town_id"=town."id" +            order by town."departement_id"; +    CREATE RULE file_department_delete +                        AS ON DELETE TO file_department DO INSTEAD(); +    """ +    DELETE_SQL = """ +    DROP VIEW file_department; +    """      file = models.ForeignKey(File, verbose_name=_(u"File"))      department = models.ForeignKey(Department, verbose_name=_(u"Department"),                                     blank=True, null=True) diff --git a/archaeological_files/old_migrations/0001_initial.py b/archaeological_files/old_migrations/0001_initial.py new file mode 100644 index 000000000..b69998442 --- /dev/null +++ b/archaeological_files/old_migrations/0001_initial.py @@ -0,0 +1,348 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + +    def forwards(self, orm): +        # Adding model 'FileType' +        db.create_table('archaeological_files_filetype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_files', ['FileType']) + +        # Adding model 'PermitType' +        db.create_table('archaeological_files_permittype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_files', ['PermitType']) + +        # Adding model 'SaisineType' +        db.create_table('archaeological_files_saisinetype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('delay', self.gf('django.db.models.fields.IntegerField')()), +        )) +        db.send_create_signal('archaeological_files', ['SaisineType']) + +        # Adding model 'HistoricalFile' +        db.create_table('archaeological_files_historicalfile', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('year', self.gf('django.db.models.fields.IntegerField')(default=2012)), +            ('numeric_reference', self.gf('django.db.models.fields.IntegerField')()), +            ('internal_reference', self.gf('django.db.models.fields.CharField')(max_length=60, db_index=True)), +            ('file_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('in_charge_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('general_contractor_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('town_planning_service_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('permit_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('permit_reference', self.gf('django.db.models.fields.CharField')(max_length=60, null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('creation_date', self.gf('django.db.models.fields.DateField')(default=datetime.date.today)), +            ('reception_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('related_file_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('saisine_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('reference_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('total_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('total_developed_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_files', ['HistoricalFile']) + +        # Adding model 'File' +        db.create_table('archaeological_files_file', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('year', self.gf('django.db.models.fields.IntegerField')(default=2012)), +            ('numeric_reference', self.gf('django.db.models.fields.IntegerField')()), +            ('internal_reference', self.gf('django.db.models.fields.CharField')(unique=True, max_length=60)), +            ('file_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.FileType'])), +            ('in_charge', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['ishtar_common.Person'])), +            ('general_contractor', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), +            ('town_planning_service', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Organization'])), +            ('permit_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.PermitType'], null=True, blank=True)), +            ('permit_reference', self.gf('django.db.models.fields.CharField')(max_length=60, null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('creation_date', self.gf('django.db.models.fields.DateField')(default=datetime.date.today)), +            ('reception_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('related_file', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.File'], null=True, blank=True)), +            ('saisine_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_files.SaisineType'], null=True, blank=True)), +            ('reference_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('total_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('total_developed_surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_files', ['File']) + +        # Adding M2M table for field towns on 'File' +        db.create_table('archaeological_files_file_towns', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('file', models.ForeignKey(orm['archaeological_files.file'], null=False)), +            ('town', models.ForeignKey(orm['ishtar_common.town'], null=False)) +        )) +        db.create_unique('archaeological_files_file_towns', ['file_id', 'town_id']) + + +    def backwards(self, orm): +        # Deleting model 'FileType' +        db.delete_table('archaeological_files_filetype') + +        # Deleting model 'PermitType' +        db.delete_table('archaeological_files_permittype') + +        # Deleting model 'SaisineType' +        db.delete_table('archaeological_files_saisinetype') + +        # Deleting model 'HistoricalFile' +        db.delete_table('archaeological_files_historicalfile') + +        # Deleting model 'File' +        db.delete_table('archaeological_files_file') + +        # Removing M2M table for field towns on 'File' +        db.delete_table('archaeological_files_file_towns') + + +    models = { +        'archaeological_files.file': { +            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), +            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), +            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), +            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), +            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), +            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), +            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), +            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) +        }, +        'archaeological_files.filebydepartment': { +            'Meta': {'object_name': 'FileByDepartment', 'db_table': "'file_department'", 'managed': 'False'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) +        }, +        'archaeological_files.filetype': { +            'Meta': {'object_name': 'FileType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.historicalfile': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFile'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'file_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'general_contractor_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'db_index': 'True'}), +            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), +            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), +            'permit_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'related_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'saisine_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'town_planning_service_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) +        }, +        'archaeological_files.permittype': { +            'Meta': {'object_name': 'PermitType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.saisinetype': { +            'Meta': {'object_name': 'SaisineType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'delay': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'auth.group': { +            'Meta': {'object_name': 'Group'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), +            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) +        }, +        'auth.permission': { +            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, +            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) +        }, +        'auth.user': { +            'Meta': {'object_name': 'User'}, +            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), +            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), +            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), +            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'contenttypes.contenttype': { +            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, +            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) +        }, +        'ishtar_common.arrondissement': { +            'Meta': {'object_name': 'Arrondissement'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.canton': { +            'Meta': {'object_name': 'Canton'}, +            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.department': { +            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) +        }, +        'ishtar_common.organization': { +            'Meta': {'object_name': 'Organization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.organizationtype': { +            'Meta': {'object_name': 'OrganizationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.person': { +            'Meta': {'object_name': 'Person'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.persontype': { +            'Meta': {'object_name': 'PersonType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.town': { +            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, +            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), +            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), +            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.wizard': { +            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) +        }, +        'ishtar_common.wizardstep': { +            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) +        } +    } + +    complete_apps = ['archaeological_files']
\ No newline at end of file diff --git a/archaeological_files/migrations/0002_views.py b/archaeological_files/old_migrations/0002_views.py index dfbb466ec..dfbb466ec 100644 --- a/archaeological_files/migrations/0002_views.py +++ b/archaeological_files/old_migrations/0002_views.py diff --git a/archaeological_files/migrations/0003_auto__add_field_file_name__add_field_historicalfile_name.py b/archaeological_files/old_migrations/0003_auto__add_field_file_name__add_field_historicalfile_name.py index 9dd744073..9dd744073 100644 --- a/archaeological_files/migrations/0003_auto__add_field_file_name__add_field_historicalfile_name.py +++ b/archaeological_files/old_migrations/0003_auto__add_field_file_name__add_field_historicalfile_name.py diff --git a/archaeological_files/migrations/0004_auto__chg_field_file_numeric_reference__chg_field_historicalfile_numer.py b/archaeological_files/old_migrations/0004_auto__chg_field_file_numeric_reference__chg_field_historicalfile_numer.py index bcd4f7061..bcd4f7061 100644 --- a/archaeological_files/migrations/0004_auto__chg_field_file_numeric_reference__chg_field_historicalfile_numer.py +++ b/archaeological_files/old_migrations/0004_auto__chg_field_file_numeric_reference__chg_field_historicalfile_numer.py diff --git a/archaeological_files/migrations/0005_auto__chg_field_file_internal_reference__chg_field_historicalfile_inte.py b/archaeological_files/old_migrations/0005_auto__chg_field_file_internal_reference__chg_field_historicalfile_inte.py index 2a26cdc3e..2a26cdc3e 100644 --- a/archaeological_files/migrations/0005_auto__chg_field_file_internal_reference__chg_field_historicalfile_inte.py +++ b/archaeological_files/old_migrations/0005_auto__chg_field_file_internal_reference__chg_field_historicalfile_inte.py diff --git a/archaeological_files/migrations/0006_auto__chg_field_file_in_charge.py b/archaeological_files/old_migrations/0006_auto__chg_field_file_in_charge.py index 3c7ec0f50..3c7ec0f50 100644 --- a/archaeological_files/migrations/0006_auto__chg_field_file_in_charge.py +++ b/archaeological_files/old_migrations/0006_auto__chg_field_file_in_charge.py diff --git a/archaeological_files/migrations/0007_auto__add_field_file_cached_label__add_field_historicalfile_cached_lab.py b/archaeological_files/old_migrations/0007_auto__add_field_file_cached_label__add_field_historicalfile_cached_lab.py index 92e979bd4..92e979bd4 100644 --- a/archaeological_files/migrations/0007_auto__add_field_file_cached_label__add_field_historicalfile_cached_lab.py +++ b/archaeological_files/old_migrations/0007_auto__add_field_file_cached_label__add_field_historicalfile_cached_lab.py diff --git a/archaeological_files/migrations/0008_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py b/archaeological_files/old_migrations/0008_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py index 93fb7e01f..93fb7e01f 100644 --- a/archaeological_files/migrations/0008_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py +++ b/archaeological_files/old_migrations/0008_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py diff --git a/archaeological_files/migrations/0009_auto__add_field_file_responsible_town_planning_service__add_field_hist.py b/archaeological_files/old_migrations/0009_auto__add_field_file_responsible_town_planning_service__add_field_hist.py index 39d2b9267..39d2b9267 100644 --- a/archaeological_files/migrations/0009_auto__add_field_file_responsible_town_planning_service__add_field_hist.py +++ b/archaeological_files/old_migrations/0009_auto__add_field_file_responsible_town_planning_service__add_field_hist.py diff --git a/archaeological_files/migrations/0010_responsible_town_planning_service_transition.py b/archaeological_files/old_migrations/0010_responsible_town_planning_service_transition.py index 80771c562..80771c562 100644 --- a/archaeological_files/migrations/0010_responsible_town_planning_service_transition.py +++ b/archaeological_files/old_migrations/0010_responsible_town_planning_service_transition.py diff --git a/archaeological_files/migrations/0011_auto__del_field_file_town_planning_service__del_field_historicalfile_t.py b/archaeological_files/old_migrations/0011_auto__del_field_file_town_planning_service__del_field_historicalfile_t.py index fb2af402a..fb2af402a 100644 --- a/archaeological_files/migrations/0011_auto__del_field_file_town_planning_service__del_field_historicalfile_t.py +++ b/archaeological_files/old_migrations/0011_auto__del_field_file_town_planning_service__del_field_historicalfile_t.py diff --git a/archaeological_files/migrations/0012_auto__del_unique_file_internal_reference__add_unique_file_year_interna.py b/archaeological_files/old_migrations/0012_auto__del_unique_file_internal_reference__add_unique_file_year_interna.py index da1695457..da1695457 100644 --- a/archaeological_files/migrations/0012_auto__del_unique_file_internal_reference__add_unique_file_year_interna.py +++ b/archaeological_files/old_migrations/0012_auto__del_unique_file_internal_reference__add_unique_file_year_interna.py diff --git a/archaeological_files/migrations/0013_auto__del_unique_file_year_internal_reference.py b/archaeological_files/old_migrations/0013_auto__del_unique_file_year_internal_reference.py index 24df2cb2c..24df2cb2c 100644 --- a/archaeological_files/migrations/0013_auto__del_unique_file_year_internal_reference.py +++ b/archaeological_files/old_migrations/0013_auto__del_unique_file_year_internal_reference.py diff --git a/archaeological_files/migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py b/archaeological_files/old_migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py index aeb1faec1..aeb1faec1 100644 --- a/archaeological_files/migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py +++ b/archaeological_files/old_migrations/0014_auto__add_field_file_requested_operation_type__add_field_file_organiza.py diff --git a/archaeological_files/migrations/0015_auto__add_field_file_history_creator__add_field_historicalfile_history.py b/archaeological_files/old_migrations/0015_auto__add_field_file_history_creator__add_field_historicalfile_history.py index 3be3e48ac..3be3e48ac 100644 --- a/archaeological_files/migrations/0015_auto__add_field_file_history_creator__add_field_historicalfile_history.py +++ b/archaeological_files/old_migrations/0015_auto__add_field_file_history_creator__add_field_historicalfile_history.py diff --git a/archaeological_files/migrations/0016_init_history_creator.py b/archaeological_files/old_migrations/0016_init_history_creator.py index 32eef3c9c..32eef3c9c 100644 --- a/archaeological_files/migrations/0016_init_history_creator.py +++ b/archaeological_files/old_migrations/0016_init_history_creator.py diff --git a/archaeological_files/migrations/0017_reinit_history_creator.py b/archaeological_files/old_migrations/0017_reinit_history_creator.py index 003c6f25d..003c6f25d 100644 --- a/archaeological_files/migrations/0017_reinit_history_creator.py +++ b/archaeological_files/old_migrations/0017_reinit_history_creator.py diff --git a/archaeological_files/migrations/0018_auto__add_field_file_imported_line__chg_field_file_responsible_town_pl.py b/archaeological_files/old_migrations/0018_auto__add_field_file_imported_line__chg_field_file_responsible_town_pl.py index 4555145a3..4555145a3 100644 --- a/archaeological_files/migrations/0018_auto__add_field_file_imported_line__chg_field_file_responsible_town_pl.py +++ b/archaeological_files/old_migrations/0018_auto__add_field_file_imported_line__chg_field_file_responsible_town_pl.py diff --git a/archaeological_files/migrations/0019_auto__chg_field_file_history_creator__chg_field_file_history_modifier.py b/archaeological_files/old_migrations/0019_auto__chg_field_file_history_creator__chg_field_file_history_modifier.py index 74794228a..74794228a 100644 --- a/archaeological_files/migrations/0019_auto__chg_field_file_history_creator__chg_field_file_history_modifier.py +++ b/archaeological_files/old_migrations/0019_auto__chg_field_file_history_creator__chg_field_file_history_modifier.py diff --git a/archaeological_files/migrations/0020_auto.py b/archaeological_files/old_migrations/0020_auto.py index e6ecdfb3c..e6ecdfb3c 100644 --- a/archaeological_files/migrations/0020_auto.py +++ b/archaeological_files/old_migrations/0020_auto.py diff --git a/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py b/archaeological_files/old_migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py index de4898d89..de4898d89 100644 --- a/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py +++ b/archaeological_files/old_migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py diff --git a/archaeological_files/migrations/0022_auto__add_field_file_corporation_general_contractor__add_field_file_co.py b/archaeological_files/old_migrations/0022_auto__add_field_file_corporation_general_contractor__add_field_file_co.py index ddea52773..ddea52773 100644 --- a/archaeological_files/migrations/0022_auto__add_field_file_corporation_general_contractor__add_field_file_co.py +++ b/archaeological_files/old_migrations/0022_auto__add_field_file_corporation_general_contractor__add_field_file_co.py diff --git a/archaeological_files/migrations/0023_auto__del_field_file_corporation_responsible_town_planning_service__ad.py b/archaeological_files/old_migrations/0023_auto__del_field_file_corporation_responsible_town_planning_service__ad.py index b58229e78..b58229e78 100644 --- a/archaeological_files/migrations/0023_auto__del_field_file_corporation_responsible_town_planning_service__ad.py +++ b/archaeological_files/old_migrations/0023_auto__del_field_file_corporation_responsible_town_planning_service__ad.py diff --git a/archaeological_files/migrations/0024_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py b/archaeological_files/old_migrations/0024_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py index 7d297a328..7d297a328 100644 --- a/archaeological_files/migrations/0024_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py +++ b/archaeological_files/old_migrations/0024_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py diff --git a/archaeological_files/migrations/0025_auto__add_field_file_external_id__chg_field_file_name__add_field_histo.py b/archaeological_files/old_migrations/0025_auto__add_field_file_external_id__chg_field_file_name__add_field_histo.py index 37ea1dd46..37ea1dd46 100644 --- a/archaeological_files/migrations/0025_auto__add_field_file_external_id__chg_field_file_name__add_field_histo.py +++ b/archaeological_files/old_migrations/0025_auto__add_field_file_external_id__chg_field_file_name__add_field_histo.py diff --git a/archaeological_files/migrations/0026_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py b/archaeological_files/old_migrations/0026_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py index a90353c6c..a90353c6c 100644 --- a/archaeological_files/migrations/0026_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py +++ b/archaeological_files/old_migrations/0026_auto__chg_field_file_cached_label__chg_field_historicalfile_cached_lab.py diff --git a/archaeological_files/migrations/0027_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py b/archaeological_files/old_migrations/0027_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py index 345660bb4..345660bb4 100644 --- a/archaeological_files/migrations/0027_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py +++ b/archaeological_files/old_migrations/0027_auto__chg_field_file_reference_number__chg_field_historicalfile_refere.py diff --git a/archaeological_files/migrations/0028_auto__chg_field_file_requested_operation_type.py b/archaeological_files/old_migrations/0028_auto__chg_field_file_requested_operation_type.py index 303e09b0f..303e09b0f 100644 --- a/archaeological_files/migrations/0028_auto__chg_field_file_requested_operation_type.py +++ b/archaeological_files/old_migrations/0028_auto__chg_field_file_requested_operation_type.py diff --git a/archaeological_files/migrations/0029_auto__chg_field_file_creation_date__chg_field_historicalfile_creation_.py b/archaeological_files/old_migrations/0029_auto__chg_field_file_creation_date__chg_field_historicalfile_creation_.py index 52a9f70e4..52a9f70e4 100644 --- a/archaeological_files/migrations/0029_auto__chg_field_file_creation_date__chg_field_historicalfile_creation_.py +++ b/archaeological_files/old_migrations/0029_auto__chg_field_file_creation_date__chg_field_historicalfile_creation_.py diff --git a/archaeological_files/migrations/0030_reference_number_to_permit_reference.py b/archaeological_files/old_migrations/0030_reference_number_to_permit_reference.py index 8a37b5085..8a37b5085 100644 --- a/archaeological_files/migrations/0030_reference_number_to_permit_reference.py +++ b/archaeological_files/old_migrations/0030_reference_number_to_permit_reference.py diff --git a/archaeological_files/migrations/0031_auto__del_field_file_reference_number__chg_field_file_permit_reference.py b/archaeological_files/old_migrations/0031_auto__del_field_file_reference_number__chg_field_file_permit_reference.py index 7178855a8..7178855a8 100644 --- a/archaeological_files/migrations/0031_auto__del_field_file_reference_number__chg_field_file_permit_reference.py +++ b/archaeological_files/old_migrations/0031_auto__del_field_file_reference_number__chg_field_file_permit_reference.py diff --git a/archaeological_files/migrations/0032_auto__add_field_file_auto_external_id__add_field_historicalfile_auto_e.py b/archaeological_files/old_migrations/0032_auto__add_field_file_auto_external_id__add_field_historicalfile_auto_e.py index 6dd172587..6dd172587 100644 --- a/archaeological_files/migrations/0032_auto__add_field_file_auto_external_id__add_field_historicalfile_auto_e.py +++ b/archaeological_files/old_migrations/0032_auto__add_field_file_auto_external_id__add_field_historicalfile_auto_e.py diff --git a/archaeological_files/migrations/0033_auto__chg_field_file_total_surface__chg_field_file_total_developed_sur.py b/archaeological_files/old_migrations/0033_auto__chg_field_file_total_surface__chg_field_file_total_developed_sur.py index d9097bd6d..d9097bd6d 100644 --- a/archaeological_files/migrations/0033_auto__chg_field_file_total_surface__chg_field_file_total_developed_sur.py +++ b/archaeological_files/old_migrations/0033_auto__chg_field_file_total_surface__chg_field_file_total_developed_sur.py diff --git a/archaeological_files/old_migrations/__init__.py b/archaeological_files/old_migrations/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/archaeological_files/old_migrations/__init__.py diff --git a/archaeological_files/templates/ishtar/blocks/window_file_nav.html b/archaeological_files/templates/ishtar/blocks/window_file_nav.html index 149603af8..f8b6ddb8a 100644 --- a/archaeological_files/templates/ishtar/blocks/window_file_nav.html +++ b/archaeological_files/templates/ishtar/blocks/window_file_nav.html @@ -1,6 +1,5 @@  {% extends "ishtar/blocks/window_nav.html" %}  {% load i18n %} -{% load url from future %}  {% block extra_actions %}  <a class='history-nav' href='{% url "operation_add" item.pk %}'>    <span class="fa-stack fa-lg"> diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html index 9d0948660..6d64a975f 100644 --- a/archaeological_files/templates/ishtar/sheet_file.html +++ b/archaeological_files/templates/ishtar/sheet_file.html @@ -39,7 +39,7 @@  {% field_li "Type" item.file_type %} -{% if item.related_file %}<li><label>{%trans "Related file"%}</label> <span class='value'><a href='#' onclick='load_window("{% url show-file item.related_file.pk "" %}")'>{{ item.related_file }}</a></span></li>{% endif %} +{% if item.related_file %}<li><label>{%trans "Related file"%}</label> <span class='value'><a href='#' onclick='load_window("{% url "show-file" item.related_file.pk "" %}")'>{{ item.related_file }}</a></span></li>{% endif %}  </ul>  {% field "Comment" item.comment "<pre>" "</pre>" %} @@ -127,7 +127,8 @@      <td class='string'>{{operation.in_charge|default:""}}</td>      <td>{{operation.start_date|default:""}}</td>      <td>{{operation.excavation_end_date|default:""}}</td> -    <td class='link'><a href="#" class='display_details' onclick='load_window("{%url show-operation operation.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> +    <td class='link'><a href="#" class='display_details' +                        onclick='load_window("{% url "show-operation" operation.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td>    </tr>    {% empty %}    <tr><td colspan="8" class='no_items'>{% trans "No operation associated to this archaeological file" %}</td></tr> diff --git a/archaeological_files/tests.py b/archaeological_files/tests.py index 82f85e7c9..a43068e6f 100644 --- a/archaeological_files/tests.py +++ b/archaeological_files/tests.py @@ -27,45 +27,23 @@ from django.test.client import Client  from ishtar_common.tests import TestCase -from ishtar_common.models import PersonType, Town, IshtarSiteProfile +from ishtar_common.models import Town, IshtarSiteProfile  from archaeological_files import models -from archaeological_operations.models import Parcel, ParcelOwner -from archaeological_operations.tests import OperationInitTest - - -class FileInit(object): -    def login_as_superuser(self): -        self.client.login(username='username', password='tralala') - -    def create_file(self): -        self.extra_models, self.model_list = {}, [] -        self.user, created = User.objects.get_or_create(username='username', -                                                        is_superuser=True) -        self.user.set_password('tralala') -        self.user.save() -        self.o_user, created = User.objects.get_or_create(username='ousername') -        person_type, created = PersonType.objects.get_or_create( -            label=u'Test ' u'person type', txt_idx='test_person', -            available=True) -        self.extra_models['person_type'] = person_type -        self.model_list.append(person_type) - -        person = models.Person(surname='Surname', name='Name', -                               history_modifier=self.o_user) -        person.save() -        self.extra_models['person'] = person -        self.model_list.append(person) - -        file_type, created = models.FileType.objects.get_or_create( -            label=u'Test file type', txt_idx='test_file', available=True) -        self.extra_models['file_type'] = file_type -        self.model_list.append(file_type) - -        dct = {'year': 2010, 'numeric_reference': 1000, 'file_type': file_type, -               'internal_reference': u'UNIT_testÉ ?', 'in_charge': person, -               'history_modifier': self.o_user, 'total_surface': 10000} -        self.item = self.model(**dct) -        self.item.save() +from archaeological_operations.models import Parcel, ParcelOwner, ActType, \ +    AdministrativeAct +from archaeological_operations.tests import OperationInitTest, FileInit + + +def create_administrativact(user, fle): +    act_type, created = ActType.objects.get_or_create( +        txt_idx='act_type_F', intented_to='F') +    dct = {'history_modifier': user, +           'act_type': act_type, +           'associated_file': fle, +           'signature_date': datetime.date(2017, 07, 10), +           'index': 22} +    adminact, created = AdministrativeAct.objects.get_or_create(**dct) +    return [act_type], [adminact]  class FileTest(TestCase, FileInit): diff --git a/archaeological_files/urls.py b/archaeological_files/urls.py index 110851f80..04a24d398 100644 --- a/archaeological_files/urls.py +++ b/archaeological_files/urls.py @@ -17,7 +17,7 @@  # See the file COPYING for details. -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url  from ishtar_common.wizards import check_rights  import views diff --git a/archaeological_files/views.py b/archaeological_files/views.py index 0b05ad37d..d21e5801c 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -51,9 +51,9 @@ def autocomplete_file(request):         not request.user.has_perm('ishtar_common.view_own_file', models.File) \         and not request.user.ishtaruser.has_right('file_search',                                                   session=request.session): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -74,7 +74,7 @@ def autocomplete_file(request):      files = models.File.objects.filter(query)[:limit]      data = json.dumps([{'id': file.pk, 'value': unicode(file)}                         for file in files]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  get_file = get_item(models.File, 'get_file', 'file')  revert_file = revert_item(models.File) diff --git a/archaeological_files_pdl/templates/ishtar/wizard/file_confirm_wizard.html b/archaeological_files_pdl/templates/ishtar/wizard/file_confirm_wizard.html index f5268f582..914a5198b 100644 --- a/archaeological_files_pdl/templates/ishtar/wizard/file_confirm_wizard.html +++ b/archaeological_files_pdl/templates/ishtar/wizard/file_confirm_wizard.html @@ -1,5 +1,4 @@  {% extends "ishtar/wizard/confirm_wizard.html" %} -{% load url from future %}  {% load i18n %}  {% block "warning_informations" %} diff --git a/archaeological_files_pdl/urls.py b/archaeological_files_pdl/urls.py index 34646e8ad..26baaeeb1 100644 --- a/archaeological_files_pdl/urls.py +++ b/archaeological_files_pdl/urls.py @@ -17,7 +17,7 @@  # See the file COPYING for details. -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url  from archaeological_files_pdl import views diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index 83fb11028..446d67fc1 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2016  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2016-2017  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -17,13 +17,13 @@  # See the file COPYING for details. +from collections import OrderedDict  import datetime  import logging  from django import forms  from django.conf import settings  from django.core import validators -from django.db.models import Max  from django.utils.safestring import mark_safe  from django.utils.translation import ugettext_lazy as _ @@ -38,8 +38,7 @@ from archaeological_operations.forms import AdministrativeActOpeForm, \  from ishtar_common.forms import reverse_lazy, TableSelect, FinalForm, \      ManageOldType, get_form_selection -from ishtar_common.forms_common import SourceForm, SourceSelect, \ -    SourceDeletionForm +from ishtar_common.forms_common import SourceSelect  from ishtar_common import widgets @@ -184,7 +183,7 @@ class BaseTreatmentForm(ManageOldType, forms.Form):          self.fields['treatment_state'].choices = \              models.TreatmentState.get_types(                  initial=self.init_data.get('treatment_state'), -            ) +        )          self.fields['treatment_state'].help_text = \              models.TreatmentState.get_help()          # TODO @@ -192,9 +191,13 @@ class BaseTreatmentForm(ManageOldType, forms.Form):          self.fields['basket'].required = False          self.fields['basket'].help_text = \              _(u"Leave it blank if you want to select a single item") -        self.fields.keyOrder.pop(self.fields.keyOrder.index('basket')) -        self.fields.keyOrder.insert(self.fields.keyOrder.index('description'), -                                    'basket') +        fields = OrderedDict() +        basket = self.fields.pop('basket') +        for key, value in self.fields.items(): +            if key == 'description': +                fields['index'] = basket +            fields[key] = value +        self.fields = fields          """      def clean(self, *args, **kwargs): @@ -239,10 +242,14 @@ class TreatmentModifyForm(BaseTreatmentForm):      def __init__(self, *args, **kwargs):          super(TreatmentModifyForm, self).__init__(*args, **kwargs) -        self.fields.pop('target_is_basket') -        self.fields.keyOrder.pop(self.fields.keyOrder.index('index')) -        self.fields.keyOrder.insert( -            self.fields.keyOrder.index('year') + 1, 'index') +        fields = OrderedDict() +        idx = self.fields.pop('index') +        for key, value in self.fields.items(): +            fields[key] = value +            if key == 'year': +                fields['index'] = idx +        fields.pop('target_is_basket') +        self.fields = fields      def clean(self, *args, **kwargs):          super(TreatmentModifyForm, self).clean(*args, **kwargs) @@ -481,9 +488,9 @@ class TreatmentFileForm(ManageOldType, forms.Form):      creation_date = forms.DateField(label=_(u"Start date"), required=False,                                      widget=widgets.JQueryDate,                                      initial=lambda: datetime.datetime.now()) -    reception_date = forms.DateField(label=_(u"Reception date"), required=False, -                                     widget=widgets.JQueryDate, -                                     initial=lambda: datetime.datetime.now()) +    reception_date = forms.DateField( +        label=_(u"Reception date"), required=False, widget=widgets.JQueryDate, +        initial=lambda: datetime.datetime.now())      end_date = forms.DateField(label=_(u"Closing date"), required=False,                                 widget=widgets.JQueryDate) @@ -506,9 +513,13 @@ class TreatmentFileModifyForm(TreatmentFileForm):      def __init__(self, *args, **kwargs):          super(TreatmentFileModifyForm, self).__init__(*args, **kwargs) -        self.fields.keyOrder.pop(self.fields.keyOrder.index('index')) -        self.fields.keyOrder.insert( -            self.fields.keyOrder.index('year') + 1, 'index') +        fields = OrderedDict() +        idx = self.fields.pop('index') +        for key, value in self.fields.items(): +            fields[key] = value +            if key == 'year': +                fields['index'] = idx +        self.fields = fields      def clean(self, *args, **kwargs):          super(TreatmentFileModifyForm, self).clean(*args, **kwargs) @@ -595,8 +606,8 @@ class AdministrativeActTreatmentFileSelect(TableSelect):          label=_(u"Treatment request index"))      treatment_file__internal_reference = forms.CharField(          max_length=200, label=_(u"Treatment request internal reference")) -    treatment_file__type = forms.ChoiceField(label=_(u"Treatment request type"), -                                             choices=[]) +    treatment_file__type = forms.ChoiceField( +        label=_(u"Treatment request type"), choices=[])      history_modifier = forms.IntegerField(          label=_(u"Modified by"),          widget=widgets.JQueryAutoComplete( @@ -691,8 +702,8 @@ class TreatmentFileSourceSelect(SourceSelect):          label=_(u"Treatment request index"))      treatment_file__internal_reference = forms.CharField(          max_length=200, label=_(u"Treatment request internal reference")) -    treatment_file__type = forms.ChoiceField(label=_(u"Treatment request type"), -                                             choices=[]) +    treatment_file__type = forms.ChoiceField( +        label=_(u"Treatment request type"), choices=[])      def __init__(self, *args, **kwargs):          super(TreatmentFileSourceSelect, self).__init__(*args, **kwargs) diff --git a/archaeological_finds/migrations/0001_initial.py b/archaeological_finds/migrations/0001_initial.py index d5f3e804a..0f436867e 100644 --- a/archaeological_finds/migrations/0001_initial.py +++ b/archaeological_finds/migrations/0001_initial.py @@ -1,814 +1,598 @@  # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    depends_on = ( -        ('archaeological_context_records', '0001_initial.py'), -        ('archaeological_warehouse', -         '0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py'), -    ) - -    def forwards(self, orm): -        # Adding model 'MaterialType' -        db.create_table('archaeological_finds_materialtype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('recommendation', self.gf('django.db.models.fields.TextField')()), -            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.MaterialType'], null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_finds', ['MaterialType']) - -        # Adding model 'HistoricalBaseFind' -        db.create_table('archaeological_finds_historicalbasefind', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), -            ('description', self.gf('django.db.models.fields.TextField')()), -            ('context_record_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('is_isolated', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('index', self.gf('django.db.models.fields.IntegerField')(default=0)), -            ('material_index', self.gf('django.db.models.fields.IntegerField')(default=0)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_finds', ['HistoricalBaseFind']) - -        # Adding model 'BaseFind' -        db.create_table('archaeological_finds_basefind', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), -            ('description', self.gf('django.db.models.fields.TextField')()), -            ('context_record', self.gf('django.db.models.fields.related.ForeignKey')(related_name='base_finds', to=orm['archaeological_context_records.ContextRecord'])), -            ('is_isolated', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('index', self.gf('django.db.models.fields.IntegerField')(default=0)), -            ('material_index', self.gf('django.db.models.fields.IntegerField')(default=0)), -        )) -        db.send_create_signal('archaeological_finds', ['BaseFind']) - -        # Adding model 'HistoricalFind' -        db.create_table('archaeological_finds_historicalfind', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), -            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('material_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('volume', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), -            ('weight', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), -            ('find_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('upstream_treatment_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('downstream_treatment_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('dating_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('container_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_finds', ['HistoricalFind']) - -        # Adding model 'Find' -        db.create_table('archaeological_finds_find', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), -            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('material_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.MaterialType'])), -            ('volume', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), -            ('weight', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), -            ('find_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('upstream_treatment', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='downstream_treatment', null=True, to=orm['archaeological_finds.Treatment'])), -            ('downstream_treatment', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='upstream_treatment', null=True, to=orm['archaeological_finds.Treatment'])), -            ('dating', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.Dating'])), -            ('container', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='finds', null=True, to=orm['archaeological_warehouse.Container'])), -        )) -        db.send_create_signal('archaeological_finds', ['Find']) - -        # Adding M2M table for field base_finds on 'Find' -        db.create_table('archaeological_finds_find_base_finds', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('find', models.ForeignKey(orm['archaeological_finds.find'], null=False)), -            ('basefind', models.ForeignKey(orm['archaeological_finds.basefind'], null=False)) -        )) -        db.create_unique('archaeological_finds_find_base_finds', ['find_id', 'basefind_id']) - -        # Adding model 'FindSource' -        db.create_table('archaeological_finds_findsource', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), -            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), -            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('find', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_finds.Find'])), -        )) -        db.send_create_signal('archaeological_finds', ['FindSource']) - -        # Adding M2M table for field authors on 'FindSource' -        db.create_table('archaeological_finds_findsource_authors', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('findsource', models.ForeignKey(orm['archaeological_finds.findsource'], null=False)), -            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) -        )) -        db.create_unique('archaeological_finds_findsource_authors', ['findsource_id', 'author_id']) - -        # Adding model 'TreatmentType' -        db.create_table('archaeological_finds_treatmenttype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('virtual', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_finds', ['TreatmentType']) - -        # Adding model 'HistoricalTreatment' -        db.create_table('archaeological_finds_historicaltreatment', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('container_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('treatment_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('location_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('person_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_finds', ['HistoricalTreatment']) - -        # Adding model 'Treatment' -        db.create_table('archaeological_finds_treatment', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('container', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.Container'], null=True, blank=True)), -            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('treatment_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.TreatmentType'])), -            ('location', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.Warehouse'], null=True, blank=True)), -            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'], null=True, blank=True)), -            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_finds', ['Treatment']) - -        # Adding model 'TreatmentSource' -        db.create_table('archaeological_finds_treatmentsource', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), -            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), -            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('treatment', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_finds.Treatment'])), -        )) -        db.send_create_signal('archaeological_finds', ['TreatmentSource']) - -        # Adding M2M table for field authors on 'TreatmentSource' -        db.create_table('archaeological_finds_treatmentsource_authors', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('treatmentsource', models.ForeignKey(orm['archaeological_finds.treatmentsource'], null=False)), -            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) -        )) -        db.create_unique('archaeological_finds_treatmentsource_authors', ['treatmentsource_id', 'author_id']) - -        # Adding model 'Property' -        db.create_table('archaeological_finds_property', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), -            ('find', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.Find'])), -            ('administrative_act', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.AdministrativeAct'])), -            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])), -            ('start_date', self.gf('django.db.models.fields.DateField')()), -            ('end_date', self.gf('django.db.models.fields.DateField')()), -        )) -        db.send_create_signal('archaeological_finds', ['Property']) +from __future__ import unicode_literals - -    def backwards(self, orm): -        # Deleting model 'MaterialType' -        db.delete_table('archaeological_finds_materialtype') - -        # Deleting model 'HistoricalBaseFind' -        db.delete_table('archaeological_finds_historicalbasefind') - -        # Deleting model 'BaseFind' -        db.delete_table('archaeological_finds_basefind') - -        # Deleting model 'HistoricalFind' -        db.delete_table('archaeological_finds_historicalfind') - -        # Deleting model 'Find' -        db.delete_table('archaeological_finds_find') - -        # Removing M2M table for field base_finds on 'Find' -        db.delete_table('archaeological_finds_find_base_finds') - -        # Deleting model 'FindSource' -        db.delete_table('archaeological_finds_findsource') - -        # Removing M2M table for field authors on 'FindSource' -        db.delete_table('archaeological_finds_findsource_authors') - -        # Deleting model 'TreatmentType' -        db.delete_table('archaeological_finds_treatmenttype') - -        # Deleting model 'HistoricalTreatment' -        db.delete_table('archaeological_finds_historicaltreatment') - -        # Deleting model 'Treatment' -        db.delete_table('archaeological_finds_treatment') - -        # Deleting model 'TreatmentSource' -        db.delete_table('archaeological_finds_treatmentsource') - -        # Removing M2M table for field authors on 'TreatmentSource' -        db.delete_table('archaeological_finds_treatmentsource_authors') - -        # Deleting model 'Property' -        db.delete_table('archaeological_finds_property') - - -    models = { -        'archaeological_context_records.activitytype': { -            'Meta': {'object_name': 'ActivityType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.contextrecord': { -            'Meta': {'object_name': 'ContextRecord'}, -            'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}), -            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}), -            'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}), -            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Parcel']"}), -            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.dating': { -            'Meta': {'object_name': 'Dating'}, -            'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}), -            'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.datingquality': { -            'Meta': {'object_name': 'DatingQuality'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.datingtype': { -            'Meta': {'object_name': 'DatingType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.identificationtype': { -            'Meta': {'object_name': 'IdentificationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_context_records.unit': { -            'Meta': {'object_name': 'Unit'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.file': { -            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), -            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_finds.basefind': { -            'Meta': {'object_name': 'BaseFind'}, -            'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'base_finds'", 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'description': ('django.db.models.fields.TextField', [], {}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'is_isolated': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), -            'material_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}) -        }, -        'archaeological_finds.find': { -            'Meta': {'object_name': 'Find'}, -            'base_finds': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.BaseFind']"}), -            'container': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'finds'", 'null': 'True', 'to': "orm['archaeological_warehouse.Container']"}), -            'dating': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Dating']"}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'upstream_treatment'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), -            'find_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), -            'material_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.MaterialType']"}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'upstream_treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'downstream_treatment'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'weight': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.findsource': { -            'Meta': {'object_name': 'FindSource'}, -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'find': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.Find']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'archaeological_finds.historicalbasefind': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalBaseFind'}, -            'context_record_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'is_isolated': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), -            'material_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}) -        }, -        'archaeological_finds.historicalfind': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFind'}, -            'container_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'dating_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'find_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), -            'material_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'upstream_treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'weight': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.historicaltreatment': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalTreatment'}, -            'container_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'location_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'person_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'treatment_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.materialtype': { -            'Meta': {'object_name': 'MaterialType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.MaterialType']", 'null': 'True', 'blank': 'True'}), -            'recommendation': ('django.db.models.fields.TextField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_finds.property': { -            'Meta': {'object_name': 'Property'}, -            'administrative_act': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.AdministrativeAct']"}), -            'end_date': ('django.db.models.fields.DateField', [], {}), -            'find': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.Find']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}), -            'start_date': ('django.db.models.fields.DateField', [], {}) -        }, -        'archaeological_finds.treatment': { -            'Meta': {'object_name': 'Treatment'}, -            'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']", 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'treatment_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentType']"}) -        }, -        'archaeological_finds.treatmentsource': { -            'Meta': {'object_name': 'TreatmentSource'}, -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.Treatment']"}) -        }, -        'archaeological_finds.treatmenttype': { -            'Meta': {'object_name': 'TreatmentType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), -            'virtual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) -        }, -        'archaeological_operations.acttype': { -            'Meta': {'object_name': 'ActType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.administrativeact': { -            'Meta': {'object_name': 'AdministrativeAct'}, -            'act_object': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15'}), -            'scientific': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'object_name': 'Operation'}, -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operationtype': { -            'Meta': {'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'object_name': 'Parcel'}, -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.period': { -            'Meta': {'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_warehouse.container': { -            'Meta': {'object_name': 'Container'}, -            'comment': ('django.db.models.fields.TextField', [], {}), -            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) -        }, -        'archaeological_warehouse.containertype': { -            'Meta': {'object_name': 'ContainerType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), -            'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.warehouse': { -            'Meta': {'object_name': 'Warehouse'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), -            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'null': 'True', 'blank': 'True'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) -        }, -        'archaeological_warehouse.warehousetype': { -            'Meta': {'object_name': 'WarehouseType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.wizard': { -            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) -        }, -        'ishtar_common.wizardstep': { -            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) -        } -    } - -    complete_apps = ['archaeological_finds'] +from django.db import models, migrations +import datetime +import re +import django.contrib.gis.db.models.fields +import archaeological_operations.models +import ishtar_common.utils +import ishtar_common.models +import django.core.validators + + +class Migration(migrations.Migration): + +    dependencies = [ +    ] + +    operations = [ +        migrations.CreateModel( +            name='BaseFind', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.TextField(verbose_name='Free ID')), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('special_interest', models.CharField(max_length=120, null=True, verbose_name='Special interest', blank=True)), +                ('discovery_date', models.DateField(null=True, verbose_name='Discovery date', blank=True)), +                ('index', models.IntegerField(default=0, verbose_name='Index')), +                ('material_index', models.IntegerField(default=0, verbose_name='Material index')), +                ('topographic_localisation', models.CharField(max_length=120, null=True, verbose_name='Point of topographic reference', blank=True)), +                ('x', models.FloatField(null=True, verbose_name='X', blank=True)), +                ('y', models.FloatField(null=True, verbose_name='Y', blank=True)), +                ('z', models.FloatField(null=True, verbose_name='Z', blank=True)), +                ('estimated_error_x', models.FloatField(null=True, verbose_name='Estimated error for X', blank=True)), +                ('estimated_error_y', models.FloatField(null=True, verbose_name='Estimated error for Y', blank=True)), +                ('estimated_error_z', models.FloatField(null=True, verbose_name='Estimated error for Z', blank=True)), +                ('point_2d', django.contrib.gis.db.models.fields.PointField(srid=4326, null=True, verbose_name='Point (2D)', blank=True)), +                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, dim=3, null=True, verbose_name='Point', blank=True)), +                ('line', django.contrib.gis.db.models.fields.LineStringField(srid=4326, null=True, verbose_name='Line', blank=True)), +                ('polygon', django.contrib.gis.db.models.fields.PolygonField(srid=4326, null=True, verbose_name='Polygon', blank=True)), +                ('cache_short_id', models.TextField(help_text='Cached value - do not edit', null=True, verbose_name='Short ID', blank=True)), +                ('cache_complete_id', models.TextField(help_text='Cached value - do not edit', null=True, verbose_name='Complete ID', blank=True)), +            ], +            options={ +                'verbose_name': 'Base find', +                'verbose_name_plural': 'Base finds', +                'permissions': (('view_basefind', 'Peut voir tout le Mobilier de base'), ('view_own_basefind', 'Peut voir son propre Mobilier de base'), ('add_own_basefind', 'Peut ajouter son propre Mobilier de base'), ('change_own_basefind', 'Peut modifier son propre Mobilier de base'), ('delete_own_basefind', 'Peut supprimer son propre Mobilier de base')), +            }, +            bases=(models.Model, ishtar_common.models.OwnPerms), +        ), +        migrations.CreateModel( +            name='BatchType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=10, verbose_name='Order')), +            ], +            options={ +                'ordering': ('order',), +                'verbose_name': 'Batch type', +                'verbose_name_plural': 'Batch types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='ConservatoryState', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Conservatory state', +                'verbose_name_plural': 'Conservatory states', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Find', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +                ('label', models.TextField(verbose_name='Free ID')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('conservatory_comment', models.TextField(null=True, verbose_name='Conservatory comment', blank=True)), +                ('volume', models.FloatField(null=True, verbose_name='Volume (l)', blank=True)), +                ('weight', models.FloatField(null=True, verbose_name='Weight (g)', blank=True)), +                ('weight_unit', models.CharField(blank=True, max_length=4, null=True, verbose_name='Weight unit', choices=[(b'g', 'g'), (b'kg', 'kg')])), +                ('find_number', models.IntegerField(null=True, verbose_name='Find number', blank=True)), +                ('is_complete', models.NullBooleanField(verbose_name='Is complete?')), +                ('min_number_of_individuals', models.IntegerField(null=True, verbose_name='Minimum number of individuals (MNI)', blank=True)), +                ('length', models.FloatField(null=True, verbose_name='Length (cm)', blank=True)), +                ('width', models.FloatField(null=True, verbose_name='Width (cm)', blank=True)), +                ('height', models.FloatField(null=True, verbose_name='Height (cm)', blank=True)), +                ('diameter', models.FloatField(null=True, verbose_name='Diameter (cm)', blank=True)), +                ('thickness', models.FloatField(null=True, verbose_name='Thickness (cm)', blank=True)), +                ('dimensions_comment', models.TextField(null=True, verbose_name='Dimensions comment', blank=True)), +                ('mark', models.TextField(null=True, verbose_name='Mark', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('dating_comment', models.TextField(null=True, verbose_name='Comment on dating', blank=True)), +                ('previous_id', models.TextField(null=True, verbose_name='Previous ID', blank=True)), +                ('index', models.IntegerField(default=0, verbose_name='Index')), +                ('checked', models.CharField(default=b'NC', max_length=2, verbose_name='Check', choices=[(b'NC', 'Not checked'), (b'CI', 'Checked but incorrect'), (b'CC', 'Checked and correct')])), +                ('check_date', models.DateField(default=datetime.date.today, verbose_name='Check date')), +                ('estimated_value', models.FloatField(null=True, verbose_name='Estimated value', blank=True)), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +            ], +            options={ +                'ordering': ('cached_label',), +                'verbose_name': 'Find', +                'verbose_name_plural': 'Finds', +                'permissions': (('view_find', 'Peut voir tout le Mobilier'), ('view_own_find', 'Peut voir son propre Mobilier'), ('add_own_find', 'Peut ajouter son propre Mobilier'), ('change_own_find', 'Peut modifier son propre Mobilier'), ('delete_own_find', 'Peut supprimer son propre Mobilier')), +            }, +            bases=(ishtar_common.models.ValueGetter, models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ShortMenuItem), +        ), +        migrations.CreateModel( +            name='FindBasket', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=1000, verbose_name='Label')), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'abstract': False, +            }, +        ), +        migrations.CreateModel( +            name='FindSource', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('title', models.CharField(max_length=300, verbose_name='Title')), +                ('external_id', models.TextField(max_length=300, null=True, verbose_name='External ID', blank=True)), +                ('scale', models.CharField(max_length=30, null=True, verbose_name='Scale', blank=True)), +                ('associated_url', models.URLField(null=True, verbose_name='Numerical ressource (web address)', blank=True)), +                ('receipt_date', models.DateField(null=True, verbose_name='Receipt date', blank=True)), +                ('creation_date', models.DateField(null=True, verbose_name='Creation date', blank=True)), +                ('receipt_date_in_documentation', models.DateField(null=True, verbose_name='Receipt date in documentation', blank=True)), +                ('item_number', models.IntegerField(default=1, verbose_name='Item number')), +                ('reference', models.CharField(max_length=100, null=True, verbose_name='Ref.', blank=True)), +                ('internal_reference', models.CharField(max_length=100, null=True, verbose_name='Internal ref.', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('additional_information', models.TextField(null=True, verbose_name='Additional information', blank=True)), +                ('duplicate', models.BooleanField(default=False, verbose_name='Has a duplicate')), +            ], +            options={ +                'verbose_name': 'Find documentation', +                'verbose_name_plural': 'Find documentations', +                'permissions': (('view_findsource', 'Can view all Find sources'), ('view_own_findsource', 'Can view own Find source'), ('add_own_findsource', 'Can add own Find source'), ('change_own_findsource', 'Can change own Find source'), ('delete_own_findsource', 'Can delete own Find source')), +            }, +            bases=(ishtar_common.models.OwnPerms, models.Model), +        ), +        migrations.CreateModel( +            name='HistoricalBaseFind', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('label', models.TextField(verbose_name='Free ID')), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('special_interest', models.CharField(max_length=120, null=True, verbose_name='Special interest', blank=True)), +                ('discovery_date', models.DateField(null=True, verbose_name='Discovery date', blank=True)), +                ('index', models.IntegerField(default=0, verbose_name='Index')), +                ('material_index', models.IntegerField(default=0, verbose_name='Material index')), +                ('topographic_localisation', models.CharField(max_length=120, null=True, verbose_name='Point of topographic reference', blank=True)), +                ('x', models.FloatField(null=True, verbose_name='X', blank=True)), +                ('y', models.FloatField(null=True, verbose_name='Y', blank=True)), +                ('z', models.FloatField(null=True, verbose_name='Z', blank=True)), +                ('estimated_error_x', models.FloatField(null=True, verbose_name='Estimated error for X', blank=True)), +                ('estimated_error_y', models.FloatField(null=True, verbose_name='Estimated error for Y', blank=True)), +                ('estimated_error_z', models.FloatField(null=True, verbose_name='Estimated error for Z', blank=True)), +                ('point_2d', django.contrib.gis.db.models.fields.PointField(srid=4326, null=True, verbose_name='Point (2D)', blank=True)), +                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, dim=3, null=True, verbose_name='Point', blank=True)), +                ('line', django.contrib.gis.db.models.fields.LineStringField(srid=4326, null=True, verbose_name='Line', blank=True)), +                ('polygon', django.contrib.gis.db.models.fields.PolygonField(srid=4326, null=True, verbose_name='Polygon', blank=True)), +                ('cache_short_id', models.TextField(help_text='Cached value - do not edit', null=True, verbose_name='Short ID', blank=True)), +                ('cache_complete_id', models.TextField(help_text='Cached value - do not edit', null=True, verbose_name='Complete ID', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Base find', +            }, +        ), +        migrations.CreateModel( +            name='HistoricalFind', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('image', models.TextField(max_length=255, null=True, blank=True)), +                ('thumbnail', models.TextField(max_length=255, null=True, blank=True)), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +                ('label', models.TextField(verbose_name='Free ID')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('conservatory_comment', models.TextField(null=True, verbose_name='Conservatory comment', blank=True)), +                ('volume', models.FloatField(null=True, verbose_name='Volume (l)', blank=True)), +                ('weight', models.FloatField(null=True, verbose_name='Weight (g)', blank=True)), +                ('weight_unit', models.CharField(blank=True, max_length=4, null=True, verbose_name='Weight unit', choices=[(b'g', 'g'), (b'kg', 'kg')])), +                ('find_number', models.IntegerField(null=True, verbose_name='Find number', blank=True)), +                ('is_complete', models.NullBooleanField(verbose_name='Is complete?')), +                ('min_number_of_individuals', models.IntegerField(null=True, verbose_name='Minimum number of individuals (MNI)', blank=True)), +                ('length', models.FloatField(null=True, verbose_name='Length (cm)', blank=True)), +                ('width', models.FloatField(null=True, verbose_name='Width (cm)', blank=True)), +                ('height', models.FloatField(null=True, verbose_name='Height (cm)', blank=True)), +                ('diameter', models.FloatField(null=True, verbose_name='Diameter (cm)', blank=True)), +                ('thickness', models.FloatField(null=True, verbose_name='Thickness (cm)', blank=True)), +                ('dimensions_comment', models.TextField(null=True, verbose_name='Dimensions comment', blank=True)), +                ('mark', models.TextField(null=True, verbose_name='Mark', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('dating_comment', models.TextField(null=True, verbose_name='Comment on dating', blank=True)), +                ('previous_id', models.TextField(null=True, verbose_name='Previous ID', blank=True)), +                ('index', models.IntegerField(default=0, verbose_name='Index')), +                ('checked', models.CharField(default=b'NC', max_length=2, verbose_name='Check', choices=[(b'NC', 'Not checked'), (b'CI', 'Checked but incorrect'), (b'CC', 'Checked and correct')])), +                ('check_date', models.DateField(default=datetime.date.today, verbose_name='Check date')), +                ('estimated_value', models.FloatField(null=True, verbose_name='Estimated value', blank=True)), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Find', +            }, +        ), +        migrations.CreateModel( +            name='HistoricalTreatment', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('image', models.TextField(max_length=255, null=True, blank=True)), +                ('thumbnail', models.TextField(max_length=255, null=True, blank=True)), +                ('label', models.CharField(max_length=200, null=True, verbose_name='Label', blank=True)), +                ('other_reference', models.CharField(max_length=200, null=True, verbose_name='Other ref.', blank=True)), +                ('year', models.IntegerField(default=ishtar_common.utils.get_current_year, verbose_name='Year')), +                ('index', models.IntegerField(default=1, verbose_name='Index')), +                ('external_id', models.CharField(max_length=200, null=True, verbose_name='External ID', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('goal', models.TextField(null=True, verbose_name='Goal', blank=True)), +                ('start_date', models.DateField(null=True, verbose_name='Start date', blank=True)), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('estimated_cost', models.FloatField(null=True, verbose_name='Estimated cost', blank=True)), +                ('quoted_cost', models.FloatField(null=True, verbose_name='Quoted cost', blank=True)), +                ('realized_cost', models.FloatField(null=True, verbose_name='Realized cost', blank=True)), +                ('insurance_cost', models.FloatField(null=True, verbose_name='Insurance cost', blank=True)), +                ('target_is_basket', models.BooleanField(default=False, verbose_name='Target a basket')), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Treatment', +            }, +        ), +        migrations.CreateModel( +            name='HistoricalTreatmentFile', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('year', models.IntegerField(default=ishtar_common.utils.get_current_year, verbose_name='Year')), +                ('index', models.IntegerField(default=1, verbose_name='Index')), +                ('internal_reference', models.CharField(max_length=200, null=True, verbose_name='Internal reference', blank=True)), +                ('external_id', models.CharField(max_length=200, null=True, verbose_name='External ID', blank=True)), +                ('name', models.TextField(null=True, verbose_name='Name', blank=True)), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('creation_date', models.DateField(default=datetime.date.today, null=True, verbose_name='Creation date', blank=True)), +                ('reception_date', models.DateField(null=True, verbose_name='Reception date', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Treatment request', +            }, +        ), +        migrations.CreateModel( +            name='IntegrityType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Integrity / interest type', +                'verbose_name_plural': 'Integrity / interest types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='MaterialType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('code', models.CharField(max_length=10, null=True, verbose_name='Code', blank=True)), +                ('recommendation', models.TextField(null=True, verbose_name='Recommendation', blank=True)), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Material type', +                'verbose_name_plural': 'Material types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='ObjectType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('parent__label', 'label'), +                'verbose_name': 'Object type', +                'verbose_name_plural': 'Object types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='PreservationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Preservation type', +                'verbose_name_plural': 'Preservation types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Property', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('history_date', models.DateTimeField(default=datetime.datetime.now)), +                ('start_date', models.DateField(verbose_name='Start date')), +                ('end_date', models.DateField(verbose_name='End date')), +            ], +            options={ +                'verbose_name': 'Property', +                'verbose_name_plural': 'Properties', +            }, +        ), +        migrations.CreateModel( +            name='RemarkabilityType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Remarkability type', +                'verbose_name_plural': 'Remarkability types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Treatment', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('label', models.CharField(max_length=200, null=True, verbose_name='Label', blank=True)), +                ('other_reference', models.CharField(max_length=200, null=True, verbose_name='Other ref.', blank=True)), +                ('year', models.IntegerField(default=ishtar_common.utils.get_current_year, verbose_name='Year')), +                ('index', models.IntegerField(default=1, verbose_name='Index')), +                ('external_id', models.CharField(max_length=200, null=True, verbose_name='External ID', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('goal', models.TextField(null=True, verbose_name='Goal', blank=True)), +                ('start_date', models.DateField(null=True, verbose_name='Start date', blank=True)), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('estimated_cost', models.FloatField(null=True, verbose_name='Estimated cost', blank=True)), +                ('quoted_cost', models.FloatField(null=True, verbose_name='Quoted cost', blank=True)), +                ('realized_cost', models.FloatField(null=True, verbose_name='Realized cost', blank=True)), +                ('insurance_cost', models.FloatField(null=True, verbose_name='Insurance cost', blank=True)), +                ('target_is_basket', models.BooleanField(default=False, verbose_name='Target a basket')), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +            ], +            options={ +                'verbose_name': 'Treatment', +                'verbose_name_plural': 'Treatments', +                'permissions': (('view_treatment', 'Peut voir tous les Traitements'), ('view_own_treatment', 'Peut voir son propre Traitement'), ('add_own_treatment', 'Peut ajouter son propre Traitement'), ('change_own_treatment', 'Peut modifier son propre Traitement'), ('delete_own_treatment', 'Peut supprimer son propre Traitement')), +            }, +            bases=(ishtar_common.models.DashboardFormItem, ishtar_common.models.ValueGetter, models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ShortMenuItem), +        ), +        migrations.CreateModel( +            name='TreatmentFile', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('year', models.IntegerField(default=ishtar_common.utils.get_current_year, verbose_name='Year')), +                ('index', models.IntegerField(default=1, verbose_name='Index')), +                ('internal_reference', models.CharField(max_length=200, null=True, verbose_name='Internal reference', blank=True)), +                ('external_id', models.CharField(max_length=200, null=True, verbose_name='External ID', blank=True)), +                ('name', models.TextField(null=True, verbose_name='Name', blank=True)), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('creation_date', models.DateField(default=datetime.date.today, null=True, verbose_name='Creation date', blank=True)), +                ('reception_date', models.DateField(null=True, verbose_name='Reception date', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('cached_label', models.TextField(null=True, verbose_name='Cached name', blank=True)), +            ], +            options={ +                'ordering': ('cached_label',), +                'verbose_name': 'Treatment request', +                'verbose_name_plural': 'Treatment requests', +                'permissions': (('view_filetreatment', 'Peut voir toutes les Demandes de traitement'), ('add_filetreatment', 'Can add Treatment request'), ('change_filetreatment', 'Can change Treatment request'), ('delete_filetreatment', 'Can delete Treatment request'), ('view_own_filetreatment', 'Peut voir sa propre Demande de traitement'), ('add_own_filetreatment', 'Peut ajouter sa propre Demande de traitement'), ('change_own_filetreatment', 'Peut modifier sa propre Demande de traitement'), ('delete_own_filetreatment', 'Peut supprimer sa propre Demande de traitement')), +            }, +            bases=(ishtar_common.models.DashboardFormItem, archaeological_operations.models.ClosedItem, models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter, ishtar_common.models.ShortMenuItem), +        ), +        migrations.CreateModel( +            name='TreatmentFileSource', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('title', models.CharField(max_length=300, verbose_name='Title')), +                ('external_id', models.TextField(max_length=300, null=True, verbose_name='External ID', blank=True)), +                ('scale', models.CharField(max_length=30, null=True, verbose_name='Scale', blank=True)), +                ('associated_url', models.URLField(null=True, verbose_name='Numerical ressource (web address)', blank=True)), +                ('receipt_date', models.DateField(null=True, verbose_name='Receipt date', blank=True)), +                ('creation_date', models.DateField(null=True, verbose_name='Creation date', blank=True)), +                ('receipt_date_in_documentation', models.DateField(null=True, verbose_name='Receipt date in documentation', blank=True)), +                ('item_number', models.IntegerField(default=1, verbose_name='Item number')), +                ('reference', models.CharField(max_length=100, null=True, verbose_name='Ref.', blank=True)), +                ('internal_reference', models.CharField(max_length=100, null=True, verbose_name='Internal ref.', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('additional_information', models.TextField(null=True, verbose_name='Additional information', blank=True)), +                ('duplicate', models.BooleanField(default=False, verbose_name='Has a duplicate')), +            ], +            options={ +                'verbose_name': 'Treatment request documentation', +                'verbose_name_plural': 'Treatment request documentations', +                'permissions': (('view_filetreatmentsource', 'Can view Treatment request source'), ('view_own_filetreatmentsource', 'Can view own Treatment request source'), ('add_own_filetreatmentsource', 'Can add own Treatment request source'), ('change_own_filetreatmentsource', 'Can change own Treatment request source'), ('delete_own_filetreatmentsource', 'Can delete own Treatment request source')), +            }, +            bases=(ishtar_common.models.OwnPerms, models.Model), +        ), +        migrations.CreateModel( +            name='TreatmentFileType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Treatment request type', +                'verbose_name_plural': 'Treatment request types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='TreatmentSource', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('title', models.CharField(max_length=300, verbose_name='Title')), +                ('external_id', models.TextField(max_length=300, null=True, verbose_name='External ID', blank=True)), +                ('scale', models.CharField(max_length=30, null=True, verbose_name='Scale', blank=True)), +                ('associated_url', models.URLField(null=True, verbose_name='Numerical ressource (web address)', blank=True)), +                ('receipt_date', models.DateField(null=True, verbose_name='Receipt date', blank=True)), +                ('creation_date', models.DateField(null=True, verbose_name='Creation date', blank=True)), +                ('receipt_date_in_documentation', models.DateField(null=True, verbose_name='Receipt date in documentation', blank=True)), +                ('item_number', models.IntegerField(default=1, verbose_name='Item number')), +                ('reference', models.CharField(max_length=100, null=True, verbose_name='Ref.', blank=True)), +                ('internal_reference', models.CharField(max_length=100, null=True, verbose_name='Internal ref.', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('additional_information', models.TextField(null=True, verbose_name='Additional information', blank=True)), +                ('duplicate', models.BooleanField(default=False, verbose_name='Has a duplicate')), +            ], +            options={ +                'verbose_name': 'Treatment documentation', +                'verbose_name_plural': 'Treament documentations', +                'permissions': (('view_treatmentsource', 'Can view all Treatment sources'), ('view_own_treatmentsource', 'Can view own Treatment source'), ('add_own_treatmentsource', 'Can add own Treatment source'), ('change_own_treatmentsource', 'Can change own Treatment source'), ('delete_own_treatmentsource', 'Can delete own Treatment source')), +            }, +            bases=(ishtar_common.models.OwnPerms, models.Model), +        ), +        migrations.CreateModel( +            name='TreatmentState', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Treatment state type', +                'verbose_name_plural': 'Treatment state types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='TreatmentType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=10, verbose_name='Order')), +                ('virtual', models.BooleanField(verbose_name='Virtual')), +                ('upstream_is_many', models.BooleanField(default=False, help_text="Check this if for this treatment from many finds you'll get one.", verbose_name='Upstream is many')), +                ('downstream_is_many', models.BooleanField(default=False, help_text="Check this if for this treatment from one find you'll get many.", verbose_name='Downstream is many')), +                ('parent', models.ForeignKey(verbose_name='Parent type', blank=True, to='archaeological_finds.TreatmentType', null=True)), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Treatment type', +                'verbose_name_plural': 'Treatment types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='FindDownstreamTreatments', +            fields=[ +                ('treatment', models.OneToOneField(primary_key=True, serialize=False, to='archaeological_finds.Treatment', verbose_name='Treatment')), +                ('treatment_nb', models.IntegerField(verbose_name='Order')), +            ], +            options={ +                'ordering': ('find', '-treatment_nb'), +                'db_table': 'find_downtreatments', +                'managed': False, +            }, +        ), +        migrations.CreateModel( +            name='FindTreatments', +            fields=[ +                ('treatment', models.OneToOneField(primary_key=True, serialize=False, to='archaeological_finds.Treatment', verbose_name='Treatment')), +                ('treatment_nb', models.IntegerField(verbose_name='Order')), +                ('upstream', models.BooleanField(verbose_name='Is upstream')), +            ], +            options={ +                'ordering': ('find', 'upstream', '-treatment_nb'), +                'db_table': 'find_treatments', +                'managed': False, +            }, +        ), +        migrations.CreateModel( +            name='FindUpstreamTreatments', +            fields=[ +                ('treatment', models.OneToOneField(primary_key=True, serialize=False, to='archaeological_finds.Treatment', verbose_name='Treatment')), +                ('treatment_nb', models.IntegerField(verbose_name='Order')), +            ], +            options={ +                'ordering': ('find', '-treatment_nb'), +                'db_table': 'find_uptreatments', +                'managed': False, +            }, +        ), +    ] diff --git a/archaeological_finds/migrations/0002_auto_20170414_2123.py b/archaeological_finds/migrations/0002_auto_20170414_2123.py new file mode 100644 index 000000000..380ba2807 --- /dev/null +++ b/archaeological_finds/migrations/0002_auto_20170414_2123.py @@ -0,0 +1,503 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_operations', '0001_initial'), +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +        ('archaeological_warehouse', '0001_initial'), +        ('ishtar_common', '0001_initial'), +        ('archaeological_finds', '0001_initial'), +        ('archaeological_context_records', '0003_auto_20170414_2123'), +    ] + +    operations = [ +        migrations.AddField( +            model_name='treatmentsource', +            name='authors', +            field=models.ManyToManyField(related_name='treatmentsource_related', verbose_name='Authors', to='ishtar_common.Author'), +        ), +        migrations.AddField( +            model_name='treatmentsource', +            name='format_type', +            field=models.ForeignKey(verbose_name='Format', blank=True, to='ishtar_common.Format', null=True), +        ), +        migrations.AddField( +            model_name='treatmentsource', +            name='source_type', +            field=models.ForeignKey(verbose_name='Type', to='ishtar_common.SourceType'), +        ), +        migrations.AddField( +            model_name='treatmentsource', +            name='support_type', +            field=models.ForeignKey(verbose_name='Support', blank=True, to='ishtar_common.SupportType', null=True), +        ), +        migrations.AddField( +            model_name='treatmentsource', +            name='treatment', +            field=models.ForeignKey(related_name='source', verbose_name='Treatment', to='archaeological_finds.Treatment'), +        ), +        migrations.AddField( +            model_name='treatmentfilesource', +            name='authors', +            field=models.ManyToManyField(related_name='treatmentfilesource_related', verbose_name='Authors', to='ishtar_common.Author'), +        ), +        migrations.AddField( +            model_name='treatmentfilesource', +            name='format_type', +            field=models.ForeignKey(verbose_name='Format', blank=True, to='ishtar_common.Format', null=True), +        ), +        migrations.AddField( +            model_name='treatmentfilesource', +            name='source_type', +            field=models.ForeignKey(verbose_name='Type', to='ishtar_common.SourceType'), +        ), +        migrations.AddField( +            model_name='treatmentfilesource', +            name='support_type', +            field=models.ForeignKey(verbose_name='Support', blank=True, to='ishtar_common.SupportType', null=True), +        ), +        migrations.AddField( +            model_name='treatmentfilesource', +            name='treatment_file', +            field=models.ForeignKey(related_name='source', verbose_name='Treatment request', to='archaeological_finds.TreatmentFile'), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='applicant', +            field=models.ForeignKey(related_name='treatmentfile_applicant', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Applicant', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='applicant_organisation', +            field=models.ForeignKey(related_name='treatmentfile_applicant', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Applicant organisation', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_finds_treatmentfile', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='in_charge', +            field=models.ForeignKey(related_name='treatmentfile_responsability', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Person in charge', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='treatmentfile', +            name='type', +            field=models.ForeignKey(verbose_name='Treatment request type', to='archaeological_finds.TreatmentFileType'), +        ), +        migrations.AddField( +            model_name='treatment', +            name='container', +            field=models.ForeignKey(verbose_name='Container', blank=True, to='archaeological_warehouse.Container', null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='file', +            field=models.ForeignKey(related_name='treatments', verbose_name='Associated request', blank=True, to='archaeological_finds.TreatmentFile', null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_finds_treatment', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='location', +            field=models.ForeignKey(blank=True, to='archaeological_warehouse.Warehouse', help_text='Location where the treatment is done. Target warehouse for a move.', null=True, verbose_name='Location'), +        ), +        migrations.AddField( +            model_name='treatment', +            name='organization', +            field=models.ForeignKey(related_name='treatments', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Organization', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='person', +            field=models.ForeignKey(related_name='treatments', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Responsible', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='treatment_state', +            field=models.ForeignKey(verbose_name='State', blank=True, to='archaeological_finds.TreatmentState', null=True), +        ), +        migrations.AddField( +            model_name='treatment', +            name='treatment_types', +            field=models.ManyToManyField(to='archaeological_finds.TreatmentType', verbose_name='Treatment type'), +        ), +        migrations.AddField( +            model_name='property', +            name='administrative_act', +            field=models.ForeignKey(verbose_name='Administrative act', to='archaeological_operations.AdministrativeAct'), +        ), +        migrations.AddField( +            model_name='property', +            name='find', +            field=models.ForeignKey(verbose_name='Find', to='archaeological_finds.Find'), +        ), +        migrations.AddField( +            model_name='property', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='property', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='property', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_finds_property', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='property', +            name='person', +            field=models.ForeignKey(related_name='properties', verbose_name='Person', to='ishtar_common.Person'), +        ), +        migrations.AddField( +            model_name='objecttype', +            name='parent', +            field=models.ForeignKey(verbose_name='Parent', blank=True, to='archaeological_finds.ObjectType', null=True), +        ), +        migrations.AddField( +            model_name='materialtype', +            name='parent', +            field=models.ForeignKey(verbose_name='Parent material', blank=True, to='archaeological_finds.MaterialType', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='applicant', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='applicant_organisation', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='in_charge', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatmentfile', +            name='type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.TreatmentFileType', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='container', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_warehouse.Container', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='file', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.TreatmentFile', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='location', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_warehouse.Warehouse', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='organization', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='person', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaltreatment', +            name='treatment_state', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.TreatmentState', null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='collection', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_warehouse.Collection', null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='conservatory_state', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.ConservatoryState', null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='container', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_warehouse.Container', null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='downstream_treatment', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.Treatment', null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalfind', +            name='upstream_treatment', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.Treatment', null=True), +        ), +        migrations.AddField( +            model_name='historicalbasefind', +            name='batch', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.BatchType', null=True), +        ), +        migrations.AddField( +            model_name='historicalbasefind', +            name='context_record', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_context_records.ContextRecord', null=True), +        ), +        migrations.AddField( +            model_name='historicalbasefind', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalbasefind', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalbasefind', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalbasefind', +            name='spatial_reference_system', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.SpatialReferenceSystem', null=True), +        ), +        migrations.AddField( +            model_name='findsource', +            name='authors', +            field=models.ManyToManyField(related_name='findsource_related', verbose_name='Authors', to='ishtar_common.Author'), +        ), +        migrations.AddField( +            model_name='findsource', +            name='find', +            field=models.ForeignKey(related_name='source', verbose_name='Find', to='archaeological_finds.Find'), +        ), +        migrations.AddField( +            model_name='findsource', +            name='format_type', +            field=models.ForeignKey(verbose_name='Format', blank=True, to='ishtar_common.Format', null=True), +        ), +        migrations.AddField( +            model_name='findsource', +            name='source_type', +            field=models.ForeignKey(verbose_name='Type', to='ishtar_common.SourceType'), +        ), +        migrations.AddField( +            model_name='findsource', +            name='support_type', +            field=models.ForeignKey(verbose_name='Support', blank=True, to='ishtar_common.SupportType', null=True), +        ), +        migrations.AddField( +            model_name='findbasket', +            name='items', +            field=models.ManyToManyField(related_name='basket', to='archaeological_finds.Find', blank=True), +        ), +        migrations.AddField( +            model_name='findbasket', +            name='user', +            field=models.ForeignKey(blank=True, to='ishtar_common.IshtarUser', null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='base_finds', +            field=models.ManyToManyField(related_name='find', verbose_name='Base find', to='archaeological_finds.BaseFind'), +        ), +        migrations.AddField( +            model_name='find', +            name='collection', +            field=models.ForeignKey(related_name='finds', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Collection', blank=True, to='archaeological_warehouse.Collection', null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='conservatory_state', +            field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, verbose_name='Conservatory state', blank=True, to='archaeological_finds.ConservatoryState', null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='container', +            field=models.ForeignKey(related_name='finds', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Container', blank=True, to='archaeological_warehouse.Container', null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='datings', +            field=models.ManyToManyField(related_name='find', verbose_name='Dating', to='archaeological_context_records.Dating'), +        ), +        migrations.AddField( +            model_name='find', +            name='downstream_treatment', +            field=models.ForeignKey(related_name='upstream', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Downstream treatment', blank=True, to='archaeological_finds.Treatment', null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='find', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_finds_find', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='find', +            name='integrities', +            field=models.ManyToManyField(related_name='find', verbose_name='Integrity / interest', to='archaeological_finds.IntegrityType'), +        ), +        migrations.AddField( +            model_name='find', +            name='material_types', +            field=models.ManyToManyField(related_name='finds', verbose_name='Material types', to='archaeological_finds.MaterialType'), +        ), +        migrations.AddField( +            model_name='find', +            name='object_types', +            field=models.ManyToManyField(related_name='find', verbose_name='Object types', to='archaeological_finds.ObjectType'), +        ), +        migrations.AddField( +            model_name='find', +            name='preservation_to_considers', +            field=models.ManyToManyField(related_name='finds', verbose_name='Type of preservation to consider', to='archaeological_finds.PreservationType'), +        ), +        migrations.AddField( +            model_name='find', +            name='remarkabilities', +            field=models.ManyToManyField(related_name='find', verbose_name='Remarkability', to='archaeological_finds.RemarkabilityType'), +        ), +        migrations.AddField( +            model_name='find', +            name='upstream_treatment', +            field=models.ForeignKey(related_name='downstream', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Upstream treatment', blank=True, to='archaeological_finds.Treatment', null=True), +        ), +        migrations.AddField( +            model_name='conservatorystate', +            name='parent', +            field=models.ForeignKey(verbose_name='Parent conservatory state', blank=True, to='archaeological_finds.ConservatoryState', null=True), +        ), +        migrations.AddField( +            model_name='basefind', +            name='batch', +            field=models.ForeignKey(verbose_name='Batch/object', blank=True, to='archaeological_finds.BatchType', null=True), +        ), +        migrations.AddField( +            model_name='basefind', +            name='context_record', +            field=models.ForeignKey(related_name='base_finds', verbose_name='Context Record', to='archaeological_context_records.ContextRecord'), +        ), +        migrations.AddField( +            model_name='basefind', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='basefind', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='basefind', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_finds_basefind', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='basefind', +            name='spatial_reference_system', +            field=models.ForeignKey(verbose_name='Spatial Reference System', blank=True, to='ishtar_common.SpatialReferenceSystem', null=True), +        ), +        migrations.AlterUniqueTogether( +            name='treatmentfile', +            unique_together=set([('year', 'index')]), +        ), +        migrations.AlterUniqueTogether( +            name='treatment', +            unique_together=set([('year', 'index')]), +        ), +        migrations.AlterUniqueTogether( +            name='findbasket', +            unique_together=set([('label', 'user')]), +        ), +    ] diff --git a/archaeological_finds/migrations/0003_views.py b/archaeological_finds/migrations/0003_views.py new file mode 100644 index 000000000..d405a35e1 --- /dev/null +++ b/archaeological_finds/migrations/0003_views.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations +from archaeological_finds.models import FirstBaseFindView, FindTreatments, \ +    FindDownstreamTreatments, FindUpstreamTreatments, FBulkView, BFBulkView + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_finds', '0002_auto_20170414_2123'), +    ] + +    operations = [ +        migrations.RunSQL(FindUpstreamTreatments.CREATE_SQL + +                          FindDownstreamTreatments.CREATE_SQL + +                          FindTreatments.CREATE_SQL + +                          FirstBaseFindView.CREATE_SQL + +                          FBulkView.CREATE_SQL + +                          BFBulkView.CREATE_SQL) +    ] diff --git a/archaeological_finds/migrations/0086_auto__chg_field_treatmentsource_external_id__chg_field_treatmentfileso.py b/archaeological_finds/migrations/0086_auto__chg_field_treatmentsource_external_id__chg_field_treatmentfileso.py deleted file mode 100644 index 32789a1ee..000000000 --- a/archaeological_finds/migrations/0086_auto__chg_field_treatmentsource_external_id__chg_field_treatmentfileso.py +++ /dev/null @@ -1,1251 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): - -        # Changing field 'TreatmentSource.external_id' -        db.alter_column('archaeological_finds_treatmentsource', 'external_id', self.gf('django.db.models.fields.TextField')(max_length=300, null=True)) - -        # Changing field 'TreatmentFileSource.external_id' -        db.alter_column('archaeological_finds_treatmentfilesource', 'external_id', self.gf('django.db.models.fields.TextField')(max_length=300, null=True)) - -        # Changing field 'FindSource.external_id' -        db.alter_column('archaeological_finds_findsource', 'external_id', self.gf('django.db.models.fields.TextField')(max_length=300, null=True)) - -    def backwards(self, orm): - -        # Changing field 'TreatmentSource.external_id' -        db.alter_column('archaeological_finds_treatmentsource', 'external_id', self.gf('django.db.models.fields.CharField')(max_length=12, null=True)) - -        # Changing field 'TreatmentFileSource.external_id' -        db.alter_column('archaeological_finds_treatmentfilesource', 'external_id', self.gf('django.db.models.fields.CharField')(max_length=12, null=True)) - -        # Changing field 'FindSource.external_id' -        db.alter_column('archaeological_finds_findsource', 'external_id', self.gf('django.db.models.fields.CharField')(max_length=12, null=True)) - -    models = { -        'archaeological_context_records.activitytype': { -            'Meta': {'ordering': "('order',)", 'object_name': 'ActivityType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.contextrecord': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'ContextRecord'}, -            'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'closing_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}), -            'datings_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'depth': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'depth_of_appearance': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'diameter': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'documentations': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_context_records.DocumentationType']", 'null': 'True', 'blank': 'True'}), -            'excavation_technic': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ExcavationTechnicType']", 'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_context_records_contextrecord'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'length': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'opening_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Parcel']"}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'dim': '3', 'null': 'True', 'blank': 'True'}), -            'polygon': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True', 'blank': 'True'}), -            'related_context_records': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_context_records.ContextRecord']", 'null': 'True', 'through': "orm['archaeological_context_records.RecordRelations']", 'blank': 'True'}), -            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}), -            'width': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.dating': { -            'Meta': {'object_name': 'Dating'}, -            'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}), -            'precise_dating': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_context_records.datingquality': { -            'Meta': {'ordering': "('label',)", 'object_name': 'DatingQuality'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.datingtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'DatingType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.documentationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'DocumentationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.excavationtechnictype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ExcavationTechnicType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.identificationtype': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'IdentificationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.recordrelations': { -            'Meta': {'object_name': 'RecordRelations'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'left_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'right_relations'", 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'relation_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.RelationType']"}), -            'right_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'left_relations'", 'to': "orm['archaeological_context_records.ContextRecord']"}) -        }, -        'archaeological_context_records.relationtype': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'RelationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'inverse_relation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.RelationType']", 'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'symmetrical': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'tiny_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_context_records.unit': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'Unit'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.file': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cira_advised': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'classified_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'corporation_general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'departments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_line': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_files_file'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'instruction_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'locality': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'main_town': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_main'", 'null': 'True', 'to': "orm['ishtar_common.Town']"}), -            'mh_listing': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'mh_register': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'permit_reference': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'protected_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'raw_general_contractor': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'raw_town_planning_service': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.OperationType']"}), -            'research_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'responsible_town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'responsible_town_planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'total_developed_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {'default': '30'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.basefind': { -            'Meta': {'object_name': 'BaseFind'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'batch': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.BatchType']", 'null': 'True', 'blank': 'True'}), -            'cache_complete_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cache_short_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'base_finds'", 'to': "orm['archaeological_context_records.ContextRecord']"}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'discovery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_error_x': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_error_y': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_error_z': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_basefind'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'label': ('django.db.models.fields.TextField', [], {}), -            'line': ('django.contrib.gis.db.models.fields.LineStringField', [], {'null': 'True', 'blank': 'True'}), -            'material_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'dim': '3', 'null': 'True', 'blank': 'True'}), -            'point_2d': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'polygon': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True', 'blank': 'True'}), -            'spatial_reference_system': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SpatialReferenceSystem']", 'null': 'True', 'blank': 'True'}), -            'special_interest': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'topographic_localisation': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'x': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'y': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'z': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.batchtype': { -            'Meta': {'ordering': "('order',)", 'object_name': 'BatchType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.conservatorystate': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ConservatoryState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.ConservatoryState']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.find': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'Find'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'base_finds': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.BaseFind']"}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'check_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'checked': ('django.db.models.fields.CharField', [], {'default': "'NC'", 'max_length': '2'}), -            'collection': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'finds'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['archaeological_warehouse.Collection']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'conservatory_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'conservatory_state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.ConservatoryState']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}), -            'container': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'finds'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['archaeological_warehouse.Container']"}), -            'dating_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_context_records.Dating']"}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'diameter': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'dimensions_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'upstream'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['archaeological_finds.Treatment']"}), -            'estimated_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'find_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_find'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'integrities': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.IntegrityType']"}), -            'is_complete': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.TextField', [], {}), -            'length': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'mark': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'material_types': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'finds'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.MaterialType']"}), -            'min_number_of_individuals': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'object_types': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.ObjectType']"}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preservation_to_considers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'finds'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.PreservationType']"}), -            'previous_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'remarkabilities': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.RemarkabilityType']"}), -            'thickness': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'upstream_treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'downstream'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['archaeological_finds.Treatment']"}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'weight': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'weight_unit': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.findbasket': { -            'Meta': {'unique_together': "(('label', 'user'),)", 'object_name': 'FindBasket'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'items': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'basket'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['archaeological_finds.Find']"}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '1000'}), -            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.finddownstreamtreatments': { -            'Meta': {'ordering': "('find', '-treatment_nb')", 'unique_together': "(('find', 'treatment'),)", 'object_name': 'FindDownstreamTreatments', 'db_table': "'find_downtreatments'", 'managed': 'False'}, -            'find': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'finddownstreamtreatments_related'", 'to': "orm['archaeological_finds.Find']"}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.Treatment']", 'primary_key': 'True'}), -            'treatment_nb': ('django.db.models.fields.IntegerField', [], {}) -        }, -        'archaeological_finds.findsource': { -            'Meta': {'object_name': 'FindSource'}, -            'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'findsource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'find': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.Find']"}), -            'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}) -        }, -        'archaeological_finds.findtreatments': { -            'Meta': {'ordering': "('find', 'upstream', '-treatment_nb')", 'unique_together': "(('find', 'treatment'),)", 'object_name': 'FindTreatments', 'db_table': "'find_treatments'", 'managed': 'False'}, -            'find': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'findtreatments_related'", 'to': "orm['archaeological_finds.Find']"}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.Treatment']", 'primary_key': 'True'}), -            'treatment_nb': ('django.db.models.fields.IntegerField', [], {}), -            'upstream': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) -        }, -        'archaeological_finds.findupstreamtreatments': { -            'Meta': {'ordering': "('find', '-treatment_nb')", 'unique_together': "(('find', 'treatment'),)", 'object_name': 'FindUpstreamTreatments', 'db_table': "'find_uptreatments'", 'managed': 'False'}, -            'find': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'findupstreamtreatments_related'", 'to': "orm['archaeological_finds.Find']"}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.Treatment']", 'primary_key': 'True'}), -            'treatment_nb': ('django.db.models.fields.IntegerField', [], {}) -        }, -        'archaeological_finds.historicalbasefind': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalBaseFind'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'batch_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'cache_complete_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cache_short_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'context_record_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'discovery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_error_x': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_error_y': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_error_z': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'label': ('django.db.models.fields.TextField', [], {}), -            'line': ('django.contrib.gis.db.models.fields.LineStringField', [], {'null': 'True', 'blank': 'True'}), -            'material_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'dim': '3', 'null': 'True', 'blank': 'True'}), -            'point_2d': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'polygon': ('django.contrib.gis.db.models.fields.PolygonField', [], {'null': 'True', 'blank': 'True'}), -            'spatial_reference_system_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'special_interest': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'topographic_localisation': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'x': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'y': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'z': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.historicalfind': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFind'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'check_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'checked': ('django.db.models.fields.CharField', [], {'default': "'NC'", 'max_length': '2'}), -            'collection_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'conservatory_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'conservatory_state_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'container_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'dating_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'diameter': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'dimensions_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'estimated_value': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'find_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'is_complete': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.TextField', [], {}), -            'length': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'mark': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'min_number_of_individuals': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'previous_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'thickness': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'upstream_treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'weight': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'weight_unit': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_finds.historicaltreatment': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalTreatment'}, -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'goal': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'insurance_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'location_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'organization_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'other_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'person_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'quoted_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'realized_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'target_is_basket': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'treatment_state_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.historicaltreatmentfile': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalTreatmentFile'}, -            'applicant_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'applicant_organisation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.integritytype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'IntegrityType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.materialtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'MaterialType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.MaterialType']", 'null': 'True', 'blank': 'True'}), -            'recommendation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.objecttype': { -            'Meta': {'ordering': "('parent__label', 'label')", 'object_name': 'ObjectType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.ObjectType']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.preservationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PreservationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.property': { -            'Meta': {'object_name': 'Property'}, -            'administrative_act': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.AdministrativeAct']"}), -            'end_date': ('django.db.models.fields.DateField', [], {}), -            'find': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.Find']"}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_property'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'properties'", 'to': "orm['ishtar_common.Person']"}), -            'start_date': ('django.db.models.fields.DateField', [], {}) -        }, -        'archaeological_finds.remarkabilitytype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'RemarkabilityType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatment': { -            'Meta': {'unique_together': "(('year', 'index'),)", 'object_name': 'Treatment'}, -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']", 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), -            'goal': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatment'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'insurance_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'other_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'quoted_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'realized_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'target_is_basket': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'treatment_state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentState']", 'null': 'True', 'blank': 'True'}), -            'treatment_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_finds.TreatmentType']", 'symmetrical': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.treatmentfile': { -            'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('year', 'index'),)", 'object_name': 'TreatmentFile'}, -            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_applicant'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'applicant_organisation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_applicant'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatmentfile'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentFileType']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.treatmentfilesource': { -            'Meta': {'object_name': 'TreatmentFileSource'}, -            'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'treatmentfilesource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}), -            'treatment_file': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.TreatmentFile']"}) -        }, -        'archaeological_finds.treatmentfiletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentFileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatmentsource': { -            'Meta': {'object_name': 'TreatmentSource'}, -            'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'treatmentsource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.Treatment']"}) -        }, -        'archaeological_finds.treatmentstate': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatmenttype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentType']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), -            'upstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'virtual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) -        }, -        'archaeological_operations.acttype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ActType'}, -            'associated_template': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'acttypes'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.DocumentTemplate']"}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'indexed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.administrativeact': { -            'Meta': {'ordering': "('year', 'signature_date', 'index', 'act_type')", 'object_name': 'AdministrativeAct'}, -            'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_administrativeact'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operation_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'signatory'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), -            'treatment_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.archaeologicalsite': { -            'Meta': {'object_name': 'ArchaeologicalSite'}, -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_archaeologicalsite'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'Operation'}, -            'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.ArchaeologicalSite']", 'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'cira_rapporteur': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cira_rapporteur'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'code_patriarche': ('django.db.models.fields.TextField', [], {'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'collaborators': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'operation_collaborator'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Person']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_operation'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), -            'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.OperationType']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}), -            'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'report_processing': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ReportState']", 'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_scientist_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operations'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'ordering': "('year', 'section', 'parcel_number')", 'object_name': 'Parcel'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcel'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), -            'public_domain': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.period': { -            'Meta': {'ordering': "('order',)", 'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.reportstate': { -            'Meta': {'ordering': "('order',)", 'object_name': 'ReportState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_warehouse.collection': { -            'Meta': {'ordering': "('name',)", 'object_name': 'Collection'}, -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_collection'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'collections'", 'to': "orm['archaeological_warehouse.Warehouse']"}) -        }, -        'archaeological_warehouse.container': { -            'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('index', 'location'),)", 'object_name': 'Container'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cached_location': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}), -            'responsible': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owned_containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.containertype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ContainerType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.warehouse': { -            'Meta': {'object_name': 'Warehouse'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'associated_divisions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']", 'symmetrical': 'False', 'through': "orm['archaeological_warehouse.WarehouseDivisionLink']", 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_warehouse'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'warehouse_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) -        }, -        'archaeological_warehouse.warehousedivision': { -            'Meta': {'object_name': 'WarehouseDivision'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_warehouse.warehousedivisionlink': { -            'Meta': {'ordering': "('warehouse', 'order')", 'unique_together': "(('warehouse', 'division'),)", 'object_name': 'WarehouseDivisionLink'}, -            'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}) -        }, -        'archaeological_warehouse.warehousetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'WarehouseType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'ordering': "('author_type__order', 'person__name')", 'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'ordering': "['order', 'label']", 'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}), -            'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.documenttemplate': { -            'Meta': {'ordering': "['associated_object_name', 'name']", 'object_name': 'DocumentTemplate'}, -            'associated_object_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'template': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) -        }, -        'ishtar_common.format': { -            'Meta': {'ordering': "['label']", 'object_name': 'Format'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.import': { -            'Meta': {'object_name': 'Import'}, -            'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), -            'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), -            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '220'}), -            'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '220', 'null': 'True', 'blank': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), -            'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), -            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) -        }, -        'ishtar_common.importermodel': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterModel'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'klass': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'ishtar_common.importertype': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterType'}, -            'associated_models': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.ImporterModel']"}), -            'created_models': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.ImporterModel']"}), -            'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.ishtaruser': { -            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, -            'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), -            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) -        }, -        'ishtar_common.operationtype': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'ordering': "['label']", 'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.spatialreferencesystem': { -            'Meta': {'ordering': "('label',)", 'object_name': 'SpatialReferenceSystem'}, -            'auth_name': ('django.db.models.fields.CharField', [], {'default': "'EPSG'", 'max_length': '256'}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'srid': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.state': { -            'Meta': {'ordering': "['number']", 'object_name': 'State'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.supporttype': { -            'Meta': {'object_name': 'SupportType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.titletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_town'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        } -    } - -    complete_apps = ['archaeological_finds']
\ No newline at end of file diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 4fea6edd3..c8e0ef8e2 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -37,7 +37,8 @@ from ishtar_common.models import GeneralType, ImageModel, BaseHistorizedItem, \  from archaeological_operations.models import AdministrativeAct  from archaeological_context_records.models import ContextRecord, Dating -from ishtar_common.models import PRIVATE_FIELDS, SpatialReferenceSystem +from ishtar_common.models import PRIVATE_FIELDS, SpatialReferenceSystem, \ +    BulkUpdatedItem  class MaterialType(GeneralType): @@ -147,7 +148,7 @@ class BFBulkView(object):      """ -class BaseFind(BaseHistorizedItem, OwnPerms): +class BaseFind(BulkUpdatedItem, BaseHistorizedItem, OwnPerms):      label = models.TextField(_(u"Free ID"))      external_id = models.TextField(_(u"External ID"), blank=True, null=True)      auto_external_id = models.BooleanField( @@ -198,11 +199,11 @@ class BaseFind(BaseHistorizedItem, OwnPerms):          verbose_name = _(u"Base find")          verbose_name_plural = _(u"Base finds")          permissions = ( -            ("view_basefind", ugettext(u"Can view all Base finds")), -            ("view_own_basefind", ugettext(u"Can view own Base find")), -            ("add_own_basefind", ugettext(u"Can add own Base find")), -            ("change_own_basefind", ugettext(u"Can change own Base find")), -            ("delete_own_basefind", ugettext(u"Can delete own Base find")), +            ("view_basefind", u"Can view all Base finds"), +            ("view_own_basefind", u"Can view own Base find"), +            ("add_own_basefind", u"Can add own Base find"), +            ("change_own_basefind", u"Can change own Base find"), +            ("delete_own_basefind", u"Can delete own Base find"),          )      def __unicode__(self): @@ -349,7 +350,12 @@ class BaseFind(BaseHistorizedItem, OwnPerms):      @classmethod      def cached_label_bulk_update(cls, operation_id=None, parcel_id=None, -                                 context_record_id=None): +                                 context_record_id=None, transaction_id=None): +        transaction_id, is_recursion = cls.bulk_recursion( +            transaction_id, [operation_id, parcel_id, context_record_id]) +        if is_recursion: +            return +          if operation_id:              filters = """              INNER JOIN archaeological_context_records_contextrecord acr @@ -372,6 +378,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms):              kwargs = {'context_record_id': context_record_id}          else:              return +        kwargs['transaction_id'] = transaction_id          sql = """          UPDATE "archaeological_finds_basefind" AS bf @@ -449,12 +456,9 @@ class BaseFind(BaseHistorizedItem, OwnPerms):                     ope_prefix=settings.ISHTAR_DEF_OPE_PREFIX,                     join=settings.JOINT, filters=filters,                     zeros=settings.ISHTAR_FINDS_INDEX_ZERO_LEN * "0") -        # with connection.cursor() as c:  # django 1.8 -        c = connection.cursor() -        c.execute(sql, args) -        transaction.commit_unless_managed() -        cls._meta.get_field_by_name( -            'find')[0].model.cached_label_bulk_update(**kwargs) +        with connection.cursor() as c: +            c.execute(sql, args) +        Find.cached_label_bulk_update(**kwargs)  post_save.connect(post_save_point, sender=BaseFind) @@ -469,8 +473,7 @@ CHECK_CHOICES = (('NC', _(u"Not checked")),  class FindBasket(Basket): -    items = models.ManyToManyField('Find', blank=True, null=True, -                                   related_name='basket') +    items = models.ManyToManyField('Find', blank=True, related_name='basket')  class FirstBaseFindView(object): @@ -509,8 +512,8 @@ class FBulkView(object):      """ -class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms, -           ShortMenuItem): +class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel, +           OwnPerms, ShortMenuItem):      CHECK_DICT = dict(CHECK_CHOICES)      SHOW_URL = 'show-find'      SLUG = 'find' @@ -687,7 +690,7 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms,                                        null=True)      previous_id = models.TextField(_(u"Previous ID"), blank=True, null=True)      index = models.IntegerField(u"Index", default=0) -    checked = models.CharField(_(u"Check"), max_length=2, default='NC', +    checked = models.CharField(_(u"Check"), max_length=2, default=u'NC',                                 choices=CHECK_CHOICES)      check_date = models.DateField(_(u"Check date"),                                    default=datetime.date.today) @@ -705,11 +708,11 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms,          verbose_name = _(u"Find")          verbose_name_plural = _(u"Finds")          permissions = ( -            ("view_find", ugettext(u"Can view all Finds")), -            ("view_own_find", ugettext(u"Can view own Find")), -            ("add_own_find", ugettext(u"Can add own Find")), -            ("change_own_find", ugettext(u"Can change own Find")), -            ("delete_own_find", ugettext(u"Can delete own Find")), +            ("view_find", u"Can view all Finds"), +            ("view_own_find", u"Can view own Find"), +            ("add_own_find", u"Can add own Find"), +            ("change_own_find", u"Can change own Find"), +            ("delete_own_find", u"Can delete own Find"),          )          ordering = ('cached_label',) @@ -908,14 +911,14 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms,          return new      @classmethod -    def get_query_owns(cls, user): -        return (Q(base_finds__context_record__operation__scientist=user. +    def get_query_owns(cls, ishtaruser): +        return (Q(base_finds__context_record__operation__scientist=                   ishtaruser.person) | -                Q(base_finds__context_record__operation__in_charge=user. +                Q(base_finds__context_record__operation__in_charge=                    ishtaruser.person) | -                Q(base_finds__context_record__operation__collaborators__pk=user. +                Q(base_finds__context_record__operation__collaborators__pk=                    ishtaruser.person.pk) | -                Q(history_creator=user)) \ +                Q(history_creator=ishtaruser.user_ptr)) \             & Q(base_finds__context_record__operation__end_date__isnull=True)      @classmethod @@ -936,7 +939,12 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms,      @classmethod      def cached_label_bulk_update(cls, operation_id=None, parcel_id=None, -                                 context_record_id=None): +                                 context_record_id=None, transaction_id=None): +        transaction_id, is_recursion = cls.bulk_recursion( +            transaction_id, [operation_id, parcel_id, context_record_id]) +        if is_recursion: +            return +          if operation_id:              filters = """              INNER JOIN find_first_base_find myfbf @@ -1006,10 +1014,8 @@ class Find(ValueGetter, BaseHistorizedItem, ImageModel, OwnPerms,                     ope_prefix=settings.ISHTAR_DEF_OPE_PREFIX,                     join=settings.JOINT, filters=filters,                     zeros=settings.ISHTAR_FINDS_INDEX_ZERO_LEN * "0") -        # with connection.cursor() as c:  # django 1.8 -        c = connection.cursor() -        c.execute(sql, args) -        transaction.commit_unless_managed() +        with connection.cursor() as c: +            c.execute(sql, args)      def generate_index(self):          """ @@ -1147,15 +1153,15 @@ class FindSource(Source):          verbose_name_plural = _(u"Find documentations")          permissions = (              ("view_findsource", -             ugettext(u"Can view all Find sources")), +             u"Can view all Find sources"),              ("view_own_findsource", -             ugettext(u"Can view own Find source")), +             u"Can view own Find source"),              ("add_own_findsource", -             ugettext(u"Can add own Find source")), +             u"Can add own Find source"),              ("change_own_findsource", -             ugettext(u"Can change own Find source")), +             u"Can change own Find source"),              ("delete_own_findsource", -             ugettext(u"Can delete own Find source")), +             u"Can delete own Find source"),          )      find = models.ForeignKey(Find, verbose_name=_(u"Find"),                               related_name="source") @@ -1165,13 +1171,13 @@ class FindSource(Source):          return self.find      @classmethod -    def get_query_owns(cls, user): -        return (Q(find__base_finds__context_record__operation__scientist=user. +    def get_query_owns(cls, ishtaruser): +        return (Q(find__base_finds__context_record__operation__scientist=                    ishtaruser.person) | -                Q(find__base_finds__context_record__operation__in_charge=user. +                Q(find__base_finds__context_record__operation__in_charge=                    ishtaruser.person) |                  Q( -            find__base_finds__context_record__operation__collaborators__pk=user. +            find__base_finds__context_record__operation__collaborators__pk=              ishtaruser.person.pk)) \                 & Q(              find__base_finds__context_record__operation__end_date__isnull=True) diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 47f60bb44..d1b1afd4b 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -27,7 +27,7 @@ from django.template.defaultfilters import slugify  from django.utils.translation import ugettext_lazy as _, ugettext -from ishtar_common.utils import cached_label_changed +from ishtar_common.utils import cached_label_changed, get_current_year  from ishtar_common.models import GeneralType, ImageModel, BaseHistorizedItem, \      OwnPerms, HistoricalRecords, Person, Organization, Source, \      ValueGetter, post_save_cache, ShortMenuItem, DashboardFormItem @@ -100,8 +100,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,                               max_length=200)      other_reference = models.CharField(_(u"Other ref."), blank=True, null=True,                                         max_length=200) -    year = models.IntegerField(_(u"Year"), -                               default=lambda: datetime.datetime.now().year) +    year = models.IntegerField(_(u"Year"), default=get_current_year)      index = models.IntegerField(_(u"Index"), default=1)      file = models.ForeignKey(          'TreatmentFile', related_name='treatments', blank=True, null=True, @@ -149,11 +148,11 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,          verbose_name_plural = _(u"Treatments")          unique_together = ('year', 'index')          permissions = ( -            ("view_treatment", ugettext(u"Can view all Treatments")), -            ("view_own_treatment", ugettext(u"Can view own Treatment")), -            ("add_own_treatment", ugettext(u"Can add own Treatment")), -            ("change_own_treatment", ugettext(u"Can change own Treatment")), -            ("delete_own_treatment", ugettext(u"Can delete own Treatment")), +            ("view_treatment", u"Can view all Treatments"), +            ("view_own_treatment", u"Can view own Treatment"), +            ("add_own_treatment", u"Can add own Treatment"), +            ("change_own_treatment", u"Can change own Treatment"), +            ("delete_own_treatment", u"Can delete own Treatment"),          )      def __unicode__(self): @@ -168,9 +167,9 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,          return _(u"TREATMENT")      @classmethod -    def get_query_owns(cls, user): -        return (Q(history_creator=user) | -                Q(person__ishtaruser=user.ishtaruser)) \ +    def get_query_owns(cls, ishtaruser): +        return (Q(history_creator=ishtaruser.user_ptr) | +                Q(person__ishtaruser=ishtaruser)) \              & Q(end_date__isnull=True)      @classmethod @@ -297,8 +296,8 @@ pre_delete.connect(pre_delete_treatment, sender=Treatment)  class AbsFindTreatments(models.Model):      find = models.ForeignKey(Find, verbose_name=_(u"Find"),                               related_name='%(class)s_related') -    treatment = models.ForeignKey(Treatment, verbose_name=_(u"Treatment"), -                                  primary_key=True) +    treatment = models.OneToOneField(Treatment, verbose_name=_(u"Treatment"), +                                     primary_key=True)      # primary_key is set to prevent django to ask for an id column      # treatment is not a primary key      treatment_nb = models.IntegerField(_(u"Order")) @@ -480,8 +479,7 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem,      SLUG = 'treatmentfile'      # fields -    year = models.IntegerField(_(u"Year"), -                               default=lambda: datetime.datetime.now().year) +    year = models.IntegerField(_(u"Year"), default=get_current_year)      index = models.IntegerField(_(u"Index"), default=1)      internal_reference = models.CharField(_(u"Internal reference"), blank=True,                                            null=True, max_length=200) @@ -518,21 +516,21 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem,          unique_together = ('year', 'index')          permissions = (              ("view_filetreatment", -             ugettext(u"Can view all Treatment requests")), +             u"Can view all Treatment requests"),              ("add_filetreatment", -             ugettext(u"Can add Treatment request")), +             u"Can add Treatment request"),              ("change_filetreatment", -             ugettext(u"Can change Treatment request")), +             u"Can change Treatment request"),              ("delete_filetreatment", -             ugettext(u"Can delete Treatment request")), +             u"Can delete Treatment request"),              ("view_own_filetreatment", -             ugettext(u"Can view own Treatment request")), +             u"Can view own Treatment request"),              ("add_own_filetreatment", -             ugettext(u"Can add own Treatment request")), +             u"Can add own Treatment request"),              ("change_own_filetreatment", -             ugettext(u"Can change own Treatment request")), +             u"Can change own Treatment request"),              ("delete_own_filetreatment", -             ugettext(u"Can delete own Treatment request")), +             u"Can delete own Treatment request"),          )          ordering = ('cached_label',) @@ -544,9 +542,9 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem,          return _(u"Treatment request")      @classmethod -    def get_query_owns(cls, user): -        return (Q(history_creator=user) | -                Q(in_charge__ishtaruser=user.ishtaruser)) \ +    def get_query_owns(cls, ishtaruser): +        return (Q(history_creator=ishtaruser.user_ptr) | +                Q(in_charge__ishtaruser=ishtaruser)) \              & Q(end_date__isnull=True)      @property @@ -598,15 +596,15 @@ class TreatmentSource(Source):          verbose_name_plural = _(u"Treament documentations")          permissions = (              ("view_treatmentsource", -             ugettext(u"Can view all Treatment sources")), +             u"Can view all Treatment sources"),              ("view_own_treatmentsource", -             ugettext(u"Can view own Treatment source")), +             u"Can view own Treatment source"),              ("add_own_treatmentsource", -             ugettext(u"Can add own Treatment source")), +             u"Can add own Treatment source"),              ("change_own_treatmentsource", -             ugettext(u"Can change own Treatment source")), +             u"Can change own Treatment source"),              ("delete_own_treatmentsource", -             ugettext(u"Can delete own Treatment source")), +             u"Can delete own Treatment source"),          )      @property @@ -628,15 +626,15 @@ class TreatmentFileSource(Source):          verbose_name_plural = _(u"Treatment request documentations")          permissions = (              ("view_filetreatmentsource", -             ugettext(u"Can view Treatment request source")), +             u"Can view Treatment request source"),              ("view_own_filetreatmentsource", -             ugettext(u"Can view own Treatment request source")), +             u"Can view own Treatment request source"),              ("add_own_filetreatmentsource", -             ugettext(u"Can add own Treatment request source")), +             u"Can add own Treatment request source"),              ("change_own_filetreatmentsource", -             ugettext(u"Can change own Treatment request source")), +             u"Can change own Treatment request source"),              ("delete_own_filetreatmentsource", -             ugettext(u"Can delete own Treatment request source")), +             u"Can delete own Treatment request source"),          )      @property diff --git a/archaeological_finds/old_migrations/0001_initial.py b/archaeological_finds/old_migrations/0001_initial.py new file mode 100644 index 000000000..d5f3e804a --- /dev/null +++ b/archaeological_finds/old_migrations/0001_initial.py @@ -0,0 +1,814 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + +    depends_on = ( +        ('archaeological_context_records', '0001_initial.py'), +        ('archaeological_warehouse', +         '0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py'), +    ) + +    def forwards(self, orm): +        # Adding model 'MaterialType' +        db.create_table('archaeological_finds_materialtype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('recommendation', self.gf('django.db.models.fields.TextField')()), +            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.MaterialType'], null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_finds', ['MaterialType']) + +        # Adding model 'HistoricalBaseFind' +        db.create_table('archaeological_finds_historicalbasefind', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), +            ('description', self.gf('django.db.models.fields.TextField')()), +            ('context_record_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('is_isolated', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('index', self.gf('django.db.models.fields.IntegerField')(default=0)), +            ('material_index', self.gf('django.db.models.fields.IntegerField')(default=0)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_finds', ['HistoricalBaseFind']) + +        # Adding model 'BaseFind' +        db.create_table('archaeological_finds_basefind', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), +            ('description', self.gf('django.db.models.fields.TextField')()), +            ('context_record', self.gf('django.db.models.fields.related.ForeignKey')(related_name='base_finds', to=orm['archaeological_context_records.ContextRecord'])), +            ('is_isolated', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('index', self.gf('django.db.models.fields.IntegerField')(default=0)), +            ('material_index', self.gf('django.db.models.fields.IntegerField')(default=0)), +        )) +        db.send_create_signal('archaeological_finds', ['BaseFind']) + +        # Adding model 'HistoricalFind' +        db.create_table('archaeological_finds_historicalfind', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), +            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('material_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('volume', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), +            ('weight', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), +            ('find_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('upstream_treatment_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('downstream_treatment_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('dating_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('container_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_finds', ['HistoricalFind']) + +        # Adding model 'Find' +        db.create_table('archaeological_finds_find', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=60)), +            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('material_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.MaterialType'])), +            ('volume', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), +            ('weight', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), +            ('find_number', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('upstream_treatment', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='downstream_treatment', null=True, to=orm['archaeological_finds.Treatment'])), +            ('downstream_treatment', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='upstream_treatment', null=True, to=orm['archaeological_finds.Treatment'])), +            ('dating', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.Dating'])), +            ('container', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='finds', null=True, to=orm['archaeological_warehouse.Container'])), +        )) +        db.send_create_signal('archaeological_finds', ['Find']) + +        # Adding M2M table for field base_finds on 'Find' +        db.create_table('archaeological_finds_find_base_finds', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('find', models.ForeignKey(orm['archaeological_finds.find'], null=False)), +            ('basefind', models.ForeignKey(orm['archaeological_finds.basefind'], null=False)) +        )) +        db.create_unique('archaeological_finds_find_base_finds', ['find_id', 'basefind_id']) + +        # Adding model 'FindSource' +        db.create_table('archaeological_finds_findsource', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), +            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), +            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('find', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_finds.Find'])), +        )) +        db.send_create_signal('archaeological_finds', ['FindSource']) + +        # Adding M2M table for field authors on 'FindSource' +        db.create_table('archaeological_finds_findsource_authors', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('findsource', models.ForeignKey(orm['archaeological_finds.findsource'], null=False)), +            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) +        )) +        db.create_unique('archaeological_finds_findsource_authors', ['findsource_id', 'author_id']) + +        # Adding model 'TreatmentType' +        db.create_table('archaeological_finds_treatmenttype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('virtual', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_finds', ['TreatmentType']) + +        # Adding model 'HistoricalTreatment' +        db.create_table('archaeological_finds_historicaltreatment', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('container_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('treatment_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('location_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('person_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_finds', ['HistoricalTreatment']) + +        # Adding model 'Treatment' +        db.create_table('archaeological_finds_treatment', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('container', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.Container'], null=True, blank=True)), +            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('treatment_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.TreatmentType'])), +            ('location', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.Warehouse'], null=True, blank=True)), +            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'], null=True, blank=True)), +            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_finds', ['Treatment']) + +        # Adding model 'TreatmentSource' +        db.create_table('archaeological_finds_treatmentsource', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), +            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), +            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('treatment', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_finds.Treatment'])), +        )) +        db.send_create_signal('archaeological_finds', ['TreatmentSource']) + +        # Adding M2M table for field authors on 'TreatmentSource' +        db.create_table('archaeological_finds_treatmentsource_authors', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('treatmentsource', models.ForeignKey(orm['archaeological_finds.treatmentsource'], null=False)), +            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) +        )) +        db.create_unique('archaeological_finds_treatmentsource_authors', ['treatmentsource_id', 'author_id']) + +        # Adding model 'Property' +        db.create_table('archaeological_finds_property', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), +            ('find', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_finds.Find'])), +            ('administrative_act', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.AdministrativeAct'])), +            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])), +            ('start_date', self.gf('django.db.models.fields.DateField')()), +            ('end_date', self.gf('django.db.models.fields.DateField')()), +        )) +        db.send_create_signal('archaeological_finds', ['Property']) + + +    def backwards(self, orm): +        # Deleting model 'MaterialType' +        db.delete_table('archaeological_finds_materialtype') + +        # Deleting model 'HistoricalBaseFind' +        db.delete_table('archaeological_finds_historicalbasefind') + +        # Deleting model 'BaseFind' +        db.delete_table('archaeological_finds_basefind') + +        # Deleting model 'HistoricalFind' +        db.delete_table('archaeological_finds_historicalfind') + +        # Deleting model 'Find' +        db.delete_table('archaeological_finds_find') + +        # Removing M2M table for field base_finds on 'Find' +        db.delete_table('archaeological_finds_find_base_finds') + +        # Deleting model 'FindSource' +        db.delete_table('archaeological_finds_findsource') + +        # Removing M2M table for field authors on 'FindSource' +        db.delete_table('archaeological_finds_findsource_authors') + +        # Deleting model 'TreatmentType' +        db.delete_table('archaeological_finds_treatmenttype') + +        # Deleting model 'HistoricalTreatment' +        db.delete_table('archaeological_finds_historicaltreatment') + +        # Deleting model 'Treatment' +        db.delete_table('archaeological_finds_treatment') + +        # Deleting model 'TreatmentSource' +        db.delete_table('archaeological_finds_treatmentsource') + +        # Removing M2M table for field authors on 'TreatmentSource' +        db.delete_table('archaeological_finds_treatmentsource_authors') + +        # Deleting model 'Property' +        db.delete_table('archaeological_finds_property') + + +    models = { +        'archaeological_context_records.activitytype': { +            'Meta': {'object_name': 'ActivityType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.contextrecord': { +            'Meta': {'object_name': 'ContextRecord'}, +            'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}), +            'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}), +            'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}), +            'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}), +            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Parcel']"}), +            'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}), +            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_context_records.dating': { +            'Meta': {'object_name': 'Dating'}, +            'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}), +            'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_context_records.datingquality': { +            'Meta': {'object_name': 'DatingQuality'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.datingtype': { +            'Meta': {'object_name': 'DatingType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.identificationtype': { +            'Meta': {'object_name': 'IdentificationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_context_records.unit': { +            'Meta': {'object_name': 'Unit'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.file': { +            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), +            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), +            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), +            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), +            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), +            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), +            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), +            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) +        }, +        'archaeological_files.filetype': { +            'Meta': {'object_name': 'FileType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.permittype': { +            'Meta': {'object_name': 'PermitType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.saisinetype': { +            'Meta': {'object_name': 'SaisineType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'delay': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_finds.basefind': { +            'Meta': {'object_name': 'BaseFind'}, +            'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'base_finds'", 'to': "orm['archaeological_context_records.ContextRecord']"}), +            'description': ('django.db.models.fields.TextField', [], {}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), +            'is_isolated': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), +            'material_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}) +        }, +        'archaeological_finds.find': { +            'Meta': {'object_name': 'Find'}, +            'base_finds': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.BaseFind']"}), +            'container': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'finds'", 'null': 'True', 'to': "orm['archaeological_warehouse.Container']"}), +            'dating': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Dating']"}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'downstream_treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'upstream_treatment'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), +            'find_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), +            'material_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.MaterialType']"}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'upstream_treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'downstream_treatment'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), +            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), +            'weight': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_finds.findsource': { +            'Meta': {'object_name': 'FindSource'}, +            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'find': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.Find']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) +        }, +        'archaeological_finds.historicalbasefind': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalBaseFind'}, +            'context_record_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), +            'is_isolated': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), +            'material_index': ('django.db.models.fields.IntegerField', [], {'default': '0'}) +        }, +        'archaeological_finds.historicalfind': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFind'}, +            'container_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'dating_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'downstream_treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'find_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '60'}), +            'material_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'upstream_treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), +            'weight': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_finds.historicaltreatment': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalTreatment'}, +            'container_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'location_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'person_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'treatment_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_finds.materialtype': { +            'Meta': {'object_name': 'MaterialType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.MaterialType']", 'null': 'True', 'blank': 'True'}), +            'recommendation': ('django.db.models.fields.TextField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_finds.property': { +            'Meta': {'object_name': 'Property'}, +            'administrative_act': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.AdministrativeAct']"}), +            'end_date': ('django.db.models.fields.DateField', [], {}), +            'find': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.Find']"}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}), +            'start_date': ('django.db.models.fields.DateField', [], {}) +        }, +        'archaeological_finds.treatment': { +            'Meta': {'object_name': 'Treatment'}, +            'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']", 'null': 'True', 'blank': 'True'}), +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}), +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'treatment_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentType']"}) +        }, +        'archaeological_finds.treatmentsource': { +            'Meta': {'object_name': 'TreatmentSource'}, +            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_finds.Treatment']"}) +        }, +        'archaeological_finds.treatmenttype': { +            'Meta': {'object_name': 'TreatmentType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), +            'virtual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) +        }, +        'archaeological_operations.acttype': { +            'Meta': {'object_name': 'ActType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.administrativeact': { +            'Meta': {'object_name': 'AdministrativeAct'}, +            'act_object': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), +            'operator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15'}), +            'scientific': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.operation': { +            'Meta': {'object_name': 'Operation'}, +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), +            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), +            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'operation_code': ('django.db.models.fields.IntegerField', [], {}), +            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}), +            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), +            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}), +            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}), +            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}), +            'year': ('django.db.models.fields.IntegerField', [], {}), +            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.operationtype': { +            'Meta': {'object_name': 'OperationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.parcel': { +            'Meta': {'object_name': 'Parcel'}, +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), +            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}), +            'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}), +            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.period': { +            'Meta': {'object_name': 'Period'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.remaintype': { +            'Meta': {'object_name': 'RemainType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_warehouse.container': { +            'Meta': {'object_name': 'Container'}, +            'comment': ('django.db.models.fields.TextField', [], {}), +            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}), +            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) +        }, +        'archaeological_warehouse.containertype': { +            'Meta': {'object_name': 'ContainerType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), +            'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_warehouse.warehouse': { +            'Meta': {'object_name': 'Warehouse'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), +            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'null': 'True', 'blank': 'True'}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) +        }, +        'archaeological_warehouse.warehousetype': { +            'Meta': {'object_name': 'WarehouseType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'auth.group': { +            'Meta': {'object_name': 'Group'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), +            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) +        }, +        'auth.permission': { +            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, +            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) +        }, +        'auth.user': { +            'Meta': {'object_name': 'User'}, +            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), +            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), +            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), +            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'contenttypes.contenttype': { +            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, +            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) +        }, +        'ishtar_common.arrondissement': { +            'Meta': {'object_name': 'Arrondissement'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.author': { +            'Meta': {'object_name': 'Author'}, +            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) +        }, +        'ishtar_common.authortype': { +            'Meta': {'object_name': 'AuthorType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.canton': { +            'Meta': {'object_name': 'Canton'}, +            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.department': { +            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) +        }, +        'ishtar_common.organization': { +            'Meta': {'object_name': 'Organization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.organizationtype': { +            'Meta': {'object_name': 'OrganizationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.person': { +            'Meta': {'object_name': 'Person'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.persontype': { +            'Meta': {'object_name': 'PersonType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.sourcetype': { +            'Meta': {'object_name': 'SourceType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.town': { +            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, +            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), +            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), +            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.wizard': { +            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) +        }, +        'ishtar_common.wizardstep': { +            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) +        } +    } + +    complete_apps = ['archaeological_finds'] diff --git a/archaeological_finds/migrations/0002_auto__add_field_findsource_reference__add_field_findsource_internal_re.py b/archaeological_finds/old_migrations/0002_auto__add_field_findsource_reference__add_field_findsource_internal_re.py index b98515edc..b98515edc 100644 --- a/archaeological_finds/migrations/0002_auto__add_field_findsource_reference__add_field_findsource_internal_re.py +++ b/archaeological_finds/old_migrations/0002_auto__add_field_findsource_reference__add_field_findsource_internal_re.py diff --git a/archaeological_finds/migrations/0003_auto__add_field_materialtype_code.py b/archaeological_finds/old_migrations/0003_auto__add_field_materialtype_code.py index 76b84a4bb..76b84a4bb 100644 --- a/archaeological_finds/migrations/0003_auto__add_field_materialtype_code.py +++ b/archaeological_finds/old_migrations/0003_auto__add_field_materialtype_code.py diff --git a/archaeological_finds/migrations/0004_auto__add_field_historicalfind_image__add_field_historicalfind_thumbna.py b/archaeological_finds/old_migrations/0004_auto__add_field_historicalfind_image__add_field_historicalfind_thumbna.py index d849b9e92..d849b9e92 100644 --- a/archaeological_finds/migrations/0004_auto__add_field_historicalfind_image__add_field_historicalfind_thumbna.py +++ b/archaeological_finds/old_migrations/0004_auto__add_field_historicalfind_image__add_field_historicalfind_thumbna.py diff --git a/archaeological_finds/migrations/0005_auto__add_conservatorystate__add_field_historicalfind_conservatory_sta.py b/archaeological_finds/old_migrations/0005_auto__add_conservatorystate__add_field_historicalfind_conservatory_sta.py index 9ad323a70..9ad323a70 100644 --- a/archaeological_finds/migrations/0005_auto__add_conservatorystate__add_field_historicalfind_conservatory_sta.py +++ b/archaeological_finds/old_migrations/0005_auto__add_conservatorystate__add_field_historicalfind_conservatory_sta.py diff --git a/archaeological_finds/migrations/0006_auto__add_field_historicalfind_history_creator_id__add_field_treatment.py b/archaeological_finds/old_migrations/0006_auto__add_field_historicalfind_history_creator_id__add_field_treatment.py index 11ec0c4f3..11ec0c4f3 100644 --- a/archaeological_finds/migrations/0006_auto__add_field_historicalfind_history_creator_id__add_field_treatment.py +++ b/archaeological_finds/old_migrations/0006_auto__add_field_historicalfind_history_creator_id__add_field_treatment.py diff --git a/archaeological_finds/migrations/0007_init_history_creator.py b/archaeological_finds/old_migrations/0007_init_history_creator.py index 8d0a5a583..8d0a5a583 100644 --- a/archaeological_finds/migrations/0007_init_history_creator.py +++ b/archaeological_finds/old_migrations/0007_init_history_creator.py diff --git a/archaeological_finds/migrations/0008_reinit_history_creator.py b/archaeological_finds/old_migrations/0008_reinit_history_creator.py index 38c05050e..38c05050e 100644 --- a/archaeological_finds/migrations/0008_reinit_history_creator.py +++ b/archaeological_finds/old_migrations/0008_reinit_history_creator.py diff --git a/archaeological_finds/migrations/0009_auto__chg_field_materialtype_recommendation__chg_field_treatment_perso.py b/archaeological_finds/old_migrations/0009_auto__chg_field_materialtype_recommendation__chg_field_treatment_perso.py index e2998e4a6..e2998e4a6 100644 --- a/archaeological_finds/migrations/0009_auto__chg_field_materialtype_recommendation__chg_field_treatment_perso.py +++ b/archaeological_finds/old_migrations/0009_auto__chg_field_materialtype_recommendation__chg_field_treatment_perso.py diff --git a/archaeological_finds/migrations/0010_auto__chg_field_treatment_history_creator__chg_field_treatment_history.py b/archaeological_finds/old_migrations/0010_auto__chg_field_treatment_history_creator__chg_field_treatment_history.py index 5067e113a..5067e113a 100644 --- a/archaeological_finds/migrations/0010_auto__chg_field_treatment_history_creator__chg_field_treatment_history.py +++ b/archaeological_finds/old_migrations/0010_auto__chg_field_treatment_history_creator__chg_field_treatment_history.py diff --git a/archaeological_finds/migrations/0011_auto__add_field_historicalfind_weight_unit__add_field_historicalfind_d.py b/archaeological_finds/old_migrations/0011_auto__add_field_historicalfind_weight_unit__add_field_historicalfind_d.py index 259f7e272..259f7e272 100644 --- a/archaeological_finds/migrations/0011_auto__add_field_historicalfind_weight_unit__add_field_historicalfind_d.py +++ b/archaeological_finds/old_migrations/0011_auto__add_field_historicalfind_weight_unit__add_field_historicalfind_d.py diff --git a/archaeological_finds/migrations/0012_auto__add_preservationtype__add_field_historicalfind_preservation_to_c.py b/archaeological_finds/old_migrations/0012_auto__add_preservationtype__add_field_historicalfind_preservation_to_c.py index 2604104d0..2604104d0 100644 --- a/archaeological_finds/migrations/0012_auto__add_preservationtype__add_field_historicalfind_preservation_to_c.py +++ b/archaeological_finds/old_migrations/0012_auto__add_preservationtype__add_field_historicalfind_preservation_to_c.py diff --git a/archaeological_finds/migrations/0013_auto__del_field_historicalfind_discovery_date__del_field_find_discover.py b/archaeological_finds/old_migrations/0013_auto__del_field_historicalfind_discovery_date__del_field_find_discover.py index 32d97b8fa..32d97b8fa 100644 --- a/archaeological_finds/migrations/0013_auto__del_field_historicalfind_discovery_date__del_field_find_discover.py +++ b/archaeological_finds/old_migrations/0013_auto__del_field_historicalfind_discovery_date__del_field_find_discover.py diff --git a/archaeological_finds/migrations/0014_auto__chg_field_find_dating.py b/archaeological_finds/old_migrations/0014_auto__chg_field_find_dating.py index 563f1c7cc..563f1c7cc 100644 --- a/archaeological_finds/migrations/0014_auto__chg_field_find_dating.py +++ b/archaeological_finds/old_migrations/0014_auto__chg_field_find_dating.py diff --git a/archaeological_finds/migrations/0015_auto__add_field_historicalfind_external_id__add_field_find_external_id.py b/archaeological_finds/old_migrations/0015_auto__add_field_historicalfind_external_id__add_field_find_external_id.py index 24aedfc1e..24aedfc1e 100644 --- a/archaeological_finds/migrations/0015_auto__add_field_historicalfind_external_id__add_field_find_external_id.py +++ b/archaeological_finds/old_migrations/0015_auto__add_field_historicalfind_external_id__add_field_find_external_id.py diff --git a/archaeological_finds/migrations/0016_auto__add_field_treatment_external_id__add_field_historicaltreatment_e.py b/archaeological_finds/old_migrations/0016_auto__add_field_treatment_external_id__add_field_historicaltreatment_e.py index ebb8c209b..ebb8c209b 100644 --- a/archaeological_finds/migrations/0016_auto__add_field_treatment_external_id__add_field_historicaltreatment_e.py +++ b/archaeological_finds/old_migrations/0016_auto__add_field_treatment_external_id__add_field_historicaltreatment_e.py diff --git a/archaeological_finds/migrations/0017_auto__add_field_findsource_external_id__add_field_treatmentsource_exte.py b/archaeological_finds/old_migrations/0017_auto__add_field_findsource_external_id__add_field_treatmentsource_exte.py index ddfcb927e..ddfcb927e 100644 --- a/archaeological_finds/migrations/0017_auto__add_field_findsource_external_id__add_field_treatmentsource_exte.py +++ b/archaeological_finds/old_migrations/0017_auto__add_field_findsource_external_id__add_field_treatmentsource_exte.py diff --git a/archaeological_finds/migrations/0018_auto.py b/archaeological_finds/old_migrations/0018_auto.py index 8ab73cf57..8ab73cf57 100644 --- a/archaeological_finds/migrations/0018_auto.py +++ b/archaeological_finds/old_migrations/0018_auto.py diff --git a/archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py b/archaeological_finds/old_migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py index 56331ba2a..56331ba2a 100644 --- a/archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py +++ b/archaeological_finds/old_migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py diff --git a/archaeological_finds/migrations/0020_auto__chg_field_historicalfind_weight_unit__chg_field_find_weight_unit.py b/archaeological_finds/old_migrations/0020_auto__chg_field_historicalfind_weight_unit__chg_field_find_weight_unit.py index 44ee3d608..44ee3d608 100644 --- a/archaeological_finds/migrations/0020_auto__chg_field_historicalfind_weight_unit__chg_field_find_weight_unit.py +++ b/archaeological_finds/old_migrations/0020_auto__chg_field_historicalfind_weight_unit__chg_field_find_weight_unit.py diff --git a/archaeological_finds/migrations/0021_auto__add_objecttype__add_field_historicalfind_is_complete__add_field_.py b/archaeological_finds/old_migrations/0021_auto__add_objecttype__add_field_historicalfind_is_complete__add_field_.py index 739266877..739266877 100644 --- a/archaeological_finds/migrations/0021_auto__add_objecttype__add_field_historicalfind_is_complete__add_field_.py +++ b/archaeological_finds/old_migrations/0021_auto__add_objecttype__add_field_historicalfind_is_complete__add_field_.py diff --git a/archaeological_finds/migrations/0022_auto__add_field_objecttype_parent.py b/archaeological_finds/old_migrations/0022_auto__add_field_objecttype_parent.py index deff19871..deff19871 100644 --- a/archaeological_finds/migrations/0022_auto__add_field_objecttype_parent.py +++ b/archaeological_finds/old_migrations/0022_auto__add_field_objecttype_parent.py diff --git a/archaeological_finds/migrations/0023_auto__del_field_historicalfind_heigth__add_field_historicalfind_height.py b/archaeological_finds/old_migrations/0023_auto__del_field_historicalfind_heigth__add_field_historicalfind_height.py index 74fc5a8f1..74fc5a8f1 100644 --- a/archaeological_finds/migrations/0023_auto__del_field_historicalfind_heigth__add_field_historicalfind_height.py +++ b/archaeological_finds/old_migrations/0023_auto__del_field_historicalfind_heigth__add_field_historicalfind_height.py diff --git a/archaeological_finds/migrations/0024_auto.py b/archaeological_finds/old_migrations/0024_auto.py index 5a64c5142..5a64c5142 100644 --- a/archaeological_finds/migrations/0024_auto.py +++ b/archaeological_finds/old_migrations/0024_auto.py diff --git a/archaeological_finds/migrations/0025_find_to_finds.py b/archaeological_finds/old_migrations/0025_find_to_finds.py index 30df3b583..30df3b583 100644 --- a/archaeological_finds/migrations/0025_find_to_finds.py +++ b/archaeological_finds/old_migrations/0025_find_to_finds.py diff --git a/archaeological_finds/migrations/0026_auto__del_field_historicalfind_material_type_id__del_field_find_materi.py b/archaeological_finds/old_migrations/0026_auto__del_field_historicalfind_material_type_id__del_field_find_materi.py index ad2471900..ad2471900 100644 --- a/archaeological_finds/migrations/0026_auto__del_field_historicalfind_material_type_id__del_field_find_materi.py +++ b/archaeological_finds/old_migrations/0026_auto__del_field_historicalfind_material_type_id__del_field_find_materi.py diff --git a/archaeological_finds/migrations/0027_auto__add_field_historicalfind_index__add_field_find_index.py b/archaeological_finds/old_migrations/0027_auto__add_field_historicalfind_index__add_field_find_index.py index b1457bd39..b1457bd39 100644 --- a/archaeological_finds/migrations/0027_auto__add_field_historicalfind_index__add_field_find_index.py +++ b/archaeological_finds/old_migrations/0027_auto__add_field_historicalfind_index__add_field_find_index.py diff --git a/archaeological_finds/migrations/0028_auto.py b/archaeological_finds/old_migrations/0028_auto.py index a74e99f50..a74e99f50 100644 --- a/archaeological_finds/migrations/0028_auto.py +++ b/archaeological_finds/old_migrations/0028_auto.py diff --git a/archaeological_finds/migrations/0029_dating_to_datings.py b/archaeological_finds/old_migrations/0029_dating_to_datings.py index a8af268f1..a8af268f1 100644 --- a/archaeological_finds/migrations/0029_dating_to_datings.py +++ b/archaeological_finds/old_migrations/0029_dating_to_datings.py diff --git a/archaeological_finds/migrations/0030_auto__del_field_historicalfind_dating_id__del_field_find_dating.py b/archaeological_finds/old_migrations/0030_auto__del_field_historicalfind_dating_id__del_field_find_dating.py index 08a05efbc..08a05efbc 100644 --- a/archaeological_finds/migrations/0030_auto__del_field_historicalfind_dating_id__del_field_find_dating.py +++ b/archaeological_finds/old_migrations/0030_auto__del_field_historicalfind_dating_id__del_field_find_dating.py diff --git a/archaeological_finds/migrations/0031_auto__add_field_historicalfind_dating_comment__add_field_find_dating_c.py b/archaeological_finds/old_migrations/0031_auto__add_field_historicalfind_dating_comment__add_field_find_dating_c.py index 0909d52fa..0909d52fa 100644 --- a/archaeological_finds/migrations/0031_auto__add_field_historicalfind_dating_comment__add_field_find_dating_c.py +++ b/archaeological_finds/old_migrations/0031_auto__add_field_historicalfind_dating_comment__add_field_find_dating_c.py diff --git a/archaeological_finds/migrations/0032_auto__add_field_historicalfind_checked__add_field_find_checked.py b/archaeological_finds/old_migrations/0032_auto__add_field_historicalfind_checked__add_field_find_checked.py index a8a28822a..a8a28822a 100644 --- a/archaeological_finds/migrations/0032_auto__add_field_historicalfind_checked__add_field_find_checked.py +++ b/archaeological_finds/old_migrations/0032_auto__add_field_historicalfind_checked__add_field_find_checked.py diff --git a/archaeological_finds/migrations/0033_auto__add_field_historicalfind_check_date__add_field_find_check_date.py b/archaeological_finds/old_migrations/0033_auto__add_field_historicalfind_check_date__add_field_find_check_date.py index 57d50bd22..57d50bd22 100644 --- a/archaeological_finds/migrations/0033_auto__add_field_historicalfind_check_date__add_field_find_check_date.py +++ b/archaeological_finds/old_migrations/0033_auto__add_field_historicalfind_check_date__add_field_find_check_date.py diff --git a/archaeological_finds/migrations/0034_auto__add_field_historicalbasefind_cache_short_id__add_field_historica.py b/archaeological_finds/old_migrations/0034_auto__add_field_historicalbasefind_cache_short_id__add_field_historica.py index 4e19f2a99..4e19f2a99 100644 --- a/archaeological_finds/migrations/0034_auto__add_field_historicalbasefind_cache_short_id__add_field_historica.py +++ b/archaeological_finds/old_migrations/0034_auto__add_field_historicalbasefind_cache_short_id__add_field_historica.py diff --git a/archaeological_finds/migrations/0035_auto.py b/archaeological_finds/old_migrations/0035_auto.py index d0f93c6a4..d0f93c6a4 100644 --- a/archaeological_finds/migrations/0035_auto.py +++ b/archaeological_finds/old_migrations/0035_auto.py diff --git a/archaeological_finds/migrations/0036_preservation_to_preservations.py b/archaeological_finds/old_migrations/0036_preservation_to_preservations.py index 4322510e9..4322510e9 100644 --- a/archaeological_finds/migrations/0036_preservation_to_preservations.py +++ b/archaeological_finds/old_migrations/0036_preservation_to_preservations.py diff --git a/archaeological_finds/migrations/0037_auto__del_field_historicalfind_preservation_to_consider_id__del_field_.py b/archaeological_finds/old_migrations/0037_auto__del_field_historicalfind_preservation_to_consider_id__del_field_.py index e69d0ac88..e69d0ac88 100644 --- a/archaeological_finds/migrations/0037_auto__del_field_historicalfind_preservation_to_consider_id__del_field_.py +++ b/archaeological_finds/old_migrations/0037_auto__del_field_historicalfind_preservation_to_consider_id__del_field_.py diff --git a/archaeological_finds/migrations/0038_auto__add_field_historicalbasefind_batch__add_field_basefind_batch.py b/archaeological_finds/old_migrations/0038_auto__add_field_historicalbasefind_batch__add_field_basefind_batch.py index dac8ae01a..dac8ae01a 100644 --- a/archaeological_finds/migrations/0038_auto__add_field_historicalbasefind_batch__add_field_basefind_batch.py +++ b/archaeological_finds/old_migrations/0038_auto__add_field_historicalbasefind_batch__add_field_basefind_batch.py diff --git a/archaeological_finds/migrations/0039_is_isolated_batch.py b/archaeological_finds/old_migrations/0039_is_isolated_batch.py index f3a71751b..f3a71751b 100644 --- a/archaeological_finds/migrations/0039_is_isolated_batch.py +++ b/archaeological_finds/old_migrations/0039_is_isolated_batch.py diff --git a/archaeological_finds/migrations/0040_auto__del_field_historicalbasefind_is_isolated__del_field_basefind_is_.py b/archaeological_finds/old_migrations/0040_auto__del_field_historicalbasefind_is_isolated__del_field_basefind_is_.py index 02b6dbf4a..02b6dbf4a 100644 --- a/archaeological_finds/migrations/0040_auto__del_field_historicalbasefind_is_isolated__del_field_basefind_is_.py +++ b/archaeological_finds/old_migrations/0040_auto__del_field_historicalbasefind_is_isolated__del_field_basefind_is_.py diff --git a/archaeological_finds/migrations/0041_auto__add_integritytype.py b/archaeological_finds/old_migrations/0041_auto__add_integritytype.py index c38d16d6a..c38d16d6a 100644 --- a/archaeological_finds/migrations/0041_auto__add_integritytype.py +++ b/archaeological_finds/old_migrations/0041_auto__add_integritytype.py diff --git a/archaeological_finds/migrations/0042_auto__chg_field_historicalfind_label__chg_field_find_label__chg_field_.py b/archaeological_finds/old_migrations/0042_auto__chg_field_historicalfind_label__chg_field_find_label__chg_field_.py index 9b31f2024..9b31f2024 100644 --- a/archaeological_finds/migrations/0042_auto__chg_field_historicalfind_label__chg_field_find_label__chg_field_.py +++ b/archaeological_finds/old_migrations/0042_auto__chg_field_historicalfind_label__chg_field_find_label__chg_field_.py diff --git a/archaeological_finds/migrations/0043_auto__add_field_findsource_duplicate__chg_field_findsource_internal_re.py b/archaeological_finds/old_migrations/0043_auto__add_field_findsource_duplicate__chg_field_findsource_internal_re.py index 3e288d58d..3e288d58d 100644 --- a/archaeological_finds/migrations/0043_auto__add_field_findsource_duplicate__chg_field_findsource_internal_re.py +++ b/archaeological_finds/old_migrations/0043_auto__add_field_findsource_duplicate__chg_field_findsource_internal_re.py diff --git a/archaeological_finds/migrations/0044_auto__add_field_findsource_receipt_date_in_documentation__add_field_tr.py b/archaeological_finds/old_migrations/0044_auto__add_field_findsource_receipt_date_in_documentation__add_field_tr.py index 2c0c74701..2c0c74701 100644 --- a/archaeological_finds/migrations/0044_auto__add_field_findsource_receipt_date_in_documentation__add_field_tr.py +++ b/archaeological_finds/old_migrations/0044_auto__add_field_findsource_receipt_date_in_documentation__add_field_tr.py diff --git a/archaeological_finds/migrations/0045_auto__add_findbasket__add_unique_findbasket_label_user.py b/archaeological_finds/old_migrations/0045_auto__add_findbasket__add_unique_findbasket_label_user.py index 2879e422a..2879e422a 100644 --- a/archaeological_finds/migrations/0045_auto__add_findbasket__add_unique_findbasket_label_user.py +++ b/archaeological_finds/old_migrations/0045_auto__add_findbasket__add_unique_findbasket_label_user.py diff --git a/archaeological_finds/migrations/0046_auto__add_field_basefind_point__add_field_basefind_line__add_field_bas.py b/archaeological_finds/old_migrations/0046_auto__add_field_basefind_point__add_field_basefind_line__add_field_bas.py index 47898f58a..47898f58a 100644 --- a/archaeological_finds/migrations/0046_auto__add_field_basefind_point__add_field_basefind_line__add_field_bas.py +++ b/archaeological_finds/old_migrations/0046_auto__add_field_basefind_point__add_field_basefind_line__add_field_bas.py diff --git a/archaeological_finds/migrations/0047_auto__add_field_historicalfind_conservatory_comment__add_field_histori.py b/archaeological_finds/old_migrations/0047_auto__add_field_historicalfind_conservatory_comment__add_field_histori.py index 53e9e7643..53e9e7643 100644 --- a/archaeological_finds/migrations/0047_auto__add_field_historicalfind_conservatory_comment__add_field_histori.py +++ b/archaeological_finds/old_migrations/0047_auto__add_field_historicalfind_conservatory_comment__add_field_histori.py diff --git a/archaeological_finds/migrations/0048_auto__add_field_treatmenttype_upstream_is_many__add_field_treatmenttyp.py b/archaeological_finds/old_migrations/0048_auto__add_field_treatmenttype_upstream_is_many__add_field_treatmenttyp.py index 27c628852..27c628852 100644 --- a/archaeological_finds/migrations/0048_auto__add_field_treatmenttype_upstream_is_many__add_field_treatmenttyp.py +++ b/archaeological_finds/old_migrations/0048_auto__add_field_treatmenttype_upstream_is_many__add_field_treatmenttyp.py diff --git a/archaeological_finds/migrations/0049_auto__chg_field_historicalfind_external_id__chg_field_find_external_id.py b/archaeological_finds/old_migrations/0049_auto__chg_field_historicalfind_external_id__chg_field_find_external_id.py index ba9399ab6..ba9399ab6 100644 --- a/archaeological_finds/migrations/0049_auto__chg_field_historicalfind_external_id__chg_field_find_external_id.py +++ b/archaeological_finds/old_migrations/0049_auto__chg_field_historicalfind_external_id__chg_field_find_external_id.py diff --git a/archaeological_finds/migrations/0050_auto__add_field_historicalfind_auto_external_id__add_field_find_auto_e.py b/archaeological_finds/old_migrations/0050_auto__add_field_historicalfind_auto_external_id__add_field_find_auto_e.py index 43745a418..43745a418 100644 --- a/archaeological_finds/migrations/0050_auto__add_field_historicalfind_auto_external_id__add_field_find_auto_e.py +++ b/archaeological_finds/old_migrations/0050_auto__add_field_historicalfind_auto_external_id__add_field_find_auto_e.py diff --git a/archaeological_finds/migrations/0051_auto__add_remarkabilitytype.py b/archaeological_finds/old_migrations/0051_auto__add_remarkabilitytype.py index 879d3cd2c..879d3cd2c 100644 --- a/archaeological_finds/migrations/0051_auto__add_remarkabilitytype.py +++ b/archaeological_finds/old_migrations/0051_auto__add_remarkabilitytype.py diff --git a/archaeological_finds/migrations/0052_auto__add_field_historicalfind_estimated_value__add_field_find_estimat.py b/archaeological_finds/old_migrations/0052_auto__add_field_historicalfind_estimated_value__add_field_find_estimat.py index 01196ccbd..01196ccbd 100644 --- a/archaeological_finds/migrations/0052_auto__add_field_historicalfind_estimated_value__add_field_find_estimat.py +++ b/archaeological_finds/old_migrations/0052_auto__add_field_historicalfind_estimated_value__add_field_find_estimat.py diff --git a/archaeological_finds/migrations/0053_view_find_treatments.py b/archaeological_finds/old_migrations/0053_view_find_treatments.py index 1e06e490b..1e06e490b 100644 --- a/archaeological_finds/migrations/0053_view_find_treatments.py +++ b/archaeological_finds/old_migrations/0053_view_find_treatments.py diff --git a/archaeological_finds/migrations/0054_rename_treatment_views.py b/archaeological_finds/old_migrations/0054_rename_treatment_views.py index 1eccc93c1..1eccc93c1 100644 --- a/archaeological_finds/migrations/0054_rename_treatment_views.py +++ b/archaeological_finds/old_migrations/0054_rename_treatment_views.py diff --git a/archaeological_finds/migrations/0055_auto__add_field_findsource_image__add_field_findsource_thumbnail__add_.py b/archaeological_finds/old_migrations/0055_auto__add_field_findsource_image__add_field_findsource_thumbnail__add_.py index 8ac1a319f..8ac1a319f 100644 --- a/archaeological_finds/migrations/0055_auto__add_field_findsource_image__add_field_findsource_thumbnail__add_.py +++ b/archaeological_finds/old_migrations/0055_auto__add_field_findsource_image__add_field_findsource_thumbnail__add_.py diff --git a/archaeological_finds/migrations/0056_auto__add_field_historicalfind_cached_label__add_field_find_cached_lab.py b/archaeological_finds/old_migrations/0056_auto__add_field_historicalfind_cached_label__add_field_find_cached_lab.py index c0d048ba3..c0d048ba3 100644 --- a/archaeological_finds/migrations/0056_auto__add_field_historicalfind_cached_label__add_field_find_cached_lab.py +++ b/archaeological_finds/old_migrations/0056_auto__add_field_historicalfind_cached_label__add_field_find_cached_lab.py diff --git a/archaeological_finds/migrations/0057_generate_cached_label.py b/archaeological_finds/old_migrations/0057_generate_cached_label.py index 911eb7746..911eb7746 100644 --- a/archaeological_finds/migrations/0057_generate_cached_label.py +++ b/archaeological_finds/old_migrations/0057_generate_cached_label.py diff --git a/archaeological_finds/migrations/0058_auto__chg_field_historicalfind_image__chg_field_historicalfind_thumbna.py b/archaeological_finds/old_migrations/0058_auto__chg_field_historicalfind_image__chg_field_historicalfind_thumbna.py index eb09747d4..eb09747d4 100644 --- a/archaeological_finds/migrations/0058_auto__chg_field_historicalfind_image__chg_field_historicalfind_thumbna.py +++ b/archaeological_finds/old_migrations/0058_auto__chg_field_historicalfind_image__chg_field_historicalfind_thumbna.py diff --git a/archaeological_finds/migrations/0059_auto__add_field_historicalfind_thickness__add_field_find_thickness.py b/archaeological_finds/old_migrations/0059_auto__add_field_historicalfind_thickness__add_field_find_thickness.py index e72ad71e4..e72ad71e4 100644 --- a/archaeological_finds/migrations/0059_auto__add_field_historicalfind_thickness__add_field_find_thickness.py +++ b/archaeological_finds/old_migrations/0059_auto__add_field_historicalfind_thickness__add_field_find_thickness.py diff --git a/archaeological_finds/migrations/0060_auto__add_field_historicalfind_topographic_reference_point__add_field_.py b/archaeological_finds/old_migrations/0060_auto__add_field_historicalfind_topographic_reference_point__add_field_.py index b4855a779..b4855a779 100644 --- a/archaeological_finds/migrations/0060_auto__add_field_historicalfind_topographic_reference_point__add_field_.py +++ b/archaeological_finds/old_migrations/0060_auto__add_field_historicalfind_topographic_reference_point__add_field_.py diff --git a/archaeological_finds/migrations/0061_auto__add_field_historicalfind_min_number_of_individuals__add_field_fi.py b/archaeological_finds/old_migrations/0061_auto__add_field_historicalfind_min_number_of_individuals__add_field_fi.py index 8ae8784f8..8ae8784f8 100644 --- a/archaeological_finds/migrations/0061_auto__add_field_historicalfind_min_number_of_individuals__add_field_fi.py +++ b/archaeological_finds/old_migrations/0061_auto__add_field_historicalfind_min_number_of_individuals__add_field_fi.py diff --git a/archaeological_finds/migrations/0062_auto__del_field_historicaltreatment_other_location__add_field_historic.py b/archaeological_finds/old_migrations/0062_auto__del_field_historicaltreatment_other_location__add_field_historic.py index 61985ec9f..61985ec9f 100644 --- a/archaeological_finds/migrations/0062_auto__del_field_historicaltreatment_other_location__add_field_historic.py +++ b/archaeological_finds/old_migrations/0062_auto__del_field_historicaltreatment_other_location__add_field_historic.py diff --git a/archaeological_finds/migrations/0063_treats_generate_year_index.py b/archaeological_finds/old_migrations/0063_treats_generate_year_index.py index 0c6ddee13..0c6ddee13 100644 --- a/archaeological_finds/migrations/0063_treats_generate_year_index.py +++ b/archaeological_finds/old_migrations/0063_treats_generate_year_index.py diff --git a/archaeological_finds/migrations/0064_auto__add_unique_treatment_index_year.py b/archaeological_finds/old_migrations/0064_auto__add_unique_treatment_index_year.py index 3185fc2ff..3185fc2ff 100644 --- a/archaeological_finds/migrations/0064_auto__add_unique_treatment_index_year.py +++ b/archaeological_finds/old_migrations/0064_auto__add_unique_treatment_index_year.py diff --git a/archaeological_finds/migrations/0065_copy_treatment_types.py b/archaeological_finds/old_migrations/0065_copy_treatment_types.py index b4bdd0a05..b4bdd0a05 100644 --- a/archaeological_finds/migrations/0065_copy_treatment_types.py +++ b/archaeological_finds/old_migrations/0065_copy_treatment_types.py diff --git a/archaeological_finds/migrations/0066_auto__del_field_historicaltreatment_treatment_type_id__del_field_treat.py b/archaeological_finds/old_migrations/0066_auto__del_field_historicaltreatment_treatment_type_id__del_field_treat.py index 2bcca03aa..2bcca03aa 100644 --- a/archaeological_finds/migrations/0066_auto__del_field_historicaltreatment_treatment_type_id__del_field_treat.py +++ b/archaeological_finds/old_migrations/0066_auto__del_field_historicaltreatment_treatment_type_id__del_field_treat.py diff --git a/archaeological_finds/migrations/0067_on_delete_for_views.py b/archaeological_finds/old_migrations/0067_on_delete_for_views.py index f7a744325..f7a744325 100644 --- a/archaeological_finds/migrations/0067_on_delete_for_views.py +++ b/archaeological_finds/old_migrations/0067_on_delete_for_views.py diff --git a/archaeological_finds/migrations/0068_auto__add_treatmentfile__add_unique_treatmentfile_year_index__add_hist.py b/archaeological_finds/old_migrations/0068_auto__add_treatmentfile__add_unique_treatmentfile_year_index__add_hist.py index 5949fa70d..5949fa70d 100644 --- a/archaeological_finds/migrations/0068_auto__add_treatmentfile__add_unique_treatmentfile_year_index__add_hist.py +++ b/archaeological_finds/old_migrations/0068_auto__add_treatmentfile__add_unique_treatmentfile_year_index__add_hist.py diff --git a/archaeological_finds/migrations/0069_auto__add_field_historicaltreatment_file_id__add_field_treatment_file.py b/archaeological_finds/old_migrations/0069_auto__add_field_historicaltreatment_file_id__add_field_treatment_file.py index cba7e6c94..cba7e6c94 100644 --- a/archaeological_finds/migrations/0069_auto__add_field_historicaltreatment_file_id__add_field_treatment_file.py +++ b/archaeological_finds/old_migrations/0069_auto__add_field_historicaltreatment_file_id__add_field_treatment_file.py diff --git a/archaeological_finds/migrations/0070_auto__add_treatmentfilesource.py b/archaeological_finds/old_migrations/0070_auto__add_treatmentfilesource.py index 6793487e0..6793487e0 100644 --- a/archaeological_finds/migrations/0070_auto__add_treatmentfilesource.py +++ b/archaeological_finds/old_migrations/0070_auto__add_treatmentfilesource.py diff --git a/archaeological_finds/migrations/0071_auto__add_field_historicaltreatment_cached_label__add_field_treatment_.py b/archaeological_finds/old_migrations/0071_auto__add_field_historicaltreatment_cached_label__add_field_treatment_.py index bc5bfb611..bc5bfb611 100644 --- a/archaeological_finds/migrations/0071_auto__add_field_historicaltreatment_cached_label__add_field_treatment_.py +++ b/archaeological_finds/old_migrations/0071_auto__add_field_historicaltreatment_cached_label__add_field_treatment_.py diff --git a/archaeological_finds/migrations/0072_auto__add_field_treatmentfile_applicant__add_field_treatmentfile_appli.py b/archaeological_finds/old_migrations/0072_auto__add_field_treatmentfile_applicant__add_field_treatmentfile_appli.py index fd24fe719..fd24fe719 100644 --- a/archaeological_finds/migrations/0072_auto__add_field_treatmentfile_applicant__add_field_treatmentfile_appli.py +++ b/archaeological_finds/old_migrations/0072_auto__add_field_treatmentfile_applicant__add_field_treatmentfile_appli.py diff --git a/archaeological_finds/migrations/0073_auto__add_treatmentstate__add_field_historicaltreatment_treatment_stat.py b/archaeological_finds/old_migrations/0073_auto__add_treatmentstate__add_field_historicaltreatment_treatment_stat.py index b68e13499..b68e13499 100644 --- a/archaeological_finds/migrations/0073_auto__add_treatmentstate__add_field_historicaltreatment_treatment_stat.py +++ b/archaeological_finds/old_migrations/0073_auto__add_treatmentstate__add_field_historicaltreatment_treatment_stat.py diff --git a/archaeological_finds/migrations/0074_auto__add_field_find_collection__add_field_historicalfind_collection_i.py b/archaeological_finds/old_migrations/0074_auto__add_field_find_collection__add_field_historicalfind_collection_i.py index 8bb0a2c44..8bb0a2c44 100644 --- a/archaeological_finds/migrations/0074_auto__add_field_find_collection__add_field_historicalfind_collection_i.py +++ b/archaeological_finds/old_migrations/0074_auto__add_field_find_collection__add_field_historicalfind_collection_i.py diff --git a/archaeological_finds/migrations/0075_auto__chg_field_find_container__chg_field_find_upstream_treatment__chg.py b/archaeological_finds/old_migrations/0075_auto__chg_field_find_container__chg_field_find_upstream_treatment__chg.py index 600f7ca74..600f7ca74 100644 --- a/archaeological_finds/migrations/0075_auto__chg_field_find_container__chg_field_find_upstream_treatment__chg.py +++ b/archaeological_finds/old_migrations/0075_auto__chg_field_find_container__chg_field_find_upstream_treatment__chg.py diff --git a/archaeological_finds/migrations/0076_auto__add_field_treatmenttype_order__add_field_treatmenttype_parent.py b/archaeological_finds/old_migrations/0076_auto__add_field_treatmenttype_order__add_field_treatmenttype_parent.py index 0b07fff4a..0b07fff4a 100644 --- a/archaeological_finds/migrations/0076_auto__add_field_treatmenttype_order__add_field_treatmenttype_parent.py +++ b/archaeological_finds/old_migrations/0076_auto__add_field_treatmenttype_order__add_field_treatmenttype_parent.py diff --git a/archaeological_finds/migrations/0077_auto__add_field_historicaltreatment_estimated_cost__add_field_historic.py b/archaeological_finds/old_migrations/0077_auto__add_field_historicaltreatment_estimated_cost__add_field_historic.py index 720d66973..720d66973 100644 --- a/archaeological_finds/migrations/0077_auto__add_field_historicaltreatment_estimated_cost__add_field_historic.py +++ b/archaeological_finds/old_migrations/0077_auto__add_field_historicaltreatment_estimated_cost__add_field_historic.py diff --git a/archaeological_finds/migrations/0078_fix_treatment_views.py b/archaeological_finds/old_migrations/0078_fix_treatment_views.py index 0bd018e50..0bd018e50 100644 --- a/archaeological_finds/migrations/0078_fix_treatment_views.py +++ b/archaeological_finds/old_migrations/0078_fix_treatment_views.py diff --git a/archaeological_finds/migrations/0079_auto__del_field_find_topographic_reference_point__del_field_historical.py b/archaeological_finds/old_migrations/0079_auto__del_field_find_topographic_reference_point__del_field_historical.py index e2b16f1da..e2b16f1da 100644 --- a/archaeological_finds/migrations/0079_auto__del_field_find_topographic_reference_point__del_field_historical.py +++ b/archaeological_finds/old_migrations/0079_auto__del_field_find_topographic_reference_point__del_field_historical.py diff --git a/archaeological_finds/migrations/0080_auto__add_field_basefind_x__add_field_basefind_y__add_field_basefind_z.py b/archaeological_finds/old_migrations/0080_auto__add_field_basefind_x__add_field_basefind_y__add_field_basefind_z.py index 7559daeab..7559daeab 100644 --- a/archaeological_finds/migrations/0080_auto__add_field_basefind_x__add_field_basefind_y__add_field_basefind_z.py +++ b/archaeological_finds/old_migrations/0080_auto__add_field_basefind_x__add_field_basefind_y__add_field_basefind_z.py diff --git a/archaeological_finds/migrations/0081_regenerate_treatment_views.py b/archaeological_finds/old_migrations/0081_regenerate_treatment_views.py index 9417088c2..9417088c2 100644 --- a/archaeological_finds/migrations/0081_regenerate_treatment_views.py +++ b/archaeological_finds/old_migrations/0081_regenerate_treatment_views.py diff --git a/archaeological_finds/migrations/0082_auto__add_batchtype__add_field_basefind_new_batch__add_field_historica.py b/archaeological_finds/old_migrations/0082_auto__add_batchtype__add_field_basefind_new_batch__add_field_historica.py index 1f1a8edc1..1f1a8edc1 100644 --- a/archaeological_finds/migrations/0082_auto__add_batchtype__add_field_basefind_new_batch__add_field_historica.py +++ b/archaeological_finds/old_migrations/0082_auto__add_batchtype__add_field_basefind_new_batch__add_field_historica.py diff --git a/archaeological_finds/migrations/0083_batch_to_new_batch.py b/archaeological_finds/old_migrations/0083_batch_to_new_batch.py index 2a982d391..2a982d391 100644 --- a/archaeological_finds/migrations/0083_batch_to_new_batch.py +++ b/archaeological_finds/old_migrations/0083_batch_to_new_batch.py diff --git a/archaeological_finds/migrations/0084_auto__del_field_basefind_new_batch__chg_field_basefind_batch__del_fiel.py b/archaeological_finds/old_migrations/0084_auto__del_field_basefind_new_batch__chg_field_basefind_batch__del_fiel.py index 404fb76eb..404fb76eb 100644 --- a/archaeological_finds/migrations/0084_auto__del_field_basefind_new_batch__chg_field_basefind_batch__del_fiel.py +++ b/archaeological_finds/old_migrations/0084_auto__del_field_basefind_new_batch__chg_field_basefind_batch__del_fiel.py diff --git a/archaeological_finds/migrations/0085_create_bulk_update_view.py b/archaeological_finds/old_migrations/0085_create_bulk_update_view.py index c59420fe2..c59420fe2 100644 --- a/archaeological_finds/migrations/0085_create_bulk_update_view.py +++ b/archaeological_finds/old_migrations/0085_create_bulk_update_view.py diff --git a/archaeological_finds/old_migrations/__init__.py b/archaeological_finds/old_migrations/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/archaeological_finds/old_migrations/__init__.py diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index e0d74db77..6187a300f 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -1,6 +1,5 @@  {% extends "ishtar/sheet.html" %}  {% load i18n window_field from_dict link_to_window window_tables window_header humanize %} -{% load url from future %}  {% block head_title %}{% trans "Find" %}{% endblock %}  {% block content %} diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html index 9d6c75425..5fc8f2aac 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatment.html +++ b/archaeological_finds/templates/ishtar/sheet_treatment.html @@ -1,6 +1,5 @@  {% extends "ishtar/sheet.html" %}  {% load i18n window_field from_dict link_to_window window_tables window_ope_tables window_header humanize %} -{% load url from future %}  {% block head_title %}{% trans "Treatment" %}{% endblock %}  {% block content %} diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html index b84f60883..f8fb3e0aa 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html +++ b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html @@ -1,6 +1,5 @@  {% extends "ishtar/sheet.html" %}  {% load i18n window_field from_dict link_to_window window_tables window_ope_tables window_header humanize %} -{% load url from future %}  {% block head_title %}{% trans "Treatment request" %}{% endblock %}  {% block content %} diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 41e113245..75f580633 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -52,8 +52,11 @@ class FindInit(ContextRecordInit):              self.base_finds = []          default = {'label': "Base find"} -        if not data_base.get('history_modifier'): -            data_base['history_modifier'] = self.get_default_user() +        if not data_base.get('history_modifier') or not data_base[ +            'history_modifier'].pk: +            user = self.get_default_user() +            user.save() +            data_base['history_modifier'] = user          if force or not data_base.get('context_record'):              data_base['context_record'] = self.get_default_context_record(                  force=force) @@ -146,6 +149,8 @@ class FindWizardCreationTest(WizardTest, FindInit, TestCase):                           self.basefind_number + 1)          self.assertEqual(models.Find.objects.count(),                           self.find_number + 1) +        find = models.Find.objects.order_by("-pk")[0] +        self.assertEqual(find.datings.count(), 1)  class FindWizardDeletionWithWarehouseModTest(WizardTest, FindInit, TestCase): diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index 9c331ccc9..78ea05e96 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -17,7 +17,7 @@  # See the file COPYING for details. -from django.conf.urls import * +from django.conf.urls import patterns, url  from ishtar_common.wizards import check_rights  import views diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 2e84757c9..4874abefb 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -84,9 +84,9 @@ def autocomplete_treatmentfile(request):                                        models.Treatment) \              and not request.user.ishtaruser.has_right('treatmentfile_search',                                                        session=request.session): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q1 in q.split(' '): @@ -104,7 +104,7 @@ def autocomplete_treatmentfile(request):      files = models.TreatmentFile.objects.filter(query)[:limit]      data = json.dumps([{'id': file.pk, 'value': unicode(file)}                         for file in files]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  show_findsource = show_item(models.FindSource, 'findsource') diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 058e637f4..4a7d56024 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -20,6 +20,7 @@  """  Operations forms definitions  """ +from collections import OrderedDict  import datetime  from itertools import groupby @@ -104,7 +105,7 @@ class ParcelForm(forms.Form):              prefix_value = kwargs['prefix'] + '-town'              if not [k for k in kwargs['data'].keys()                      if k.startswith(prefix_value) and kwargs['data'][k]]: -                kwargs['data'] = None +                kwargs['data'] = {}                  if 'files' in kwargs:                      kwargs.pop('files')          super(ParcelForm, self).__init__(*args, **kwargs) @@ -335,7 +336,6 @@ class ParcelFormSet(FormSet):      def clean(self):          # manage parcel selection -        selected_town, parcels = None, []          if self.data.get('_parcel_selection'):              parcels = parse_parcels(self.data['_parcel_selection'])              selected_town = self.data.get('_town') @@ -417,7 +417,7 @@ class RecordRelationsForm(ManageOldType, forms.Form):              raise forms.ValidationError(                  _(u"You should select a relation type."))          if self.left_record and \ -                str(cleaned_data.get('right_record')) == str( +                str(cleaned_data.get('right_record', None)) == str(                      self.left_record.pk):              raise forms.ValidationError(                  _(u"An operation cannot be related to herself.")) @@ -909,11 +909,13 @@ class OperationFormGeneral(ManageOldType, forms.Form):          self.fields['record_quality'].choices = \              [('', '--')] + list(models.QUALITY)          if 'operation_code' in self.fields: -            self.fields.keyOrder = list(self.fields.keyOrder) -            self.fields.keyOrder.pop(self.fields.keyOrder.index( -                'operation_code')) -            self.fields.keyOrder.insert(self.fields.keyOrder.index('year'), -                                        'operation_code') +            fields = OrderedDict() +            ope_code = self.fields.pop('operation_code') +            for key, value in self.fields.items(): +                if key == 'year': +                    fields['operation_code'] = ope_code +                fields[key] = value +            self.fields = fields      def clean(self):          cleaned_data = self.cleaned_data @@ -976,12 +978,15 @@ class OperationFormModifGeneral(OperationFormGeneral):      def __init__(self, *args, **kwargs):          super(OperationFormModifGeneral, self).__init__(*args, **kwargs) -        self.fields.keyOrder = list(self.fields.keyOrder) -        self.fields.keyOrder.pop(self.fields.keyOrder.index('associated_file')) -        self.fields.keyOrder.insert(self.fields.keyOrder.index('in_charge'), -                                    'associated_file') +        asso_file = self.fields.pop('associated_file')          if not get_current_profile().files: -            self.fields.pop('associated_file') +            return +        fields = OrderedDict() +        for key, value in self.fields.items(): +            if key == 'in_charge': +                fields['associated_file'] = asso_file +            fields[key] = value +        self.fields = fields  OperationFormModifGeneral.associated_models = \      OperationFormGeneral.associated_models.copy() @@ -1039,13 +1044,6 @@ class SelectedTownForm(forms.Form):          towns = None          if 'data' in kwargs and 'TOWNS' in kwargs['data']:              towns = kwargs['data']['TOWNS'] -            # clean data if not "real" data -            prefix_value = kwargs['prefix'] + '-town' -            if not [k for k in kwargs['data'].keys() -                    if k.startswith(prefix_value) and kwargs['data'][k]]: -                kwargs['data'] = None -                if 'files' in kwargs: -                    kwargs.pop('files')          super(SelectedTownForm, self).__init__(*args, **kwargs)          if towns and towns != -1:              self.fields['town'].choices = [('', '--')] + towns @@ -1065,13 +1063,6 @@ class SelectedParcelForm(forms.Form):          parcels = None          if 'data' in kwargs and 'PARCELS' in kwargs['data']:              parcels = kwargs['data']['PARCELS'] -            # clean data if not "real" data -            prefix_value = kwargs['prefix'] + '-parcel' -            if not [k for k in kwargs['data'].keys() -                    if k.startswith(prefix_value) and kwargs['data'][k]]: -                kwargs['data'] = None -                if 'files' in kwargs: -                    kwargs.pop('files')          super(SelectedParcelForm, self).__init__(*args, **kwargs)          if parcels:              self.fields['parcel'].choices = [('', '--')] + parcels @@ -1239,9 +1230,13 @@ class OperationSourceForm(SourceForm):      def __init__(self, *args, **kwargs):          super(OperationSourceForm, self).__init__(*args, **kwargs) -        keyOrder = self.fields.keyOrder -        keyOrder.pop(keyOrder.index('index')) -        keyOrder.insert(keyOrder.index('source_type') + 1, 'index') +        fields = OrderedDict() +        idx = self.fields.pop('index') +        for key, value in self.fields.items(): +            fields[key] = value +            if key == 'source_type': +                fields['index'] = idx +        self.fields = fields      def clean(self):          # manage unique operation ID @@ -1404,11 +1399,13 @@ class AdministrativeActOpeForm(ManageOldType, forms.Form):  class AdministrativeActModifForm(object):      def __init__(self, *args, **kwargs):          super(AdministrativeActModifForm, self).__init__(*args, **kwargs) -        self.fields.keyOrder = list(self.fields.keyOrder) -        self.fields.keyOrder.pop(self.fields.keyOrder.index( -            'index')) -        self.fields.keyOrder.insert( -            self.fields.keyOrder.index("signature_date") + 1, 'index') +        fields = OrderedDict() +        idx = self.fields.pop('index') +        for key, value in self.fields.items(): +            fields[key] = value +            if key == 'signature_date': +                fields['index'] = idx +        self.fields = fields      def clean(self):          # manage unique act ID diff --git a/archaeological_operations/migrations/0001_initial.py b/archaeological_operations/migrations/0001_initial.py index c5b4619ab..65d741aaa 100644 --- a/archaeological_operations/migrations/0001_initial.py +++ b/archaeological_operations/migrations/0001_initial.py @@ -1,655 +1,387 @@  # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): -    depends_on = (('archaeological_files', '0001_initial.py'), ) - -    def forwards(self, orm): -        # Adding model 'OperationType' -        db.create_table('archaeological_operations_operationtype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_operations', ['OperationType']) - -        # Adding model 'RemainType' -        db.create_table('archaeological_operations_remaintype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_operations', ['RemainType']) - -        # Adding model 'Period' -        db.create_table('archaeological_operations_period', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -            ('start_date', self.gf('django.db.models.fields.IntegerField')()), -            ('end_date', self.gf('django.db.models.fields.IntegerField')()), -            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Period'], null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_operations', ['Period']) - -        # Adding model 'HistoricalOperation' -        db.create_table('archaeological_operations_historicaloperation', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('excavation_end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('in_charge_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('year', self.gf('django.db.models.fields.IntegerField')()), -            ('operation_code', self.gf('django.db.models.fields.IntegerField')()), -            ('associated_file_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('operation_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('scheduled_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('optional_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('effective_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('code_patriarche', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('code_dracar', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('fnap_financing', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), -            ('fnap_cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('zoning_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('large_area_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('geoarchaeological_context_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('operator_reference', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True)), -            ('common_name', self.gf('django.db.models.fields.CharField')(max_length=120, null=True, blank=True)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_operations', ['HistoricalOperation']) - -        # Adding model 'Operation' -        db.create_table('archaeological_operations_operation', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('excavation_end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('in_charge', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), -            ('year', self.gf('django.db.models.fields.IntegerField')()), -            ('operation_code', self.gf('django.db.models.fields.IntegerField')()), -            ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='operations', null=True, to=orm['archaeological_files.File'])), -            ('operation_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['archaeological_operations.OperationType'])), -            ('surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('scheduled_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('optional_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('effective_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('code_patriarche', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('code_dracar', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('fnap_financing', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), -            ('fnap_cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('zoning_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('large_area_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('geoarchaeological_context_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), -            ('operator_reference', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True)), -            ('common_name', self.gf('django.db.models.fields.CharField')(max_length=120, null=True, blank=True)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_operations', ['Operation']) - -        # Adding M2M table for field remains on 'Operation' -        db.create_table('archaeological_operations_operation_remains', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('operation', models.ForeignKey(orm['archaeological_operations.operation'], null=False)), -            ('remaintype', models.ForeignKey(orm['archaeological_operations.remaintype'], null=False)) -        )) -        db.create_unique('archaeological_operations_operation_remains', ['operation_id', 'remaintype_id']) - -        # Adding M2M table for field towns on 'Operation' -        db.create_table('archaeological_operations_operation_towns', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('operation', models.ForeignKey(orm['archaeological_operations.operation'], null=False)), -            ('town', models.ForeignKey(orm['ishtar_common.town'], null=False)) -        )) -        db.create_unique('archaeological_operations_operation_towns', ['operation_id', 'town_id']) - -        # Adding M2M table for field periods on 'Operation' -        db.create_table('archaeological_operations_operation_periods', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('operation', models.ForeignKey(orm['archaeological_operations.operation'], null=False)), -            ('period', models.ForeignKey(orm['archaeological_operations.period'], null=False)) -        )) -        db.create_unique('archaeological_operations_operation_periods', ['operation_id', 'period_id']) - -        # Adding model 'OperationSource' -        db.create_table('archaeological_operations_operationsource', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), -            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), -            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_operations.Operation'])), -            ('index', self.gf('django.db.models.fields.IntegerField')()), -        )) -        db.send_create_signal('archaeological_operations', ['OperationSource']) - -        # Adding M2M table for field authors on 'OperationSource' -        db.create_table('archaeological_operations_operationsource_authors', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('operationsource', models.ForeignKey(orm['archaeological_operations.operationsource'], null=False)), -            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) -        )) -        db.create_unique('archaeological_operations_operationsource_authors', ['operationsource_id', 'author_id']) - -        # Adding model 'ActType' -        db.create_table('archaeological_operations_acttype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('intented_to', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_operations', ['ActType']) - -        # Adding model 'HistoricalAdministrativeAct' -        db.create_table('archaeological_operations_historicaladministrativeact', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('act_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('in_charge_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('operator_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('scientific_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('signatory_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('operation_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('associated_file_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('signature_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('act_object', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('ref_sra', self.gf('django.db.models.fields.CharField')(max_length=15)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('archaeological_operations', ['HistoricalAdministrativeAct']) - -        # Adding model 'AdministrativeAct' -        db.create_table('archaeological_operations_administrativeact', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('act_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.ActType'])), -            ('in_charge', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), -            ('operator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Organization'], null=True, blank=True)), -            ('scientific', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), -            ('signatory', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), -            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='administrative_act', null=True, to=orm['archaeological_operations.Operation'])), -            ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='administrative_act', null=True, to=orm['archaeological_files.File'])), -            ('signature_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), -            ('act_object', self.gf('django.db.models.fields.CharField')(max_length=200)), -            ('ref_sra', self.gf('django.db.models.fields.CharField')(max_length=15)), -        )) -        db.send_create_signal('archaeological_operations', ['AdministrativeAct']) - -        # Adding model 'Parcel' -        db.create_table('archaeological_operations_parcel', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), -            ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='parcels', null=True, to=orm['archaeological_files.File'])), -            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='parcels', null=True, to=orm['archaeological_operations.Operation'])), -            ('year', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('town', self.gf('django.db.models.fields.related.ForeignKey')(related_name='parcels', to=orm['ishtar_common.Town'])), -            ('section', self.gf('django.db.models.fields.CharField')(max_length=4)), -            ('parcel_number', self.gf('django.db.models.fields.CharField')(max_length=6)), -        )) -        db.send_create_signal('archaeological_operations', ['Parcel']) - -        # Adding model 'ParcelOwner' -        db.create_table('archaeological_operations_parcelowner', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), -            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])), -            ('parcel', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Parcel'])), -            ('start_date', self.gf('django.db.models.fields.DateField')()), -            ('end_date', self.gf('django.db.models.fields.DateField')()), -        )) -        db.send_create_signal('archaeological_operations', ['ParcelOwner']) - +from __future__ import unicode_literals -    def backwards(self, orm): -        # Deleting model 'OperationType' -        db.delete_table('archaeological_operations_operationtype') - -        # Deleting model 'RemainType' -        db.delete_table('archaeological_operations_remaintype') - -        # Deleting model 'Period' -        db.delete_table('archaeological_operations_period') - -        # Deleting model 'HistoricalOperation' -        db.delete_table('archaeological_operations_historicaloperation') - -        # Deleting model 'Operation' -        db.delete_table('archaeological_operations_operation') - -        # Removing M2M table for field remains on 'Operation' -        db.delete_table('archaeological_operations_operation_remains') - -        # Removing M2M table for field towns on 'Operation' -        db.delete_table('archaeological_operations_operation_towns') - -        # Removing M2M table for field periods on 'Operation' -        db.delete_table('archaeological_operations_operation_periods') - -        # Deleting model 'OperationSource' -        db.delete_table('archaeological_operations_operationsource') - -        # Removing M2M table for field authors on 'OperationSource' -        db.delete_table('archaeological_operations_operationsource_authors') - -        # Deleting model 'ActType' -        db.delete_table('archaeological_operations_acttype') - -        # Deleting model 'HistoricalAdministrativeAct' -        db.delete_table('archaeological_operations_historicaladministrativeact') - -        # Deleting model 'AdministrativeAct' -        db.delete_table('archaeological_operations_administrativeact') - -        # Deleting model 'Parcel' -        db.delete_table('archaeological_operations_parcel') - -        # Deleting model 'ParcelOwner' -        db.delete_table('archaeological_operations_parcelowner') - - -    models = { -        'archaeological_files.file': { -            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), -            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.acttype': { -            'Meta': {'object_name': 'ActType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.administrativeact': { -            'Meta': {'object_name': 'AdministrativeAct'}, -            'act_object': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15'}), -            'scientific': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.historicaladministrativeact': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalAdministrativeAct'}, -            'act_object': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'act_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15'}), -            'scientific_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'signatory_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.historicaloperation': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOperation'}, -            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {}), -            'operation_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'year': ('django.db.models.fields.IntegerField', [], {}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'object_name': 'Operation'}, -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operationbydepartment': { -            'Meta': {'object_name': 'OperationByDepartment', 'db_table': "'operation_department'", 'managed': 'False'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Operation']"}) -        }, -        'archaeological_operations.operationsource': { -            'Meta': {'object_name': 'OperationSource'}, -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_operations.Operation']"}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'archaeological_operations.operationtype': { -            'Meta': {'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'object_name': 'Parcel'}, -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.parcelowner': { -            'Meta': {'object_name': 'ParcelOwner'}, -            'end_date': ('django.db.models.fields.DateField', [], {}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Parcel']"}), -            'start_date': ('django.db.models.fields.DateField', [], {}) -        }, -        'archaeological_operations.period': { -            'Meta': {'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.wizard': { -            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) -        }, -        'ishtar_common.wizardstep': { -            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) -        } -    } - -    complete_apps = ['archaeological_operations'] +from django.db import models, migrations +import datetime +import re +import django.contrib.gis.db.models.fields +import archaeological_operations.models +import django.db.models.deletion +from django.conf import settings +import ishtar_common.models +import django.core.validators + + +class Migration(migrations.Migration): + +    dependencies = [ +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +    ] + +    operations = [ +        migrations.CreateModel( +            name='OperationByDepartment', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +            ], +            options={ +                'db_table': 'operation_department', +                'managed': False, +            }, +        ), +        migrations.CreateModel( +            name='ActType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('intented_to', models.CharField(max_length=2, verbose_name='Intended to', choices=[(b'F', 'Archaeological file'), (b'O', 'Operation'), (b'TF', 'Treatment request'), (b'T', 'Treatment')])), +                ('code', models.CharField(max_length=10, null=True, verbose_name='Code', blank=True)), +                ('indexed', models.BooleanField(default=False, verbose_name='Indexed')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Act type', +                'verbose_name_plural': 'Act types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='AdministrativeAct', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('index', models.IntegerField(null=True, verbose_name='Index', blank=True)), +                ('signature_date', models.DateField(null=True, verbose_name='Signature date', blank=True)), +                ('year', models.IntegerField(null=True, verbose_name='Year', blank=True)), +                ('act_object', models.TextField(max_length=300, null=True, verbose_name='Object', blank=True)), +                ('ref_sra', models.CharField(max_length=15, null=True, verbose_name='R\xe9f\xe9rence SRA', blank=True)), +                ('departments_label', models.TextField(help_text='Cached values get from associated departments', null=True, verbose_name='Departments', blank=True)), +                ('towns_label', models.TextField(help_text='Cached values get from associated towns', null=True, verbose_name='Towns', blank=True)), +            ], +            options={ +                'ordering': ('year', 'signature_date', 'index', 'act_type'), +                'verbose_name': 'Administrative act', +                'verbose_name_plural': 'Administrative acts', +                'permissions': (('view_administrativeact', 'Peut voir tous les Actes administratifs'), ('view_own_administrativeact', 'Peut voir son propre Acte administratif'), ('add_own_administrativeact', 'Peut ajouter son propre Acte administratif'), ('change_own_administrativeact', 'Peut modifier son propre Acte administratif'), ('delete_own_administrativeact', 'Peut supprimer son propre Acte administratif')), +            }, +            bases=(models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter), +        ), +        migrations.CreateModel( +            name='ArchaeologicalSite', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('reference', models.CharField(unique=True, max_length=20, verbose_name='Reference')), +                ('name', models.CharField(max_length=200, null=True, verbose_name='Name', blank=True)), +            ], +            options={ +                'verbose_name': 'Archaeological site', +                'verbose_name_plural': 'Archaeological sites', +                'permissions': (('view_archaeologicalsite', 'Peut voir toutes les Entit\xe9s arch\xe9ologiques'), ('view_own_archaeologicalsite', 'Peut voir ses propres Entit\xe9s arch\xe9ologiques'), ('add_own_archaeologicalsite', 'Peut ajouter ses propres Entit\xe9s arch\xe9ologique'), ('change_own_archaeologicalsite', 'Peut modifier sa propre Entit\xe9 arch\xe9ologique'), ('delete_own_archaeologicalsite', 'Peut supprimer ses propres Entit\xe9s arch\xe9ologiques')), +            }, +        ), +        migrations.CreateModel( +            name='HistoricalAdministrativeAct', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('index', models.IntegerField(null=True, verbose_name='Index', blank=True)), +                ('signature_date', models.DateField(null=True, verbose_name='Signature date', blank=True)), +                ('year', models.IntegerField(null=True, verbose_name='Year', blank=True)), +                ('act_object', models.TextField(max_length=300, null=True, verbose_name='Object', blank=True)), +                ('ref_sra', models.CharField(max_length=15, null=True, verbose_name='R\xe9f\xe9rence SRA', blank=True)), +                ('departments_label', models.TextField(help_text='Cached values get from associated departments', null=True, verbose_name='Departments', blank=True)), +                ('towns_label', models.TextField(help_text='Cached values get from associated towns', null=True, verbose_name='Towns', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Administrative act', +            }, +        ), +        migrations.CreateModel( +            name='HistoricalOperation', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('image', models.TextField(max_length=255, null=True, blank=True)), +                ('thumbnail', models.TextField(max_length=255, null=True, blank=True)), +                ('creation_date', models.DateField(default=datetime.date.today, verbose_name='Creation date')), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('start_date', models.DateField(null=True, verbose_name='Start date', blank=True)), +                ('excavation_end_date', models.DateField(null=True, verbose_name='Excavation end date', blank=True)), +                ('report_delivery_date', models.DateField(null=True, verbose_name='Report delivery date', blank=True)), +                ('year', models.IntegerField(null=True, verbose_name='Year', blank=True)), +                ('operation_code', models.IntegerField(null=True, verbose_name='Numeric reference', blank=True)), +                ('surface', models.IntegerField(null=True, verbose_name='Surface (m2)', blank=True)), +                ('cost', models.IntegerField(null=True, verbose_name='Cost (euros)', blank=True)), +                ('scheduled_man_days', models.IntegerField(null=True, verbose_name='Scheduled man-days', blank=True)), +                ('optional_man_days', models.IntegerField(null=True, verbose_name='Optional man-days', blank=True)), +                ('effective_man_days', models.IntegerField(null=True, verbose_name='Effective man-days', blank=True)), +                ('old_code', models.CharField(max_length=200, null=True, verbose_name='Old code', blank=True)), +                ('code_patriarche', models.TextField(db_index=True, null=True, verbose_name='Code PATRIARCHE', blank=True)), +                ('fnap_financing', models.FloatField(null=True, verbose_name='Financement FNAP (%)', blank=True)), +                ('fnap_cost', models.IntegerField(null=True, verbose_name='Financement FNAP (\u20ac)', blank=True)), +                ('zoning_prescription', models.NullBooleanField(verbose_name='Prescription on zoning')), +                ('large_area_prescription', models.NullBooleanField(verbose_name='Prescription on large area')), +                ('geoarchaeological_context_prescription', models.NullBooleanField(verbose_name='Prescription on geoarchaeological context')), +                ('negative_result', models.NullBooleanField(verbose_name='R\xe9sultat consid\xe9r\xe9 comme n\xe9gatif')), +                ('cira_date', models.DateField(null=True, verbose_name='Date avis CIRA', blank=True)), +                ('eas_number', models.CharField(max_length=20, null=True, verbose_name="Num\xe9ro de l'EA", blank=True)), +                ('operator_reference', models.CharField(max_length=20, null=True, verbose_name='Operator reference', blank=True)), +                ('common_name', models.TextField(null=True, verbose_name='Generic name', blank=True)), +                ('address', models.TextField(null=True, verbose_name='Address / Locality', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='General comment', blank=True)), +                ('scientific_documentation_comment', models.TextField(null=True, verbose_name='Comment about scientific documentation', blank=True)), +                ('cached_label', models.CharField(max_length=500, null=True, verbose_name='Cached name', blank=True)), +                ('virtual_operation', models.BooleanField(default=False, help_text='If checked, it means that this operation have not been officialy registered.', verbose_name='Virtual operation')), +                ('record_quality', models.CharField(blank=True, max_length=2, null=True, verbose_name='Record quality', choices=[(b'ND', 'Not documented'), (b'A', 'Arbitrary'), (b'R', 'Reliable')])), +                ('abstract', models.TextField(null=True, verbose_name='Abstract', blank=True)), +                ('documentation_deadline', models.DateField(null=True, verbose_name='Deadline for submission of the documentation', blank=True)), +                ('documentation_received', models.NullBooleanField(verbose_name='Documentation received')), +                ('finds_deadline', models.DateField(null=True, verbose_name='Deadline for submission of the finds', blank=True)), +                ('finds_received', models.NullBooleanField(verbose_name='Finds received')), +                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, null=True, verbose_name='Point', blank=True)), +                ('multi_polygon', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326, null=True, verbose_name='Multi polygon', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Operation', +            }, +        ), +        migrations.CreateModel( +            name='Operation', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('creation_date', models.DateField(default=datetime.date.today, verbose_name='Creation date')), +                ('end_date', models.DateField(null=True, verbose_name='Closing date', blank=True)), +                ('start_date', models.DateField(null=True, verbose_name='Start date', blank=True)), +                ('excavation_end_date', models.DateField(null=True, verbose_name='Excavation end date', blank=True)), +                ('report_delivery_date', models.DateField(null=True, verbose_name='Report delivery date', blank=True)), +                ('year', models.IntegerField(null=True, verbose_name='Year', blank=True)), +                ('operation_code', models.IntegerField(null=True, verbose_name='Numeric reference', blank=True)), +                ('surface', models.IntegerField(null=True, verbose_name='Surface (m2)', blank=True)), +                ('cost', models.IntegerField(null=True, verbose_name='Cost (euros)', blank=True)), +                ('scheduled_man_days', models.IntegerField(null=True, verbose_name='Scheduled man-days', blank=True)), +                ('optional_man_days', models.IntegerField(null=True, verbose_name='Optional man-days', blank=True)), +                ('effective_man_days', models.IntegerField(null=True, verbose_name='Effective man-days', blank=True)), +                ('old_code', models.CharField(max_length=200, null=True, verbose_name='Old code', blank=True)), +                ('code_patriarche', models.TextField(db_index=True, null=True, verbose_name='Code PATRIARCHE', blank=True)), +                ('fnap_financing', models.FloatField(null=True, verbose_name='Financement FNAP (%)', blank=True)), +                ('fnap_cost', models.IntegerField(null=True, verbose_name='Financement FNAP (\u20ac)', blank=True)), +                ('zoning_prescription', models.NullBooleanField(verbose_name='Prescription on zoning')), +                ('large_area_prescription', models.NullBooleanField(verbose_name='Prescription on large area')), +                ('geoarchaeological_context_prescription', models.NullBooleanField(verbose_name='Prescription on geoarchaeological context')), +                ('negative_result', models.NullBooleanField(verbose_name='R\xe9sultat consid\xe9r\xe9 comme n\xe9gatif')), +                ('cira_date', models.DateField(null=True, verbose_name='Date avis CIRA', blank=True)), +                ('eas_number', models.CharField(max_length=20, null=True, verbose_name="Num\xe9ro de l'EA", blank=True)), +                ('operator_reference', models.CharField(max_length=20, null=True, verbose_name='Operator reference', blank=True)), +                ('common_name', models.TextField(null=True, verbose_name='Generic name', blank=True)), +                ('address', models.TextField(null=True, verbose_name='Address / Locality', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='General comment', blank=True)), +                ('scientific_documentation_comment', models.TextField(null=True, verbose_name='Comment about scientific documentation', blank=True)), +                ('cached_label', models.CharField(max_length=500, null=True, verbose_name='Cached name', blank=True)), +                ('virtual_operation', models.BooleanField(default=False, help_text='If checked, it means that this operation have not been officialy registered.', verbose_name='Virtual operation')), +                ('record_quality', models.CharField(blank=True, max_length=2, null=True, verbose_name='Record quality', choices=[(b'ND', 'Not documented'), (b'A', 'Arbitrary'), (b'R', 'Reliable')])), +                ('abstract', models.TextField(null=True, verbose_name='Abstract', blank=True)), +                ('documentation_deadline', models.DateField(null=True, verbose_name='Deadline for submission of the documentation', blank=True)), +                ('documentation_received', models.NullBooleanField(verbose_name='Documentation received')), +                ('finds_deadline', models.DateField(null=True, verbose_name='Deadline for submission of the finds', blank=True)), +                ('finds_received', models.NullBooleanField(verbose_name='Finds received')), +                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326, null=True, verbose_name='Point', blank=True)), +                ('multi_polygon', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326, null=True, verbose_name='Multi polygon', blank=True)), +            ], +            options={ +                'ordering': ('cached_label',), +                'verbose_name': 'Operation', +                'verbose_name_plural': 'Operations', +                'permissions': (('view_operation', 'Peut voir toutes les Op\xe9rations'), ('view_own_operation', 'Peut voir sa propre Op\xe9ration'), ('add_own_operation', 'Peut ajouter sa propre Op\xe9ration'), ('change_own_operation', 'Peut modifier sa propre Op\xe9ration'), ('delete_own_operation', 'Peut supprimer sa propre Op\xe9ration'), ('close_operation', 'Peut clore une Op\xe9ration')), +            }, +            bases=(archaeological_operations.models.ClosedItem, models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter, ishtar_common.models.ShortMenuItem, ishtar_common.models.DashboardFormItem), +        ), +        migrations.CreateModel( +            name='OperationSource', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('title', models.CharField(max_length=300, verbose_name='Title')), +                ('external_id', models.TextField(max_length=300, null=True, verbose_name='External ID', blank=True)), +                ('scale', models.CharField(max_length=30, null=True, verbose_name='Scale', blank=True)), +                ('associated_url', models.URLField(null=True, verbose_name='Numerical ressource (web address)', blank=True)), +                ('receipt_date', models.DateField(null=True, verbose_name='Receipt date', blank=True)), +                ('creation_date', models.DateField(null=True, verbose_name='Creation date', blank=True)), +                ('receipt_date_in_documentation', models.DateField(null=True, verbose_name='Receipt date in documentation', blank=True)), +                ('item_number', models.IntegerField(default=1, verbose_name='Item number')), +                ('reference', models.CharField(max_length=100, null=True, verbose_name='Ref.', blank=True)), +                ('internal_reference', models.CharField(max_length=100, null=True, verbose_name='Internal ref.', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('additional_information', models.TextField(null=True, verbose_name='Additional information', blank=True)), +                ('duplicate', models.BooleanField(default=False, verbose_name='Has a duplicate')), +                ('index', models.IntegerField(null=True, verbose_name='Index', blank=True)), +            ], +            options={ +                'verbose_name': 'Operation documentation', +                'verbose_name_plural': 'Operation documentations', +                'permissions': (('view_operationsource', "Peut voir toutes les Documentations d'op\xe9ration"), ('view_own_operationsource', "Peut voir sa propre Documentation d'op\xe9ration"), ('add_own_operationsource', "Peut ajouter sa propre Documentation d'op\xe9ration"), ('change_own_operationsource', "Peut modifier sa propre Documentation d'op\xe9ration"), ('delete_own_operationsource', "Peut supprimer sa propre Documentation d'op\xe9ration")), +            }, +            bases=(ishtar_common.models.OwnPerms, models.Model), +        ), +        migrations.CreateModel( +            name='OperationTypeOld', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +                ('preventive', models.BooleanField(default=True, verbose_name='Is preventive')), +            ], +            options={ +                'ordering': ['-preventive', 'order', 'label'], +                'verbose_name': 'Operation type old', +                'verbose_name_plural': 'Operation types old', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Parcel', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('history_date', models.DateTimeField(default=datetime.datetime.now)), +                ('year', models.IntegerField(null=True, verbose_name='Year', blank=True)), +                ('section', models.CharField(max_length=4, null=True, verbose_name='Section', blank=True)), +                ('parcel_number', models.CharField(max_length=6, null=True, verbose_name='Parcel number', blank=True)), +                ('public_domain', models.BooleanField(default=False, verbose_name='Public domain')), +                ('external_id', models.CharField(max_length=100, null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +                ('address', models.TextField(null=True, verbose_name='Address - Locality', blank=True)), +            ], +            options={ +                'ordering': ('year', 'section', 'parcel_number'), +                'verbose_name': 'Parcel', +                'verbose_name_plural': 'Parcels', +            }, +        ), +        migrations.CreateModel( +            name='ParcelOwner', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('history_date', models.DateTimeField(default=datetime.datetime.now)), +                ('start_date', models.DateField(verbose_name='Start date')), +                ('end_date', models.DateField(verbose_name='End date')), +                ('history_creator', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('history_modifier', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True)), +            ], +            options={ +                'verbose_name': 'Parcel owner', +                'verbose_name_plural': 'Parcel owners', +            }, +        ), +        migrations.CreateModel( +            name='Period', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(verbose_name='Order')), +                ('start_date', models.IntegerField(verbose_name='Start date')), +                ('end_date', models.IntegerField(verbose_name='End date')), +                ('parent', models.ForeignKey(verbose_name='Parent period', blank=True, to='archaeological_operations.Period', null=True)), +            ], +            options={ +                'ordering': ('order',), +                'verbose_name': 'Type Period', +                'verbose_name_plural': 'Types Period', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='RecordRelations', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('left_record', models.ForeignKey(related_name='right_relations', to='archaeological_operations.Operation')), +            ], +            options={ +                'ordering': ('left_record', 'relation_type'), +                'verbose_name': 'Operation record relation', +                'verbose_name_plural': 'Operation record relations', +            }, +            bases=(ishtar_common.models.GeneralRecordRelations, models.Model), +        ), +        migrations.CreateModel( +            name='RelationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +                ('symmetrical', models.BooleanField(verbose_name='Symmetrical')), +                ('tiny_label', models.CharField(max_length=50, null=True, verbose_name='Tiny label', blank=True)), +                ('inverse_relation', models.ForeignKey(verbose_name='Inverse relation', blank=True, to='archaeological_operations.RelationType', null=True)), +            ], +            options={ +                'ordering': ('order', 'label'), +                'verbose_name': 'Operation relation type', +                'verbose_name_plural': 'Operation relation types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='RemainType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Remain type', +                'verbose_name_plural': 'Remain types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='ReportState', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(verbose_name='Order')), +            ], +            options={ +                'ordering': ('order',), +                'verbose_name': 'Type of report state', +                'verbose_name_plural': 'Types of report state', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.AddField( +            model_name='recordrelations', +            name='relation_type', +            field=models.ForeignKey(to='archaeological_operations.RelationType'), +        ), +        migrations.AddField( +            model_name='recordrelations', +            name='right_record', +            field=models.ForeignKey(related_name='left_relations', to='archaeological_operations.Operation'), +        ), +    ] diff --git a/archaeological_operations/migrations/0002_auto_20170414_2123.py b/archaeological_operations/migrations/0002_auto_20170414_2123.py new file mode 100644 index 000000000..fc9f93911 --- /dev/null +++ b/archaeological_operations/migrations/0002_auto_20170414_2123.py @@ -0,0 +1,365 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_finds', '0002_auto_20170414_2123'), +        ('archaeological_operations', '0001_initial'), +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +        ('ishtar_common', '0001_initial'), +        ('archaeological_files', '0002_auto_20170414_2123'), +    ] + +    operations = [ +        migrations.AddField( +            model_name='parcelowner', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_operations_parcelowner', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='parcelowner', +            name='owner', +            field=models.ForeignKey(related_name='parcel_owner', verbose_name='Owner', to='ishtar_common.Person'), +        ), +        migrations.AddField( +            model_name='parcelowner', +            name='parcel', +            field=models.ForeignKey(related_name='owners', verbose_name='Parcel', to='archaeological_operations.Parcel'), +        ), +        migrations.AddField( +            model_name='parcel', +            name='associated_file', +            field=models.ForeignKey(related_name='parcels', verbose_name='File', blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='parcel', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='parcel', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='parcel', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_operations_parcel', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='parcel', +            name='operation', +            field=models.ForeignKey(related_name='parcels', verbose_name='Operation', blank=True, to='archaeological_operations.Operation', null=True), +        ), +        migrations.AddField( +            model_name='parcel', +            name='town', +            field=models.ForeignKey(related_name='parcels', verbose_name='Town', to='ishtar_common.Town'), +        ), +        migrations.AddField( +            model_name='operationsource', +            name='authors', +            field=models.ManyToManyField(related_name='operationsource_related', verbose_name='Authors', to='ishtar_common.Author'), +        ), +        migrations.AddField( +            model_name='operationsource', +            name='format_type', +            field=models.ForeignKey(verbose_name='Format', blank=True, to='ishtar_common.Format', null=True), +        ), +        migrations.AddField( +            model_name='operationsource', +            name='operation', +            field=models.ForeignKey(related_name='source', verbose_name='Operation', to='archaeological_operations.Operation'), +        ), +        migrations.AddField( +            model_name='operationsource', +            name='source_type', +            field=models.ForeignKey(verbose_name='Type', to='ishtar_common.SourceType'), +        ), +        migrations.AddField( +            model_name='operationsource', +            name='support_type', +            field=models.ForeignKey(verbose_name='Support', blank=True, to='ishtar_common.SupportType', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='archaeological_sites', +            field=models.ManyToManyField(to='archaeological_operations.ArchaeologicalSite', verbose_name='Archaeological sites', blank=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='associated_file', +            field=models.ForeignKey(related_name='operations', verbose_name='File', blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='cira_rapporteur', +            field=models.ForeignKey(related_name='cira_rapporteur', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Rapporteur CIRA', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='collaborators', +            field=models.ManyToManyField(related_name='operation_collaborator', verbose_name='Collaborators', to='ishtar_common.Person', blank=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_operations_operation', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='in_charge', +            field=models.ForeignKey(related_name='operation_responsability', on_delete=django.db.models.deletion.SET_NULL, verbose_name='In charge', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='operation_type', +            field=models.ForeignKey(related_name='+', verbose_name='Operation type', to='ishtar_common.OperationType'), +        ), +        migrations.AddField( +            model_name='operation', +            name='operator', +            field=models.ForeignKey(related_name='operator', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Operator', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='periods', +            field=models.ManyToManyField(to='archaeological_operations.Period', verbose_name='Periods', blank=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='remains', +            field=models.ManyToManyField(to='archaeological_operations.RemainType', verbose_name='Remains', blank=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='report_processing', +            field=models.ForeignKey(verbose_name='Report processing', blank=True, to='archaeological_operations.ReportState', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='scientist', +            field=models.ForeignKey(related_name='operation_scientist_responsability', on_delete=django.db.models.deletion.SET_NULL, verbose_name='In charge scientist', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='operation', +            name='towns', +            field=models.ManyToManyField(related_name='operations', verbose_name='Towns', to='ishtar_common.Town'), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='associated_file', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='cira_rapporteur', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='in_charge', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='operation_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.OperationType', null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='operator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='report_processing', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_operations.ReportState', null=True), +        ), +        migrations.AddField( +            model_name='historicaloperation', +            name='scientist', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='act_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_operations.ActType', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='associated_file', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='in_charge', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='operation', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_operations.Operation', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='operator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='scientist', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='signatory', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='treatment', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.Treatment', null=True), +        ), +        migrations.AddField( +            model_name='historicaladministrativeact', +            name='treatment_file', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='archaeological_finds.TreatmentFile', null=True), +        ), +        migrations.AddField( +            model_name='archaeologicalsite', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='archaeologicalsite', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='archaeologicalsite', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_operations_archaeologicalsite', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='archaeologicalsite', +            name='periods', +            field=models.ManyToManyField(to='archaeological_operations.Period', verbose_name='Periods', blank=True), +        ), +        migrations.AddField( +            model_name='archaeologicalsite', +            name='remains', +            field=models.ManyToManyField(to='archaeological_operations.RemainType', verbose_name='Remains', blank=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='act_type', +            field=models.ForeignKey(verbose_name='Act type', to='archaeological_operations.ActType'), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='associated_file', +            field=models.ForeignKey(related_name='administrative_act', verbose_name='Archaeological file', blank=True, to='archaeological_files.File', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_operations_administrativeact', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='in_charge', +            field=models.ForeignKey(related_name='adminact_operation_in_charge', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Person in charge of the operation', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='operation', +            field=models.ForeignKey(related_name='administrative_act', verbose_name='Operation', blank=True, to='archaeological_operations.Operation', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='operator', +            field=models.ForeignKey(related_name='adminact_operator', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Archaeological preventive operator', blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='scientist', +            field=models.ForeignKey(related_name='adminact_scientist', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Scientist in charge', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='signatory', +            field=models.ForeignKey(related_name='signatory', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Signatory', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='treatment', +            field=models.ForeignKey(related_name='administrative_act', verbose_name='Treatment', blank=True, to='archaeological_finds.Treatment', null=True), +        ), +        migrations.AddField( +            model_name='administrativeact', +            name='treatment_file', +            field=models.ForeignKey(related_name='administrative_act', verbose_name='Treatment request', blank=True, to='archaeological_finds.TreatmentFile', null=True), +        ), +        migrations.AddField( +            model_name='acttype', +            name='associated_template', +            field=models.ManyToManyField(related_name='acttypes', verbose_name='Associated template', to='ishtar_common.DocumentTemplate', blank=True), +        ), +    ] diff --git a/archaeological_operations/migrations/0003_views.py b/archaeological_operations/migrations/0003_views.py new file mode 100644 index 000000000..1b8dd201f --- /dev/null +++ b/archaeological_operations/migrations/0003_views.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from archaeological_operations.models import OperationByDepartment + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_operations', '0002_auto_20170414_2123'), +    ] + +    operations = [ +        migrations.RunSQL(OperationByDepartment.CREATE_SQL) +    ] diff --git a/archaeological_operations/migrations/0068_auto__chg_field_historicaloperation_code_patriarche__chg_field_operati.py b/archaeological_operations/migrations/0068_auto__chg_field_historicaloperation_code_patriarche__chg_field_operati.py deleted file mode 100644 index 02ccdcd59..000000000 --- a/archaeological_operations/migrations/0068_auto__chg_field_historicaloperation_code_patriarche__chg_field_operati.py +++ /dev/null @@ -1,873 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -from archaeological_context_records.models import CRBulkView -from archaeological_finds.models import BFBulkView, FBulkView, FirstBaseFindView - -class Migration(SchemaMigration): - -    depends_on = ( -        ('archaeological_context_records', '0029_create_bulk_update_view.py'), -        ('archaeological_finds', '0085_create_bulk_update_view.py'), -    ) - -    def forwards(self, orm): -        for view in [FBulkView, BFBulkView, FirstBaseFindView, CRBulkView]: -            sql = view.DELETE_SQL -            db.execute(sql) - -        # Changing field 'HistoricalOperation.code_patriarche' -        db.alter_column('archaeological_operations_historicaloperation', 'code_patriarche', self.gf('django.db.models.fields.TextField')(null=True)) - -        # Changing field 'Operation.code_patriarche' -        db.alter_column('archaeological_operations_operation', 'code_patriarche', self.gf('django.db.models.fields.TextField')(unique=True, null=True)) - -        for view in [CRBulkView, FirstBaseFindView, BFBulkView, FBulkView]: -            sql = view.CREATE_SQL -            db.execute(sql) - -    def backwards(self, orm): -        for view in [FBulkView, BFBulkView, FirstBaseFindView, CRBulkView]: -            sql = view.DELETE_SQL -            db.execute(sql) - -        # Changing field 'HistoricalOperation.code_patriarche' -        db.alter_column('archaeological_operations_historicaloperation', 'code_patriarche', self.gf('django.db.models.fields.IntegerField')(null=True)) - -        # Changing field 'Operation.code_patriarche' -        db.alter_column('archaeological_operations_operation', 'code_patriarche', self.gf('django.db.models.fields.IntegerField')(unique=True, null=True)) - -        for view in [CRBulkView, FirstBaseFindView, BFBulkView, FBulkView]: -            sql = view.CREATE_SQL -            db.execute(sql) - -    models = { -        'archaeological_files.file': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cira_advised': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'classified_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'corporation_general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'departments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_line': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_files_file'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'instruction_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'locality': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'main_town': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_main'", 'null': 'True', 'to': "orm['ishtar_common.Town']"}), -            'mh_listing': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'mh_register': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'permit_reference': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'protected_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'raw_general_contractor': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'raw_town_planning_service': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.OperationType']"}), -            'research_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'responsible_town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'responsible_town_planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'total_developed_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {'default': '30'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatment': { -            'Meta': {'unique_together': "(('year', 'index'),)", 'object_name': 'Treatment'}, -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']", 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), -            'goal': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatment'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'insurance_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'other_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'quoted_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'realized_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'target_is_basket': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'treatment_state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentState']", 'null': 'True', 'blank': 'True'}), -            'treatment_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_finds.TreatmentType']", 'symmetrical': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.treatmentfile': { -            'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('year', 'index'),)", 'object_name': 'TreatmentFile'}, -            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_applicant'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'applicant_organisation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_applicant'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatmentfile'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentFileType']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.treatmentfiletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentFileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatmentstate': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatmenttype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentType']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), -            'upstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'virtual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) -        }, -        'archaeological_operations.acttype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ActType'}, -            'associated_template': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'acttypes'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.DocumentTemplate']"}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'indexed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.administrativeact': { -            'Meta': {'ordering': "('year', 'signature_date', 'index', 'act_type')", 'object_name': 'AdministrativeAct'}, -            'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_administrativeact'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operation_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'signatory'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), -            'treatment_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.archaeologicalsite': { -            'Meta': {'object_name': 'ArchaeologicalSite'}, -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_archaeologicalsite'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.historicaladministrativeact': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalAdministrativeAct'}, -            'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'act_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), -            'scientist_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'signatory_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'treatment_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.historicaloperation': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOperation'}, -            'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'cira_rapporteur_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'code_patriarche': ('django.db.models.fields.TextField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), -            'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), -            'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'report_processing_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'scientist_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'Operation'}, -            'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.ArchaeologicalSite']", 'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'cira_rapporteur': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cira_rapporteur'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'code_patriarche': ('django.db.models.fields.TextField', [], {'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'collaborators': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'operation_collaborator'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Person']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_operation'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), -            'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.OperationType']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}), -            'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'report_processing': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ReportState']", 'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_scientist_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operations'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operationbydepartment': { -            'Meta': {'object_name': 'OperationByDepartment', 'db_table': "'operation_department'", 'managed': 'False'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Operation']"}) -        }, -        'archaeological_operations.operationsource': { -            'Meta': {'object_name': 'OperationSource'}, -            'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operationsource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'blank': 'True'}), -            'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_operations.Operation']"}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}) -        }, -        'archaeological_operations.operationtypeold': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationTypeOld'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'ordering': "('year', 'section', 'parcel_number')", 'object_name': 'Parcel'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcel'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), -            'public_domain': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.parcelowner': { -            'Meta': {'object_name': 'ParcelOwner'}, -            'end_date': ('django.db.models.fields.DateField', [], {}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcelowner'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcel_owner'", 'to': "orm['ishtar_common.Person']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owners'", 'to': "orm['archaeological_operations.Parcel']"}), -            'start_date': ('django.db.models.fields.DateField', [], {}) -        }, -        'archaeological_operations.period': { -            'Meta': {'ordering': "('order',)", 'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.recordrelations': { -            'Meta': {'ordering': "('left_record', 'relation_type')", 'object_name': 'RecordRelations'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'left_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'right_relations'", 'to': "orm['archaeological_operations.Operation']"}), -            'relation_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.RelationType']"}), -            'right_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'left_relations'", 'to': "orm['archaeological_operations.Operation']"}) -        }, -        'archaeological_operations.relationtype': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'RelationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'inverse_relation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.RelationType']", 'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'symmetrical': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'tiny_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.reportstate': { -            'Meta': {'ordering': "('order',)", 'object_name': 'ReportState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_warehouse.container': { -            'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('index', 'location'),)", 'object_name': 'Container'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cached_location': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}), -            'responsible': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owned_containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.containertype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ContainerType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.warehouse': { -            'Meta': {'object_name': 'Warehouse'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'associated_divisions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']", 'symmetrical': 'False', 'through': "orm['archaeological_warehouse.WarehouseDivisionLink']", 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_warehouse'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'warehouse_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) -        }, -        'archaeological_warehouse.warehousedivision': { -            'Meta': {'object_name': 'WarehouseDivision'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_warehouse.warehousedivisionlink': { -            'Meta': {'ordering': "('warehouse', 'order')", 'unique_together': "(('warehouse', 'division'),)", 'object_name': 'WarehouseDivisionLink'}, -            'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}) -        }, -        'archaeological_warehouse.warehousetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'WarehouseType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'ordering': "('author_type__order', 'person__name')", 'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'ordering': "['order', 'label']", 'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}), -            'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.documenttemplate': { -            'Meta': {'ordering': "['associated_object_name', 'name']", 'object_name': 'DocumentTemplate'}, -            'associated_object_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'template': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) -        }, -        'ishtar_common.format': { -            'Meta': {'ordering': "['label']", 'object_name': 'Format'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.import': { -            'Meta': {'object_name': 'Import'}, -            'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), -            'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), -            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '220'}), -            'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '220', 'null': 'True', 'blank': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), -            'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), -            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) -        }, -        'ishtar_common.importermodel': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterModel'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'klass': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'ishtar_common.importertype': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterType'}, -            'associated_models': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.ImporterModel']"}), -            'created_models': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.ImporterModel']"}), -            'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.ishtaruser': { -            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, -            'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), -            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) -        }, -        'ishtar_common.operationtype': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'ordering': "['label']", 'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.state': { -            'Meta': {'ordering': "['number']", 'object_name': 'State'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.supporttype': { -            'Meta': {'object_name': 'SupportType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.titletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_town'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        } -    } - -    complete_apps = ['archaeological_operations']
\ No newline at end of file diff --git a/archaeological_operations/migrations/0069_auto__chg_field_operationsource_external_id.py b/archaeological_operations/migrations/0069_auto__chg_field_operationsource_external_id.py deleted file mode 100644 index 3ad5be00b..000000000 --- a/archaeological_operations/migrations/0069_auto__chg_field_operationsource_external_id.py +++ /dev/null @@ -1,846 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): - -        # Changing field 'OperationSource.external_id' -        db.alter_column('archaeological_operations_operationsource', 'external_id', self.gf('django.db.models.fields.TextField')(max_length=300, null=True)) - -    def backwards(self, orm): - -        # Changing field 'OperationSource.external_id' -        db.alter_column('archaeological_operations_operationsource', 'external_id', self.gf('django.db.models.fields.CharField')(max_length=12, null=True)) - -    models = { -        'archaeological_files.file': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cira_advised': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'classified_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'corporation_general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'departments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), -            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), -            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_line': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_files_file'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'instruction_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), -            'locality': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'main_town': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_main'", 'null': 'True', 'to': "orm['ishtar_common.Town']"}), -            'mh_listing': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'mh_register': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'numeric_reference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'permit_reference': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), -            'planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'protected_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'raw_general_contractor': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'raw_town_planning_service': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), -            'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.OperationType']"}), -            'research_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'responsible_town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'responsible_town_planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'total_developed_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'total_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_files.filetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'FileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.permittype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PermitType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_files.saisinetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'SaisineType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'delay': ('django.db.models.fields.IntegerField', [], {'default': '30'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatment': { -            'Meta': {'unique_together': "(('year', 'index'),)", 'object_name': 'Treatment'}, -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']", 'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'estimated_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), -            'goal': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatment'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'insurance_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}), -            'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'other_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'quoted_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'realized_cost': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'target_is_basket': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'treatment_state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentState']", 'null': 'True', 'blank': 'True'}), -            'treatment_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_finds.TreatmentType']", 'symmetrical': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.treatmentfile': { -            'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('year', 'index'),)", 'object_name': 'TreatmentFile'}, -            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_applicant'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'applicant_organisation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_applicant'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatmentfile'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentFileType']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'default': '2017'}) -        }, -        'archaeological_finds.treatmentfiletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentFileType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatmentstate': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_finds.treatmenttype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'downstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentType']", 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), -            'upstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'virtual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) -        }, -        'archaeological_operations.acttype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ActType'}, -            'associated_template': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'acttypes'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.DocumentTemplate']"}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'indexed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.administrativeact': { -            'Meta': {'ordering': "('year', 'signature_date', 'index', 'act_type')", 'object_name': 'AdministrativeAct'}, -            'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_administrativeact'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operation_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'signatory'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), -            'treatment_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.archaeologicalsite': { -            'Meta': {'object_name': 'ArchaeologicalSite'}, -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_archaeologicalsite'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.historicaladministrativeact': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalAdministrativeAct'}, -            'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'act_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), -            'scientist_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'signatory_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'treatment_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.historicaloperation': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOperation'}, -            'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'cira_rapporteur_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'code_patriarche': ('django.db.models.fields.TextField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), -            'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), -            'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'report_processing_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'scientist_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operation': { -            'Meta': {'ordering': "('cached_label',)", 'object_name': 'Operation'}, -            'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.ArchaeologicalSite']", 'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'cira_rapporteur': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cira_rapporteur'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'code_patriarche': ('django.db.models.fields.TextField', [], {'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'collaborators': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'operation_collaborator'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Person']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), -            'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_operation'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), -            'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), -            'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.OperationType']"}), -            'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), -            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), -            'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), -            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}), -            'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'report_processing': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ReportState']", 'null': 'True', 'blank': 'True'}), -            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_scientist_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operations'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), -            'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.operationbydepartment': { -            'Meta': {'object_name': 'OperationByDepartment', 'db_table': "'operation_department'", 'managed': 'False'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Operation']"}) -        }, -        'archaeological_operations.operationsource': { -            'Meta': {'object_name': 'OperationSource'}, -            'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operationsource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_operations.Operation']"}), -            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), -            'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}) -        }, -        'archaeological_operations.operationtypeold': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationTypeOld'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.parcel': { -            'Meta': {'ordering': "('year', 'section', 'parcel_number')", 'object_name': 'Parcel'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'external_id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcel'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), -            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), -            'public_domain': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'section': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), -            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_operations.parcelowner': { -            'Meta': {'object_name': 'ParcelOwner'}, -            'end_date': ('django.db.models.fields.DateField', [], {}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcelowner'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcel_owner'", 'to': "orm['ishtar_common.Person']"}), -            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owners'", 'to': "orm['archaeological_operations.Parcel']"}), -            'start_date': ('django.db.models.fields.DateField', [], {}) -        }, -        'archaeological_operations.period': { -            'Meta': {'ordering': "('order',)", 'object_name': 'Period'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'end_date': ('django.db.models.fields.IntegerField', [], {}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), -            'start_date': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.recordrelations': { -            'Meta': {'ordering': "('left_record', 'relation_type')", 'object_name': 'RecordRelations'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'left_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'right_relations'", 'to': "orm['archaeological_operations.Operation']"}), -            'relation_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.RelationType']"}), -            'right_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'left_relations'", 'to': "orm['archaeological_operations.Operation']"}) -        }, -        'archaeological_operations.relationtype': { -            'Meta': {'ordering': "('order', 'label')", 'object_name': 'RelationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'inverse_relation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.RelationType']", 'null': 'True', 'blank': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'symmetrical': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'tiny_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.remaintype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'RemainType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_operations.reportstate': { -            'Meta': {'ordering': "('order',)", 'object_name': 'ReportState'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_warehouse.container': { -            'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('index', 'location'),)", 'object_name': 'Container'}, -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'cached_location': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}), -            'responsible': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owned_containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), -            'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.containertype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'ContainerType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), -            'volume': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.warehouse': { -            'Meta': {'object_name': 'Warehouse'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'associated_divisions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']", 'symmetrical': 'False', 'through': "orm['archaeological_warehouse.WarehouseDivisionLink']", 'blank': 'True'}), -            'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'external_id': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_warehouse'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'warehouse_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) -        }, -        'archaeological_warehouse.warehousedivision': { -            'Meta': {'object_name': 'WarehouseDivision'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'archaeological_warehouse.warehousedivisionlink': { -            'Meta': {'ordering': "('warehouse', 'order')", 'unique_together': "(('warehouse', 'division'),)", 'object_name': 'WarehouseDivisionLink'}, -            'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}) -        }, -        'archaeological_warehouse.warehousetype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'WarehouseType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'ordering': "('author_type__order', 'person__name')", 'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'ordering': "['order', 'label']", 'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}), -            'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.documenttemplate': { -            'Meta': {'ordering': "['associated_object_name', 'name']", 'object_name': 'DocumentTemplate'}, -            'associated_object_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'template': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) -        }, -        'ishtar_common.format': { -            'Meta': {'ordering': "['label']", 'object_name': 'Format'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.import': { -            'Meta': {'object_name': 'Import'}, -            'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), -            'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), -            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '220'}), -            'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '220', 'null': 'True', 'blank': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), -            'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), -            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) -        }, -        'ishtar_common.importermodel': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterModel'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'klass': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'ishtar_common.importertype': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterType'}, -            'associated_models': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.ImporterModel']"}), -            'created_models': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.ImporterModel']"}), -            'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.ishtaruser': { -            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, -            'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), -            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) -        }, -        'ishtar_common.operationtype': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'ordering': "['label']", 'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.state': { -            'Meta': {'ordering': "['number']", 'object_name': 'State'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.supporttype': { -            'Meta': {'object_name': 'SupportType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.titletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_town'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        } -    } - -    complete_apps = ['archaeological_operations']
\ No newline at end of file diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index c4fd0d96e..12773f495 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2012-2016 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2012-2017 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -86,24 +86,24 @@ class ArchaeologicalSite(BaseHistorizedItem):      name = models.CharField(_(u"Name"), max_length=200,                              null=True, blank=True)      periods = models.ManyToManyField(Period, verbose_name=_(u"Periods"), -                                     blank=True, null=True) +                                     blank=True)      remains = models.ManyToManyField("RemainType", verbose_name=_(u'Remains'), -                                     blank=True, null=True) +                                     blank=True)      class Meta:          verbose_name = _(u"Archaeological site")          verbose_name_plural = _(u"Archaeological sites")          permissions = (              ("view_archaeologicalsite", -             ugettext(u"Can view all Archaeological sites")), +             u"Can view all Archaeological sites"),              ("view_own_archaeologicalsite", -             ugettext(u"Can view own Archaeological site")), +             u"Can view own Archaeological site"),              ("add_own_archaeologicalsite", -             ugettext(u"Can add own Archaeological site")), +             u"Can add own Archaeological site"),              ("change_own_archaeologicalsite", -             ugettext(u"Can change own Archaeological site")), +             u"Can change own Archaeological site"),              ("delete_own_archaeologicalsite", -             ugettext(u"Can delete own Archaeological site")), +             u"Can delete own Archaeological site"),          )      def __unicode__(self): @@ -270,7 +270,7 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,                                    on_delete=models.SET_NULL,                                    related_name='operation_responsability')      collaborators = models.ManyToManyField( -        Person, blank=True, null=True, verbose_name=_(u"Collaborators"), +        Person, blank=True, verbose_name=_(u"Collaborators"),          related_name='operation_collaborator'      )      year = models.IntegerField(_(u"Year"), null=True, blank=True) @@ -284,13 +284,13 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,                                         verbose_name=_(u"Operation type"))      surface = models.IntegerField(_(u"Surface (m2)"), blank=True, null=True)      remains = models.ManyToManyField("RemainType", verbose_name=_(u'Remains'), -                                     null=True, blank=True) +                                     blank=True)      towns = models.ManyToManyField(Town, verbose_name=_(u"Towns"),                                     related_name='operations')      cost = models.IntegerField(_(u"Cost (euros)"),                                 blank=True, null=True)  # preventive      periods = models.ManyToManyField(Period, verbose_name=_(u"Periods"), -                                     null=True, blank=True) +                                     blank=True)      # preventive      scheduled_man_days = models.IntegerField(_(u"Scheduled man-days"),                                               blank=True, null=True) @@ -343,7 +343,7 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,                                      null=True, blank=True)      archaeological_sites = models.ManyToManyField(          ArchaeologicalSite, verbose_name=_(u"Archaeological sites"), -        null=True, blank=True) +        blank=True)      virtual_operation = models.BooleanField(          _(u"Virtual operation"),          default=False, help_text=_( @@ -372,12 +372,12 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,          verbose_name = _(u"Operation")          verbose_name_plural = _(u"Operations")          permissions = ( -            ("view_operation", ugettext(u"Can view all Operations")), -            ("view_own_operation", ugettext(u"Can view own Operation")), -            ("add_own_operation", ugettext(u"Can add own Operation")), -            ("change_own_operation", ugettext(u"Can change own Operation")), -            ("delete_own_operation", ugettext(u"Can delete own Operation")), -            ("close_operation", ugettext(u"Can close Operation")), +            ("view_operation", u"Can view all Operations"), +            ("view_own_operation", u"Can view own Operation"), +            ("add_own_operation", u"Can add own Operation"), +            ("change_own_operation", u"Can change own Operation"), +            ("delete_own_operation", u"Can delete own Operation"), +            ("close_operation", u"Can close Operation"),          )          ordering = ('cached_label',) @@ -573,12 +573,12 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,          return round(float(self.cost) / self.surface, 2)      @classmethod -    def get_query_owns(cls, user): +    def get_query_owns(cls, ishtaruser):          return ( -            Q(in_charge=user.ishtaruser.person) | -            Q(scientist=user.ishtaruser.person) | -            Q(collaborators__pk=user.ishtaruser.person.pk) | -            Q(history_creator=user)) & Q(end_date__isnull=True) +            Q(in_charge=ishtaruser.person) | +            Q(scientist=ishtaruser.person) | +            Q(collaborators__pk=ishtaruser.person.pk) | +            Q(history_creator=ishtaruser.user_ptr)) & Q(end_date__isnull=True)      def is_active(self):          return not bool(self.end_date) @@ -846,6 +846,22 @@ class OperationByDepartment(models.Model):      """      Database view for dashboard      """ +    CREATE_SQL = """ +    CREATE VIEW operation_department (id, department_id, operation_id) as +        select town."id", town."departement_id", +               operation_towns."operation_id" +                from ishtar_common_town town +                inner join archaeological_operations_operation_towns +                           operation_towns +                    on operation_towns."town_id"=town."id" +                order by town."departement_id"; +    CREATE RULE operation_department_delete +              AS ON DELETE TO operation_department DO INSTEAD(); +    """ +    DELETE_SQL = """ +    DROP VIEW operation_department; +    """ +      operation = models.ForeignKey(Operation, verbose_name=_(u"Operation"))      department = models.ForeignKey(Department, verbose_name=_(u"Department"),                                     blank=True, null=True) @@ -912,10 +928,10 @@ class OperationSource(Source):                                     self.index)      @classmethod -    def get_query_owns(cls, user): -        return (Q(operation__in_charge=user.ishtaruser.person) | -                Q(operation__scientist=user.ishtaruser.person) | -                Q(operation__collaborators__pk=user.ishtaruser.person.pk)) \ +    def get_query_owns(cls, ishtaruser): +        return (Q(operation__in_charge=ishtaruser.person) | +                Q(operation__scientist=ishtaruser.person) | +                Q(operation__collaborators__pk=ishtaruser.person.pk)) \                 & Q(operation__end_date__isnull=True) @@ -929,7 +945,7 @@ class ActType(GeneralType):                                     choices=TYPE)      code = models.CharField(_(u"Code"), max_length=10, blank=True, null=True)      associated_template = models.ManyToManyField( -        DocumentTemplate, blank=True, null=True, +        DocumentTemplate, blank=True,          verbose_name=_(u"Associated template"), related_name='acttypes')      indexed = models.BooleanField(_(u"Indexed"), default=False) @@ -1064,15 +1080,15 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter):          verbose_name_plural = _(u"Administrative acts")          permissions = (              ("view_administrativeact", -             ugettext(u"Can view all Administrative acts")), +             u"Can view all Administrative acts"),              ("view_own_administrativeact", -             ugettext(u"Can view own Administrative act")), +             u"Can view own Administrative act"),              ("add_own_administrativeact", -             ugettext(u"Can add own Administrative act")), +             u"Can add own Administrative act"),              ("change_own_administrativeact", -             ugettext(u"Can change own Administrative act")), +             u"Can change own Administrative act"),              ("delete_own_administrativeact", -             ugettext(u"Can delete own Administrative act")), +             u"Can delete own Administrative act"),          )      def __unicode__(self): diff --git a/archaeological_operations/old_migrations/0001_initial.py b/archaeological_operations/old_migrations/0001_initial.py new file mode 100644 index 000000000..c5b4619ab --- /dev/null +++ b/archaeological_operations/old_migrations/0001_initial.py @@ -0,0 +1,655 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): +    depends_on = (('archaeological_files', '0001_initial.py'), ) + +    def forwards(self, orm): +        # Adding model 'OperationType' +        db.create_table('archaeological_operations_operationtype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_operations', ['OperationType']) + +        # Adding model 'RemainType' +        db.create_table('archaeological_operations_remaintype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_operations', ['RemainType']) + +        # Adding model 'Period' +        db.create_table('archaeological_operations_period', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +            ('start_date', self.gf('django.db.models.fields.IntegerField')()), +            ('end_date', self.gf('django.db.models.fields.IntegerField')()), +            ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Period'], null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_operations', ['Period']) + +        # Adding model 'HistoricalOperation' +        db.create_table('archaeological_operations_historicaloperation', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('excavation_end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('in_charge_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('year', self.gf('django.db.models.fields.IntegerField')()), +            ('operation_code', self.gf('django.db.models.fields.IntegerField')()), +            ('associated_file_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('operation_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('scheduled_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('optional_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('effective_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('code_patriarche', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('code_dracar', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('fnap_financing', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), +            ('fnap_cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('zoning_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('large_area_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('geoarchaeological_context_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('operator_reference', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True)), +            ('common_name', self.gf('django.db.models.fields.CharField')(max_length=120, null=True, blank=True)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_operations', ['HistoricalOperation']) + +        # Adding model 'Operation' +        db.create_table('archaeological_operations_operation', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('start_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('excavation_end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('end_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('in_charge', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), +            ('year', self.gf('django.db.models.fields.IntegerField')()), +            ('operation_code', self.gf('django.db.models.fields.IntegerField')()), +            ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='operations', null=True, to=orm['archaeological_files.File'])), +            ('operation_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['archaeological_operations.OperationType'])), +            ('surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('scheduled_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('optional_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('effective_man_days', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('code_patriarche', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('code_dracar', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('fnap_financing', self.gf('django.db.models.fields.FloatField')(null=True, blank=True)), +            ('fnap_cost', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('zoning_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('large_area_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('geoarchaeological_context_prescription', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)), +            ('operator_reference', self.gf('django.db.models.fields.CharField')(max_length=20, null=True, blank=True)), +            ('common_name', self.gf('django.db.models.fields.CharField')(max_length=120, null=True, blank=True)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_operations', ['Operation']) + +        # Adding M2M table for field remains on 'Operation' +        db.create_table('archaeological_operations_operation_remains', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('operation', models.ForeignKey(orm['archaeological_operations.operation'], null=False)), +            ('remaintype', models.ForeignKey(orm['archaeological_operations.remaintype'], null=False)) +        )) +        db.create_unique('archaeological_operations_operation_remains', ['operation_id', 'remaintype_id']) + +        # Adding M2M table for field towns on 'Operation' +        db.create_table('archaeological_operations_operation_towns', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('operation', models.ForeignKey(orm['archaeological_operations.operation'], null=False)), +            ('town', models.ForeignKey(orm['ishtar_common.town'], null=False)) +        )) +        db.create_unique('archaeological_operations_operation_towns', ['operation_id', 'town_id']) + +        # Adding M2M table for field periods on 'Operation' +        db.create_table('archaeological_operations_operation_periods', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('operation', models.ForeignKey(orm['archaeological_operations.operation'], null=False)), +            ('period', models.ForeignKey(orm['archaeological_operations.period'], null=False)) +        )) +        db.create_unique('archaeological_operations_operation_periods', ['operation_id', 'period_id']) + +        # Adding model 'OperationSource' +        db.create_table('archaeological_operations_operationsource', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('title', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])), +            ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)), +            ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_operations.Operation'])), +            ('index', self.gf('django.db.models.fields.IntegerField')()), +        )) +        db.send_create_signal('archaeological_operations', ['OperationSource']) + +        # Adding M2M table for field authors on 'OperationSource' +        db.create_table('archaeological_operations_operationsource_authors', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('operationsource', models.ForeignKey(orm['archaeological_operations.operationsource'], null=False)), +            ('author', models.ForeignKey(orm['ishtar_common.author'], null=False)) +        )) +        db.create_unique('archaeological_operations_operationsource_authors', ['operationsource_id', 'author_id']) + +        # Adding model 'ActType' +        db.create_table('archaeological_operations_acttype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('intented_to', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_operations', ['ActType']) + +        # Adding model 'HistoricalAdministrativeAct' +        db.create_table('archaeological_operations_historicaladministrativeact', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('act_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('in_charge_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('operator_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('scientific_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('signatory_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('operation_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('associated_file_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('signature_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('act_object', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('ref_sra', self.gf('django.db.models.fields.CharField')(max_length=15)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('archaeological_operations', ['HistoricalAdministrativeAct']) + +        # Adding model 'AdministrativeAct' +        db.create_table('archaeological_operations_administrativeact', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('act_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.ActType'])), +            ('in_charge', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), +            ('operator', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Organization'], null=True, blank=True)), +            ('scientific', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), +            ('signatory', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['ishtar_common.Person'])), +            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='administrative_act', null=True, to=orm['archaeological_operations.Operation'])), +            ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='administrative_act', null=True, to=orm['archaeological_files.File'])), +            ('signature_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)), +            ('act_object', self.gf('django.db.models.fields.CharField')(max_length=200)), +            ('ref_sra', self.gf('django.db.models.fields.CharField')(max_length=15)), +        )) +        db.send_create_signal('archaeological_operations', ['AdministrativeAct']) + +        # Adding model 'Parcel' +        db.create_table('archaeological_operations_parcel', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), +            ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='parcels', null=True, to=orm['archaeological_files.File'])), +            ('operation', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='parcels', null=True, to=orm['archaeological_operations.Operation'])), +            ('year', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('town', self.gf('django.db.models.fields.related.ForeignKey')(related_name='parcels', to=orm['ishtar_common.Town'])), +            ('section', self.gf('django.db.models.fields.CharField')(max_length=4)), +            ('parcel_number', self.gf('django.db.models.fields.CharField')(max_length=6)), +        )) +        db.send_create_signal('archaeological_operations', ['Parcel']) + +        # Adding model 'ParcelOwner' +        db.create_table('archaeological_operations_parcelowner', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), +            ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])), +            ('parcel', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Parcel'])), +            ('start_date', self.gf('django.db.models.fields.DateField')()), +            ('end_date', self.gf('django.db.models.fields.DateField')()), +        )) +        db.send_create_signal('archaeological_operations', ['ParcelOwner']) + + +    def backwards(self, orm): +        # Deleting model 'OperationType' +        db.delete_table('archaeological_operations_operationtype') + +        # Deleting model 'RemainType' +        db.delete_table('archaeological_operations_remaintype') + +        # Deleting model 'Period' +        db.delete_table('archaeological_operations_period') + +        # Deleting model 'HistoricalOperation' +        db.delete_table('archaeological_operations_historicaloperation') + +        # Deleting model 'Operation' +        db.delete_table('archaeological_operations_operation') + +        # Removing M2M table for field remains on 'Operation' +        db.delete_table('archaeological_operations_operation_remains') + +        # Removing M2M table for field towns on 'Operation' +        db.delete_table('archaeological_operations_operation_towns') + +        # Removing M2M table for field periods on 'Operation' +        db.delete_table('archaeological_operations_operation_periods') + +        # Deleting model 'OperationSource' +        db.delete_table('archaeological_operations_operationsource') + +        # Removing M2M table for field authors on 'OperationSource' +        db.delete_table('archaeological_operations_operationsource_authors') + +        # Deleting model 'ActType' +        db.delete_table('archaeological_operations_acttype') + +        # Deleting model 'HistoricalAdministrativeAct' +        db.delete_table('archaeological_operations_historicaladministrativeact') + +        # Deleting model 'AdministrativeAct' +        db.delete_table('archaeological_operations_administrativeact') + +        # Deleting model 'Parcel' +        db.delete_table('archaeological_operations_parcel') + +        # Deleting model 'ParcelOwner' +        db.delete_table('archaeological_operations_parcelowner') + + +    models = { +        'archaeological_files.file': { +            'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), +            'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}), +            'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}), +            'numeric_reference': ('django.db.models.fields.IntegerField', [], {}), +            'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), +            'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), +            'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), +            'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'}) +        }, +        'archaeological_files.filetype': { +            'Meta': {'object_name': 'FileType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.permittype': { +            'Meta': {'object_name': 'PermitType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_files.saisinetype': { +            'Meta': {'object_name': 'SaisineType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'delay': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.acttype': { +            'Meta': {'object_name': 'ActType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.administrativeact': { +            'Meta': {'object_name': 'AdministrativeAct'}, +            'act_object': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), +            'operator': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15'}), +            'scientific': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.historicaladministrativeact': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalAdministrativeAct'}, +            'act_object': ('django.db.models.fields.CharField', [], {'max_length': '200'}), +            'act_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15'}), +            'scientific_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'signatory_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.historicaloperation': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOperation'}, +            'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), +            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), +            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'operation_code': ('django.db.models.fields.IntegerField', [], {}), +            'operation_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), +            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'year': ('django.db.models.fields.IntegerField', [], {}), +            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.operation': { +            'Meta': {'object_name': 'Operation'}, +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), +            'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), +            'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), +            'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), +            'operation_code': ('django.db.models.fields.IntegerField', [], {}), +            'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}), +            'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), +            'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}), +            'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}), +            'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}), +            'year': ('django.db.models.fields.IntegerField', [], {}), +            'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.operationbydepartment': { +            'Meta': {'object_name': 'OperationByDepartment', 'db_table': "'operation_department'", 'managed': 'False'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Operation']"}) +        }, +        'archaeological_operations.operationsource': { +            'Meta': {'object_name': 'OperationSource'}, +            'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), +            'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}), +            'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'index': ('django.db.models.fields.IntegerField', [], {}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_operations.Operation']"}), +            'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), +            'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) +        }, +        'archaeological_operations.operationtype': { +            'Meta': {'object_name': 'OperationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.parcel': { +            'Meta': {'object_name': 'Parcel'}, +            'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), +            'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}), +            'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}), +            'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), +            'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_operations.parcelowner': { +            'Meta': {'object_name': 'ParcelOwner'}, +            'end_date': ('django.db.models.fields.DateField', [], {}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}), +            'parcel': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Parcel']"}), +            'start_date': ('django.db.models.fields.DateField', [], {}) +        }, +        'archaeological_operations.period': { +            'Meta': {'object_name': 'Period'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'end_date': ('django.db.models.fields.IntegerField', [], {}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), +            'start_date': ('django.db.models.fields.IntegerField', [], {}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'archaeological_operations.remaintype': { +            'Meta': {'object_name': 'RemainType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'auth.group': { +            'Meta': {'object_name': 'Group'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), +            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) +        }, +        'auth.permission': { +            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, +            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) +        }, +        'auth.user': { +            'Meta': {'object_name': 'User'}, +            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), +            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), +            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), +            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'contenttypes.contenttype': { +            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, +            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) +        }, +        'ishtar_common.arrondissement': { +            'Meta': {'object_name': 'Arrondissement'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.author': { +            'Meta': {'object_name': 'Author'}, +            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) +        }, +        'ishtar_common.authortype': { +            'Meta': {'object_name': 'AuthorType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.canton': { +            'Meta': {'object_name': 'Canton'}, +            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.department': { +            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) +        }, +        'ishtar_common.organization': { +            'Meta': {'object_name': 'Organization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.organizationtype': { +            'Meta': {'object_name': 'OrganizationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.person': { +            'Meta': {'object_name': 'Person'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.persontype': { +            'Meta': {'object_name': 'PersonType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.sourcetype': { +            'Meta': {'object_name': 'SourceType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.town': { +            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, +            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), +            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), +            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.wizard': { +            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) +        }, +        'ishtar_common.wizardstep': { +            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) +        } +    } + +    complete_apps = ['archaeological_operations'] diff --git a/archaeological_operations/migrations/0002_views.py b/archaeological_operations/old_migrations/0002_views.py index a9d4e3665..a9d4e3665 100644 --- a/archaeological_operations/migrations/0002_views.py +++ b/archaeological_operations/old_migrations/0002_views.py diff --git a/archaeological_operations/migrations/0003_auto__add_field_operationtype_preventive.py b/archaeological_operations/old_migrations/0003_auto__add_field_operationtype_preventive.py index 4f13d1e9f..4f13d1e9f 100644 --- a/archaeological_operations/migrations/0003_auto__add_field_operationtype_preventive.py +++ b/archaeological_operations/old_migrations/0003_auto__add_field_operationtype_preventive.py diff --git a/archaeological_operations/migrations/0004_auto__chg_field_historicaloperation_year__chg_field_operation_year.py b/archaeological_operations/old_migrations/0004_auto__chg_field_historicaloperation_year__chg_field_operation_year.py index 2747317d3..2747317d3 100644 --- a/archaeological_operations/migrations/0004_auto__chg_field_historicaloperation_year__chg_field_operation_year.py +++ b/archaeological_operations/old_migrations/0004_auto__chg_field_historicaloperation_year__chg_field_operation_year.py diff --git a/archaeological_operations/migrations/0005_auto__chg_field_historicaloperation_operation_code__chg_field_operatio.py b/archaeological_operations/old_migrations/0005_auto__chg_field_historicaloperation_operation_code__chg_field_operatio.py index 5465c9909..5465c9909 100644 --- a/archaeological_operations/migrations/0005_auto__chg_field_historicaloperation_operation_code__chg_field_operatio.py +++ b/archaeological_operations/old_migrations/0005_auto__chg_field_historicaloperation_operation_code__chg_field_operatio.py diff --git a/archaeological_operations/migrations/0006_auto__add_field_operationsource_reference__add_field_operationsource_i.py b/archaeological_operations/old_migrations/0006_auto__add_field_operationsource_reference__add_field_operationsource_i.py index 65a281677..65a281677 100644 --- a/archaeological_operations/migrations/0006_auto__add_field_operationsource_reference__add_field_operationsource_i.py +++ b/archaeological_operations/old_migrations/0006_auto__add_field_operationsource_reference__add_field_operationsource_i.py diff --git a/archaeological_operations/migrations/0007_auto__chg_field_administrativeact_ref_sra__chg_field_historicaladminis.py b/archaeological_operations/old_migrations/0007_auto__chg_field_administrativeact_ref_sra__chg_field_historicaladminis.py index b4b3f9726..b4b3f9726 100644 --- a/archaeological_operations/migrations/0007_auto__chg_field_administrativeact_ref_sra__chg_field_historicaladminis.py +++ b/archaeological_operations/old_migrations/0007_auto__chg_field_administrativeact_ref_sra__chg_field_historicaladminis.py diff --git a/archaeological_operations/migrations/0008_auto__chg_field_operationsource_index__chg_field_operationsource_title.py b/archaeological_operations/old_migrations/0008_auto__chg_field_operationsource_index__chg_field_operationsource_title.py index 5fb8d9ad3..5fb8d9ad3 100644 --- a/archaeological_operations/migrations/0008_auto__chg_field_operationsource_index__chg_field_operationsource_title.py +++ b/archaeological_operations/old_migrations/0008_auto__chg_field_operationsource_index__chg_field_operationsource_title.py diff --git a/archaeological_operations/migrations/0009_auto__add_field_historicaloperation_cached_label__add_field_operation_.py b/archaeological_operations/old_migrations/0009_auto__add_field_historicaloperation_cached_label__add_field_operation_.py index 2a789c5de..2a789c5de 100644 --- a/archaeological_operations/migrations/0009_auto__add_field_historicaloperation_cached_label__add_field_operation_.py +++ b/archaeological_operations/old_migrations/0009_auto__add_field_historicaloperation_cached_label__add_field_operation_.py diff --git a/archaeological_operations/migrations/0010_auto__chg_field_historicaloperation_cached_label__chg_field_operation_.py b/archaeological_operations/old_migrations/0010_auto__chg_field_historicaloperation_cached_label__chg_field_operation_.py index ce6d106be..ce6d106be 100644 --- a/archaeological_operations/migrations/0010_auto__chg_field_historicaloperation_cached_label__chg_field_operation_.py +++ b/archaeological_operations/old_migrations/0010_auto__chg_field_historicaloperation_cached_label__chg_field_operation_.py diff --git a/archaeological_operations/migrations/0011_auto__add_field_historicaloperation_report_delivery_date__add_field_op.py b/archaeological_operations/old_migrations/0011_auto__add_field_historicaloperation_report_delivery_date__add_field_op.py index 78ee2dc3e..78ee2dc3e 100644 --- a/archaeological_operations/migrations/0011_auto__add_field_historicaloperation_report_delivery_date__add_field_op.py +++ b/archaeological_operations/old_migrations/0011_auto__add_field_historicaloperation_report_delivery_date__add_field_op.py diff --git a/archaeological_operations/migrations/0012_auto.py b/archaeological_operations/old_migrations/0012_auto.py index 311f3f3d3..311f3f3d3 100644 --- a/archaeological_operations/migrations/0012_auto.py +++ b/archaeological_operations/old_migrations/0012_auto.py diff --git a/archaeological_operations/migrations/0013_auto__add_field_acttype_code.py b/archaeological_operations/old_migrations/0013_auto__add_field_acttype_code.py index 273c8cd24..273c8cd24 100644 --- a/archaeological_operations/migrations/0013_auto__add_field_acttype_code.py +++ b/archaeological_operations/old_migrations/0013_auto__add_field_acttype_code.py diff --git a/archaeological_operations/migrations/0014_auto__add_archaeologicalsite.py b/archaeological_operations/old_migrations/0014_auto__add_archaeologicalsite.py index 47733dc35..47733dc35 100644 --- a/archaeological_operations/migrations/0014_auto__add_archaeologicalsite.py +++ b/archaeological_operations/old_migrations/0014_auto__add_archaeologicalsite.py diff --git a/archaeological_operations/migrations/0015_auto__add_unique_archaeologicalsite_reference.py b/archaeological_operations/old_migrations/0015_auto__add_unique_archaeologicalsite_reference.py index 3982d3d4d..3982d3d4d 100644 --- a/archaeological_operations/migrations/0015_auto__add_unique_archaeologicalsite_reference.py +++ b/archaeological_operations/old_migrations/0015_auto__add_unique_archaeologicalsite_reference.py diff --git a/archaeological_operations/migrations/0016_auto__add_field_acttype_indexed__add_field_historicaladministrativeact.py b/archaeological_operations/old_migrations/0016_auto__add_field_acttype_indexed__add_field_historicaladministrativeact.py index c5b4ac2ed..c5b4ac2ed 100644 --- a/archaeological_operations/migrations/0016_auto__add_field_acttype_indexed__add_field_historicaladministrativeact.py +++ b/archaeological_operations/old_migrations/0016_auto__add_field_acttype_indexed__add_field_historicaladministrativeact.py diff --git a/archaeological_operations/migrations/0017_rename_in_charge_to_scientist.py b/archaeological_operations/old_migrations/0017_rename_in_charge_to_scientist.py index 30946e383..30946e383 100644 --- a/archaeological_operations/migrations/0017_rename_in_charge_to_scientist.py +++ b/archaeological_operations/old_migrations/0017_rename_in_charge_to_scientist.py diff --git a/archaeological_operations/migrations/0018_auto__add_field_historicaloperation_in_charge_id__add_field_operation_.py b/archaeological_operations/old_migrations/0018_auto__add_field_historicaloperation_in_charge_id__add_field_operation_.py index d5cf3c4bd..d5cf3c4bd 100644 --- a/archaeological_operations/migrations/0018_auto__add_field_historicaloperation_in_charge_id__add_field_operation_.py +++ b/archaeological_operations/old_migrations/0018_auto__add_field_historicaloperation_in_charge_id__add_field_operation_.py diff --git a/archaeological_operations/migrations/0019_auto__add_field_historicaloperation_operator_id__add_field_operation_o.py b/archaeological_operations/old_migrations/0019_auto__add_field_historicaloperation_operator_id__add_field_operation_o.py index 375ac67df..375ac67df 100644 --- a/archaeological_operations/migrations/0019_auto__add_field_historicaloperation_operator_id__add_field_operation_o.py +++ b/archaeological_operations/old_migrations/0019_auto__add_field_historicaloperation_operator_id__add_field_operation_o.py diff --git a/archaeological_operations/migrations/0020_auto__add_field_parcel_history_creator__add_field_historicaloperation_.py b/archaeological_operations/old_migrations/0020_auto__add_field_parcel_history_creator__add_field_historicaloperation_.py index 4614eba32..4614eba32 100644 --- a/archaeological_operations/migrations/0020_auto__add_field_parcel_history_creator__add_field_historicaloperation_.py +++ b/archaeological_operations/old_migrations/0020_auto__add_field_parcel_history_creator__add_field_historicaloperation_.py diff --git a/archaeological_operations/migrations/0021_init_history_creator.py b/archaeological_operations/old_migrations/0021_init_history_creator.py index 5d0f7c780..5d0f7c780 100644 --- a/archaeological_operations/migrations/0021_init_history_creator.py +++ b/archaeological_operations/old_migrations/0021_init_history_creator.py diff --git a/archaeological_operations/migrations/0022_auto__add_field_operationtype_order.py b/archaeological_operations/old_migrations/0022_auto__add_field_operationtype_order.py index 379711ec9..379711ec9 100644 --- a/archaeological_operations/migrations/0022_auto__add_field_operationtype_order.py +++ b/archaeological_operations/old_migrations/0022_auto__add_field_operationtype_order.py diff --git a/archaeological_operations/migrations/0023_add_year_administrativact.py b/archaeological_operations/old_migrations/0023_add_year_administrativact.py index bf1712db4..bf1712db4 100644 --- a/archaeological_operations/migrations/0023_add_year_administrativact.py +++ b/archaeological_operations/old_migrations/0023_add_year_administrativact.py diff --git a/archaeological_operations/migrations/0024_reinit_history_creator.py b/archaeological_operations/old_migrations/0024_reinit_history_creator.py index 8a6b1f819..8a6b1f819 100644 --- a/archaeological_operations/migrations/0024_reinit_history_creator.py +++ b/archaeological_operations/old_migrations/0024_reinit_history_creator.py diff --git a/archaeological_operations/migrations/0025_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py b/archaeological_operations/old_migrations/0025_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py index b30bfc1d5..b30bfc1d5 100644 --- a/archaeological_operations/migrations/0025_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py +++ b/archaeological_operations/old_migrations/0025_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py diff --git a/archaeological_operations/migrations/0026_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py b/archaeological_operations/old_migrations/0026_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py index 0f75dd757..0f75dd757 100644 --- a/archaeological_operations/migrations/0026_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py +++ b/archaeological_operations/old_migrations/0026_auto__chg_field_historicaladministrativeact_act_object__chg_field_admi.py diff --git a/archaeological_operations/migrations/0027_auto__add_field_historicaloperation_creation_date__add_field_operation.py b/archaeological_operations/old_migrations/0027_auto__add_field_historicaloperation_creation_date__add_field_operation.py index 2a21c1569..2a21c1569 100644 --- a/archaeological_operations/migrations/0027_auto__add_field_historicaloperation_creation_date__add_field_operation.py +++ b/archaeological_operations/old_migrations/0027_auto__add_field_historicaloperation_creation_date__add_field_operation.py diff --git a/archaeological_operations/migrations/0028_init_creation_date.py b/archaeological_operations/old_migrations/0028_init_creation_date.py index 0136fb217..0136fb217 100644 --- a/archaeological_operations/migrations/0028_init_creation_date.py +++ b/archaeological_operations/old_migrations/0028_init_creation_date.py diff --git a/archaeological_operations/migrations/0029_auto__chg_field_historicaloperation_creation_date__chg_field_operation.py b/archaeological_operations/old_migrations/0029_auto__chg_field_historicaloperation_creation_date__chg_field_operation.py index d5b36444a..d5b36444a 100644 --- a/archaeological_operations/migrations/0029_auto__chg_field_historicaloperation_creation_date__chg_field_operation.py +++ b/archaeological_operations/old_migrations/0029_auto__chg_field_historicaloperation_creation_date__chg_field_operation.py diff --git a/archaeological_operations/migrations/0030_auto__chg_field_parcel_history_creator__chg_field_parcel_history_modif.py b/archaeological_operations/old_migrations/0030_auto__chg_field_parcel_history_creator__chg_field_parcel_history_modif.py index 07e168a33..07e168a33 100644 --- a/archaeological_operations/migrations/0030_auto__chg_field_parcel_history_creator__chg_field_parcel_history_modif.py +++ b/archaeological_operations/old_migrations/0030_auto__chg_field_parcel_history_creator__chg_field_parcel_history_modif.py diff --git a/archaeological_operations/migrations/0031_auto__add_field_parcel_address.py b/archaeological_operations/old_migrations/0031_auto__add_field_parcel_address.py index 05554006c..05554006c 100644 --- a/archaeological_operations/migrations/0031_auto__add_field_parcel_address.py +++ b/archaeological_operations/old_migrations/0031_auto__add_field_parcel_address.py diff --git a/archaeological_operations/migrations/0032_auto__add_field_operationsource_support_type__add_field_operationsourc.py b/archaeological_operations/old_migrations/0032_auto__add_field_operationsource_support_type__add_field_operationsourc.py index 3a4932c86..3a4932c86 100644 --- a/archaeological_operations/migrations/0032_auto__add_field_operationsource_support_type__add_field_operationsourc.py +++ b/archaeological_operations/old_migrations/0032_auto__add_field_operationsource_support_type__add_field_operationsourc.py diff --git a/archaeological_operations/migrations/0033_auto__add_field_parcel_external_id.py b/archaeological_operations/old_migrations/0033_auto__add_field_parcel_external_id.py index 1d0e2f4ab..1d0e2f4ab 100644 --- a/archaeological_operations/migrations/0033_auto__add_field_parcel_external_id.py +++ b/archaeological_operations/old_migrations/0033_auto__add_field_parcel_external_id.py diff --git a/archaeological_operations/migrations/0034_auto__add_field_operationsource_external_id.py b/archaeological_operations/old_migrations/0034_auto__add_field_operationsource_external_id.py index 6c982967a..6c982967a 100644 --- a/archaeological_operations/migrations/0034_auto__add_field_operationsource_external_id.py +++ b/archaeological_operations/old_migrations/0034_auto__add_field_operationsource_external_id.py diff --git a/archaeological_operations/migrations/0035_auto.py b/archaeological_operations/old_migrations/0035_auto.py index 5fde976e9..5fde976e9 100644 --- a/archaeological_operations/migrations/0035_auto.py +++ b/archaeological_operations/old_migrations/0035_auto.py diff --git a/archaeological_operations/migrations/0036_auto.py b/archaeological_operations/old_migrations/0036_auto.py index af1df3887..af1df3887 100644 --- a/archaeological_operations/migrations/0036_auto.py +++ b/archaeological_operations/old_migrations/0036_auto.py diff --git a/archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py b/archaeological_operations/old_migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py index aa023a7eb..aa023a7eb 100644 --- a/archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py +++ b/archaeological_operations/old_migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py diff --git a/archaeological_operations/migrations/0038_auto__add_unique_operation_code_patriarche.py b/archaeological_operations/old_migrations/0038_auto__add_unique_operation_code_patriarche.py index 738aa011d..738aa011d 100644 --- a/archaeological_operations/migrations/0038_auto__add_unique_operation_code_patriarche.py +++ b/archaeological_operations/old_migrations/0038_auto__add_unique_operation_code_patriarche.py diff --git a/archaeological_operations/migrations/0039_auto__add_recordrelations__add_relationtype.py b/archaeological_operations/old_migrations/0039_auto__add_recordrelations__add_relationtype.py index ba75d27ad..ba75d27ad 100644 --- a/archaeological_operations/migrations/0039_auto__add_recordrelations__add_relationtype.py +++ b/archaeological_operations/old_migrations/0039_auto__add_recordrelations__add_relationtype.py diff --git a/archaeological_operations/migrations/0040_auto__chg_field_parcel_external_id.py b/archaeological_operations/old_migrations/0040_auto__chg_field_parcel_external_id.py index ebdb74ebd..ebdb74ebd 100644 --- a/archaeological_operations/migrations/0040_auto__chg_field_parcel_external_id.py +++ b/archaeological_operations/old_migrations/0040_auto__chg_field_parcel_external_id.py diff --git a/archaeological_operations/migrations/0041_rename_ope_type_2_ope_type_old.py b/archaeological_operations/old_migrations/0041_rename_ope_type_2_ope_type_old.py index f50ae07ad..f50ae07ad 100644 --- a/archaeological_operations/migrations/0041_rename_ope_type_2_ope_type_old.py +++ b/archaeological_operations/old_migrations/0041_rename_ope_type_2_ope_type_old.py diff --git a/archaeological_operations/migrations/0042_rename_ope_type_2_ope_type_old_2.py b/archaeological_operations/old_migrations/0042_rename_ope_type_2_ope_type_old_2.py index dc2b6e1a6..dc2b6e1a6 100644 --- a/archaeological_operations/migrations/0042_rename_ope_type_2_ope_type_old_2.py +++ b/archaeological_operations/old_migrations/0042_rename_ope_type_2_ope_type_old_2.py diff --git a/archaeological_operations/migrations/0043_auto__add_field_historicaladministrativeact_departments_label__add_fie.py b/archaeological_operations/old_migrations/0043_auto__add_field_historicaladministrativeact_departments_label__add_fie.py index 30a5a6073..30a5a6073 100644 --- a/archaeological_operations/migrations/0043_auto__add_field_historicaladministrativeact_departments_label__add_fie.py +++ b/archaeological_operations/old_migrations/0043_auto__add_field_historicaladministrativeact_departments_label__add_fie.py diff --git a/archaeological_operations/migrations/0044_auto__add_field_historicaloperation_virtual_operation__add_field_histo.py b/archaeological_operations/old_migrations/0044_auto__add_field_historicaloperation_virtual_operation__add_field_histo.py index 0c18442ad..0c18442ad 100644 --- a/archaeological_operations/migrations/0044_auto__add_field_historicaloperation_virtual_operation__add_field_histo.py +++ b/archaeological_operations/old_migrations/0044_auto__add_field_historicaloperation_virtual_operation__add_field_histo.py diff --git a/archaeological_operations/migrations/0045_auto__chg_field_historicaloperation_common_name__chg_field_operation_c.py b/archaeological_operations/old_migrations/0045_auto__chg_field_historicaloperation_common_name__chg_field_operation_c.py index fd907b595..fd907b595 100644 --- a/archaeological_operations/migrations/0045_auto__chg_field_historicaloperation_common_name__chg_field_operation_c.py +++ b/archaeological_operations/old_migrations/0045_auto__chg_field_historicaloperation_common_name__chg_field_operation_c.py diff --git a/archaeological_operations/migrations/0046_auto__add_reportstate__add_field_historicaloperation_report_processing.py b/archaeological_operations/old_migrations/0046_auto__add_reportstate__add_field_historicaloperation_report_processing.py index dc45a5485..dc45a5485 100644 --- a/archaeological_operations/migrations/0046_auto__add_reportstate__add_field_historicaloperation_report_processing.py +++ b/archaeological_operations/old_migrations/0046_auto__add_reportstate__add_field_historicaloperation_report_processing.py diff --git a/archaeological_operations/migrations/0047_auto__add_field_operationsource_duplicate__chg_field_operationsource_i.py b/archaeological_operations/old_migrations/0047_auto__add_field_operationsource_duplicate__chg_field_operationsource_i.py index c31f53436..c31f53436 100644 --- a/archaeological_operations/migrations/0047_auto__add_field_operationsource_duplicate__chg_field_operationsource_i.py +++ b/archaeological_operations/old_migrations/0047_auto__add_field_operationsource_duplicate__chg_field_operationsource_i.py diff --git a/archaeological_operations/migrations/0048_auto__add_field_operationsource_receipt_date_in_documentation.py b/archaeological_operations/old_migrations/0048_auto__add_field_operationsource_receipt_date_in_documentation.py index 90a2fc415..90a2fc415 100644 --- a/archaeological_operations/migrations/0048_auto__add_field_operationsource_receipt_date_in_documentation.py +++ b/archaeological_operations/old_migrations/0048_auto__add_field_operationsource_receipt_date_in_documentation.py diff --git a/archaeological_operations/migrations/0049_auto__add_field_historicaloperation_abstract__add_field_operation_abst.py b/archaeological_operations/old_migrations/0049_auto__add_field_historicaloperation_abstract__add_field_operation_abst.py index 3bdc0e750..3bdc0e750 100644 --- a/archaeological_operations/migrations/0049_auto__add_field_historicaloperation_abstract__add_field_operation_abst.py +++ b/archaeological_operations/old_migrations/0049_auto__add_field_historicaloperation_abstract__add_field_operation_abst.py diff --git a/archaeological_operations/migrations/0050_auto__chg_field_historicaloperation_code_dracar__chg_field_operation_c.py b/archaeological_operations/old_migrations/0050_auto__chg_field_historicaloperation_code_dracar__chg_field_operation_c.py index 0ce1008ce..0ce1008ce 100644 --- a/archaeological_operations/migrations/0050_auto__chg_field_historicaloperation_code_dracar__chg_field_operation_c.py +++ b/archaeological_operations/old_migrations/0050_auto__chg_field_historicaloperation_code_dracar__chg_field_operation_c.py diff --git a/archaeological_operations/migrations/0051_auto__add_field_historicaloperation_point__add_field_historicaloperati.py b/archaeological_operations/old_migrations/0051_auto__add_field_historicaloperation_point__add_field_historicaloperati.py index 3157e0d54..3157e0d54 100644 --- a/archaeological_operations/migrations/0051_auto__add_field_historicaloperation_point__add_field_historicaloperati.py +++ b/archaeological_operations/old_migrations/0051_auto__add_field_historicaloperation_point__add_field_historicaloperati.py diff --git a/archaeological_operations/migrations/0052_auto__add_field_relationtype_short_label.py b/archaeological_operations/old_migrations/0052_auto__add_field_relationtype_short_label.py index 8e39337a3..8e39337a3 100644 --- a/archaeological_operations/migrations/0052_auto__add_field_relationtype_short_label.py +++ b/archaeological_operations/old_migrations/0052_auto__add_field_relationtype_short_label.py diff --git a/archaeological_operations/migrations/0053_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py b/archaeological_operations/old_migrations/0053_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py index b3edcfa72..b3edcfa72 100644 --- a/archaeological_operations/migrations/0053_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py +++ b/archaeological_operations/old_migrations/0053_auto__del_field_relationtype_short_label__add_field_relationtype_tiny_.py diff --git a/archaeological_operations/migrations/0054_auto__add_field_parcel_auto_external_id.py b/archaeological_operations/old_migrations/0054_auto__add_field_parcel_auto_external_id.py index e2c0b2340..e2c0b2340 100644 --- a/archaeological_operations/migrations/0054_auto__add_field_parcel_auto_external_id.py +++ b/archaeological_operations/old_migrations/0054_auto__add_field_parcel_auto_external_id.py diff --git a/archaeological_operations/migrations/0055_auto__add_field_parcel_public_domain.py b/archaeological_operations/old_migrations/0055_auto__add_field_parcel_public_domain.py index 90b5b533d..90b5b533d 100644 --- a/archaeological_operations/migrations/0055_auto__add_field_parcel_public_domain.py +++ b/archaeological_operations/old_migrations/0055_auto__add_field_parcel_public_domain.py diff --git a/archaeological_operations/migrations/0056_auto__chg_field_parcel_section.py b/archaeological_operations/old_migrations/0056_auto__chg_field_parcel_section.py index c5c954f45..c5c954f45 100644 --- a/archaeological_operations/migrations/0056_auto__chg_field_parcel_section.py +++ b/archaeological_operations/old_migrations/0056_auto__chg_field_parcel_section.py diff --git a/archaeological_operations/migrations/0057_rename_code_dracar_to_old_code.py b/archaeological_operations/old_migrations/0057_rename_code_dracar_to_old_code.py index 57100315e..57100315e 100644 --- a/archaeological_operations/migrations/0057_rename_code_dracar_to_old_code.py +++ b/archaeological_operations/old_migrations/0057_rename_code_dracar_to_old_code.py diff --git a/archaeological_operations/migrations/0058_auto__add_field_operationsource_image__add_field_operationsource_thumb.py b/archaeological_operations/old_migrations/0058_auto__add_field_operationsource_image__add_field_operationsource_thumb.py index 9dc794c86..9dc794c86 100644 --- a/archaeological_operations/migrations/0058_auto__add_field_operationsource_image__add_field_operationsource_thumb.py +++ b/archaeological_operations/old_migrations/0058_auto__add_field_operationsource_image__add_field_operationsource_thumb.py diff --git a/archaeological_operations/migrations/0059_auto__add_field_historicaloperation_documentation_deadline__add_field_.py b/archaeological_operations/old_migrations/0059_auto__add_field_historicaloperation_documentation_deadline__add_field_.py index 17a1cc7db..17a1cc7db 100644 --- a/archaeological_operations/migrations/0059_auto__add_field_historicaloperation_documentation_deadline__add_field_.py +++ b/archaeological_operations/old_migrations/0059_auto__add_field_historicaloperation_documentation_deadline__add_field_.py diff --git a/archaeological_operations/migrations/0060_auto__add_field_historicaloperation_scientific_documentation_comment__.py b/archaeological_operations/old_migrations/0060_auto__add_field_historicaloperation_scientific_documentation_comment__.py index 76f3e6ac4..76f3e6ac4 100644 --- a/archaeological_operations/migrations/0060_auto__add_field_historicaloperation_scientific_documentation_comment__.py +++ b/archaeological_operations/old_migrations/0060_auto__add_field_historicaloperation_scientific_documentation_comment__.py diff --git a/archaeological_operations/migrations/0061_regenerate_cached_label.py b/archaeological_operations/old_migrations/0061_regenerate_cached_label.py index 91beb8138..91beb8138 100644 --- a/archaeological_operations/migrations/0061_regenerate_cached_label.py +++ b/archaeological_operations/old_migrations/0061_regenerate_cached_label.py diff --git a/archaeological_operations/migrations/0062_auto__chg_field_operationsource_image__chg_field_operationsource_thumb.py b/archaeological_operations/old_migrations/0062_auto__chg_field_operationsource_image__chg_field_operationsource_thumb.py index 528a6533b..528a6533b 100644 --- a/archaeological_operations/migrations/0062_auto__chg_field_operationsource_image__chg_field_operationsource_thumb.py +++ b/archaeological_operations/old_migrations/0062_auto__chg_field_operationsource_image__chg_field_operationsource_thumb.py diff --git a/archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py b/archaeological_operations/old_migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py index 9ceffa8a3..9ceffa8a3 100644 --- a/archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py +++ b/archaeological_operations/old_migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py diff --git a/archaeological_operations/migrations/0064_fix_old_operationtype.py b/archaeological_operations/old_migrations/0064_fix_old_operationtype.py index 4ea054f65..4ea054f65 100644 --- a/archaeological_operations/migrations/0064_fix_old_operationtype.py +++ b/archaeological_operations/old_migrations/0064_fix_old_operationtype.py diff --git a/archaeological_operations/migrations/0065_auto__add_field_historicaloperation_address__add_field_operation_addre.py b/archaeological_operations/old_migrations/0065_auto__add_field_historicaloperation_address__add_field_operation_addre.py index 8626cfcf4..8626cfcf4 100644 --- a/archaeological_operations/migrations/0065_auto__add_field_historicaloperation_address__add_field_operation_addre.py +++ b/archaeological_operations/old_migrations/0065_auto__add_field_historicaloperation_address__add_field_operation_addre.py diff --git a/archaeological_operations/migrations/0066_regenerate_cached_label.py b/archaeological_operations/old_migrations/0066_regenerate_cached_label.py index 0475b0065..0475b0065 100644 --- a/archaeological_operations/migrations/0066_regenerate_cached_label.py +++ b/archaeological_operations/old_migrations/0066_regenerate_cached_label.py diff --git a/archaeological_operations/migrations/0067_auto.py b/archaeological_operations/old_migrations/0067_auto.py index f09437198..f09437198 100644 --- a/archaeological_operations/migrations/0067_auto.py +++ b/archaeological_operations/old_migrations/0067_auto.py diff --git a/archaeological_operations/old_migrations/__init__.py b/archaeological_operations/old_migrations/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/archaeological_operations/old_migrations/__init__.py diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 2cb6dd035..8ca14179f 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -19,12 +19,15 @@  import json  import datetime +import StringIO +import zipfile  from django.conf import settings  from django.core.files.uploadedfile import SimpleUploadedFile  from django.core.urlresolvers import reverse  from django.test.client import Client +from django.contrib.auth.models import User  from django.contrib.auth.models import Permission  import models @@ -32,7 +35,9 @@ from archaeological_operations import views  from ishtar_common.models import OrganizationType, Organization, ItemKey, \      ImporterType, IshtarUser, TargetKey, ImporterModel, IshtarSiteProfile, \ -    Town, ImporterColumn, Person, Author, SourceType, AuthorType +    Town, ImporterColumn, Person, Author, SourceType, AuthorType, \ +    DocumentTemplate, PersonType +from archaeological_files.models import File, FileType  from archaeological_context_records.models import Unit  from ishtar_common import forms_common @@ -40,6 +45,41 @@ from ishtar_common.tests import WizardTest, WizardTestFormData as FormData, \      create_superuser, create_user, TestCase +class FileInit(object): +    def login_as_superuser(self): +        self.client.login(username='username', password='tralala') + +    def create_file(self): +        self.extra_models, self.model_list = {}, [] +        self.user, created = User.objects.get_or_create(username='username', +                                                        is_superuser=True) +        self.user.set_password('tralala') +        self.user.save() +        self.o_user, created = User.objects.get_or_create(username='ousername') +        person_type, created = PersonType.objects.get_or_create( +            label=u'Test ' u'person type', txt_idx='test_person', +            available=True) +        self.extra_models['person_type'] = person_type +        self.model_list.append(person_type) + +        person = models.Person(surname='Surname', name='Name', +                               history_modifier=self.o_user) +        person.save() +        self.extra_models['person'] = person +        self.model_list.append(person) + +        file_type, created = FileType.objects.get_or_create( +            label=u'Test file type', txt_idx='test_file', available=True) +        self.extra_models['file_type'] = file_type +        self.model_list.append(file_type) + +        dct = {'year': 2010, 'numeric_reference': 1000, 'file_type': file_type, +               'internal_reference': u'UNIT_testÉ ?', 'in_charge': person, +               'history_modifier': self.o_user, 'total_surface': 10000} +        self.item = File(**dct) +        self.item.save() + +  class ImportTest(object):      def setUp(self):          self.username, self.password, self.user = create_superuser() @@ -244,7 +284,8 @@ class ImportOperationTest(ImportTest, TestCase):          self.assertEqual(len(impt.errors), 2)          self.assertTrue(              "Importer configuration error" in impt.errors[0]['error'] or -            "Erreur de configuration de l\'importeur" in impt.errors[0]['error'] +            "Erreur de configuration de l\'importeur" in +            impt.errors[0]['error']          )      def test_model_limitation(self): @@ -593,11 +634,13 @@ def create_operation(user, orga=None, values={}):  class OperationInitTest(object):      def create_user(self):          username, password, self.user = create_user() +        return self.user      def get_default_user(self): -        if not hasattr(self, 'user') or not self.user: -            self.create_user() -        return self.user +        q = User.objects.filter(is_superuser=False) +        if q.count(): +            return q.all()[0] +        return self.create_user()      def create_orgas(self, user=None):          if not user: @@ -877,16 +920,30 @@ class OperationTest(TestCase, OperationInitTest):      def test_show(self):          operation = self.operations[0] +        source = models.OperationSource.objects.create( +            operation=operation, title="Source title", +            source_type=models.SourceType.objects.all()[0] +        )          c = Client() +          response = c.get(reverse('show-operation', kwargs={'pk': operation.pk}))          self.assertEqual(response.status_code, 200)          # empty content when not allowed          self.assertEqual(response.content, "") +        response = c.get(reverse('show-operationsource', +                                 kwargs={'pk': source.pk})) +        self.assertEqual(response.status_code, 200) +        # empty content when not allowed +        self.assertEqual(response.content, "")          c.login(username=self.username, password=self.password)          response = c.get(reverse('show-operation', kwargs={'pk': operation.pk}))          self.assertEqual(response.status_code, 200)          self.assertIn('class="sheet"', response.content) +        response = c.get(reverse('show-operationsource', +                                 kwargs={'pk': source.pk})) +        self.assertEqual(response.status_code, 200) +        self.assertIn('class="sheet"', response.content)  class OperationSearchTest(TestCase, OperationInitTest): @@ -1000,7 +1057,7 @@ class OperationSearchTest(TestCase, OperationInitTest):  def create_administrativact(user, operation):      act_type, created = models.ActType.objects.get_or_create( -        txt_idx='act_type') +        txt_idx='act_type_O', intented_to='O')      dct = {'history_modifier': user,             'act_type': act_type,             'operation': operation, @@ -1021,7 +1078,7 @@ class RegisterTest(TestCase, OperationInitTest):      def setUp(self):          self.username, self.password, self.user = create_superuser()          self.operations = self.create_operation(self.user) -        self.act_types, self.operations = create_administrativact( +        self.act_types, self.admin_acts = create_administrativact(              self.user, self.operations[0])      def testSearch(self): @@ -1035,6 +1092,70 @@ class RegisterTest(TestCase, OperationInitTest):          response = c.get(reverse('get-administrativeact'), {'indexed': '2'})          self.assertTrue(json.loads(response.content)['total'] == 1) +    def test_document_generation(self): +        tpl = open( +            settings.ROOT_PATH + +            '../archaeological_operations/tests/document_reference.odt', +            'rb') +        template = SimpleUploadedFile(tpl.name, tpl.read()) +        doc = DocumentTemplate.objects.create( +            name="Test", +            associated_object_name=DocumentTemplate.CLASSNAMES[0][0], +            available=True, +            template=template +        ) +        self.act_types[0].associated_template.add(doc) + +        c = Client() +        data = {'pk': self.admin_acts[0].pk, 'document_template': doc.pk} +        response = c.post(reverse('operation-administrativeact-document'), data) +        # no result when no authentication +        self.assertEqual(response.content, "") +        c.login(username=self.username, password=self.password) +        response = c.post(reverse('operation-administrativeact-document'), data) +        try: +            f = StringIO.StringIO(response.content) +            z = zipfile.ZipFile(f) +            self.assertIsNone(z.testzip()) +            content = z.open('content.xml') +            self.assertIn('2014-05-12', content.read()) +        finally: +            content.close() +            z.close() +            f.close() + +    def test_document_migration(self): +        fe = FileInit() +        fe.create_file() + +        from archaeological_files.tests import create_administrativact as ca_fle +        ca_fle(self.user, fe.item) + +        tpl = open( +            settings.ROOT_PATH + +            '../ishtar_common/tests/old.odt', +            'rb') +        template = SimpleUploadedFile(tpl.name, tpl.read()) +        doc = DocumentTemplate.objects.create( +            name="Old", +            associated_object_name=DocumentTemplate.CLASSNAMES[0][0], +            available=True, +            template=template +        ) +        self.act_types[0].associated_template.add(doc) + +        doc.convert_from_v1() +        with open(doc.template.path) as f: +            try: +                z = zipfile.ZipFile(f) +                self.assertIsNone(z.testzip()) +                c = z.open('content.xml') +                content = c.read() +                self.assertIn('{{ adminact_operator_id }}', content) +            finally: +                c.close() +                z.close() +  class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):      fixtures = [settings.ROOT_PATH + @@ -1052,31 +1173,45 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):          FormData(              "Create a preventive diag",              form_datas={ -                'filechoice-operation_creation': {}, -                'general-operation_creation': { +                'filechoice': {}, +                'general': {                      'operation_type': 1,  # preventive diag                      'year': 2016}, -                'townsgeneral-operation_creation': [], -                'parcelsgeneral-operation_creation': [], +                'townsgeneral': [], +                'parcelsgeneral': [],              },              ignored=('towns-operation_creation',                       'parcels-operation_creation', -                     'preventive-operation_creation',) +                     'preventive-operation_creation')          ),          FormData(              "Create another preventive diag with same parcel name",              form_datas={ -                'filechoice-operation_creation': {}, -                'general-operation_creation': { +                'filechoice': {}, +                'general': {                      'operation_type': 1,  # preventive diag                      'year': 2016}, -                'townsgeneral-operation_creation': [], -                'parcelsgeneral-operation_creation': [], +                'townsgeneral': [], +                'parcelsgeneral': [],              },              ignored=('towns-operation_creation',                       'parcels-operation_creation', -                     'preventive-operation_creation',) -        ) +                     'preventive-operation_creation') +        ), +        FormData( +            "Create an operation related to a file", +            form_datas={ +                'filechoice': {}, +                'general': { +                    'operation_type': 1,  # preventive diag +                    'year': 2016}, +                'towns': [], +                'parcels': [], +            }, +            ignored=('townsgeneral-operation_creation', +                     'parcelsgeneral-operation_creation', +                     'preventive-operation_creation') +        ),      ]      def pre_wizard(self): @@ -1085,31 +1220,44 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):          profile.files = True          profile.save() -        if 'townsgeneral-operation_creation' not in \ +        if 'townsgeneral' not in \                  self.form_datas[0].form_datas:              return super(OperationWizardCreationTest, self).pre_wizard()          town = self.create_towns()[0]          town_data = {'town': town.pk}          self.form_datas[0].form_datas[ -            'townsgeneral-operation_creation'].append(town_data) +            'townsgeneral'].append(town_data)          self.form_datas[1].form_datas[ -            'townsgeneral-operation_creation'].append(town_data) +            'townsgeneral'].append(town_data)          parcel_data = {              'town': town.pk, 'year': 2017, 'section': 'S',              'parcel_number': '42'}          self.form_datas[0].form_datas[ -            'parcelsgeneral-operation_creation'].append(parcel_data) +            'parcelsgeneral'].append(parcel_data)          self.form_datas[1].form_datas[ -            'parcelsgeneral-operation_creation'].append(parcel_data) +            'parcelsgeneral'].append(parcel_data) + +        FI = FileInit() +        FI.create_file() +        file = FI.item +        file.towns.add(town) +        parcel = models.Parcel.objects.create( +            town=town, year=2017, section='G', parcel_number='43' +        ) +        file.parcels.add(parcel) +        self.form_datas[2].set('filechoice', 'associated_file', file.pk) +        self.form_datas[2].append('towns', town_data) +        self.form_datas[2].append('parcels', {'parcel': parcel.pk}) +          self.operation_number = models.Operation.objects.count()          self.parcel_number = models.Parcel.objects.count()          super(OperationWizardCreationTest, self).pre_wizard()      def post_wizard(self):          self.assertEqual(models.Operation.objects.count(), -                         self.operation_number + 2) +                         self.operation_number + 3)          self.assertEqual(models.Parcel.objects.count(), -                         self.parcel_number + 2) +                         self.parcel_number + 3)  class OperationWizardModifTest(WizardTest, OperationInitTest, TestCase): @@ -1279,7 +1427,7 @@ class OperationWizardDeleteTest(OperationWizardCreationTest):      ]      def pass_test(self): -        if not settings.SOUTH_TESTS_MIGRATE: +        if not settings.TEST_VIEWS:              # with no migration the views are not created              return True @@ -1417,4 +1565,4 @@ class OperationSourceWizardModificationTest(WizardTest, OperationInitTest,      def post_wizard(self):          source = models.OperationSource.objects.get(pk=self.source.pk) -        self.assertEqual(source.authors.count(), 0)
\ No newline at end of file +        self.assertEqual(source.authors.count(), 0) diff --git a/archaeological_operations/tests/document_reference.odt b/archaeological_operations/tests/document_reference.odt Binary files differnew file mode 100755 index 000000000..0097e8b15 --- /dev/null +++ b/archaeological_operations/tests/document_reference.odt diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py index bc6bc4bee..0b4c02a61 100644 --- a/archaeological_operations/urls.py +++ b/archaeological_operations/urls.py @@ -17,7 +17,7 @@  # See the file COPYING for details. -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url  from ishtar_common.wizards import check_rights  import views diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 6a1340e70..13b9a4767 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -43,9 +43,9 @@ def autocomplete_patriarche(request, non_closed=True):                                            models.Operation)              and not request.user.ishtaruser.has_right(                  'operation_search', session=request.session)): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -58,7 +58,7 @@ def autocomplete_patriarche(request, non_closed=True):      data = json.dumps([{'id': operation.code_patriarche,                          'value': operation.code_patriarche}                         for operation in operations]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def autocomplete_archaeologicalsite(request): @@ -68,9 +68,9 @@ def autocomplete_archaeologicalsite(request):          and not request.user.has_perm(              'archaeological_operations.view_own_archaeologicalsite',              models.ArchaeologicalSite)): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -82,7 +82,7 @@ def autocomplete_archaeologicalsite(request):      data = json.dumps([{'id': site.pk,                          'value': unicode(site)[:60]}                         for site in sites]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  new_archaeologicalsite = new_item(models.ArchaeologicalSite,                                    ArchaeologicalSiteForm, many=True) @@ -96,9 +96,9 @@ def autocomplete_operation(request, non_closed=True):              'ishtar_common.view_own_operation', models.Operation)              and not request.user.ishtaruser.has_right(                  'operation_search', session=request.session)): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -123,7 +123,7 @@ def autocomplete_operation(request, non_closed=True):      operations = models.Operation.objects.filter(query)[:limit]      data = json.dumps([{'id': operation.pk, 'value': unicode(operation)}                         for operation in operations]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def get_available_operation_code(request, year=None): @@ -131,10 +131,10 @@ def get_available_operation_code(request, year=None):          'ishtar_common.view_operation', models.Operation)\          and not request.user.has_perm(              'ishtar_common.view_own_operation', models.Operation): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      data = json.dumps({'id':                         models.Operation.get_available_operation_code(year)}) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  get_operation = get_item(models.Operation, 'get_operation', 'operation') @@ -413,7 +413,7 @@ def generatedoc_administrativeactop(request, pk, template_pk=None):              'ishtar_common.view_operation', models.Operation)          and not request.user.has_perm(              'ishtar_common.view_own_operation', models.Operation)): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      try:          act_file = models.AdministrativeAct.objects.get(pk=pk)          doc = act_file.publish(template_pk) @@ -427,11 +427,11 @@ def generatedoc_administrativeactop(request, pk, template_pk=None):          mimetype = 'text/csv'          if ext in MIMES:              mimetype = MIMES[ext] -        response = HttpResponse(open(doc), mimetype=mimetype) +        response = HttpResponse(open(doc), content_type=mimetype)          response['Content-Disposition'] = 'attachment; filename=%s' % \              doc_name          return response -    return HttpResponse(mimetype='text/plain') +    return HttpResponse(content_type='text/plain')  def administrativeactfile_document( @@ -453,6 +453,10 @@ def administrativeactfile_document(              AdministrativeActTreatmentFileFormSelection          search_form = AdministrativeActTreatmentFileFormSelection          document_type = 'TF' + +    if not request.user.has_perm('view_administrativeact', +                                 models.AdministrativeAct): +        return HttpResponse(content_type='text/plain')      dct = {}      if request.POST:          dct['search_form'] = search_form(request.POST) diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index 07206cc18..02d462f66 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -250,7 +250,7 @@ class OperationWizard(Wizard):          post_data = request.POST.copy()          # add all parcel from available in the archaeological file -        if not post_data.get('add_all_parcels'): +        if not post_data.get('add_all_parcels', None):              return super(OperationWizard, self).post(*args, **kwargs)          file = self.get_current_file() @@ -506,7 +506,7 @@ def has_associated_file(form_name, file_key='associated_file', negate=False):                  'step_data'][form_name][form_name + '-' + file_key]              if type(file_id) in (list, tuple):                  file_id = file_id[0] -            file_id = int(file_id) +            int(file_id)              return not negate          except ValueError:              return negate diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 94e31b759..f020864ff 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2010-2016  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2017 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -17,6 +17,8 @@  # See the file COPYING for details. +from collections import OrderedDict +  from django import forms  from django.conf import settings  from django.forms.formsets import formset_factory @@ -212,9 +214,13 @@ class ContainerModifyForm(ContainerForm):      def __init__(self, *args, **kwargs):          super(ContainerModifyForm, self).__init__(*args, **kwargs) -        self.fields.keyOrder.pop(self.fields.keyOrder.index('index')) -        self.fields.keyOrder.insert( -            self.fields.keyOrder.index("location") + 1, 'index') +        fields = OrderedDict() +        idx = self.fields.pop('index') +        for key, value in self.fields.items(): +            fields[key] = value +            if key == 'location': +                fields['index'] = idx +        self.fields = fields      def clean(self):          # manage unique ID diff --git a/archaeological_warehouse/migrations/0001_initial.py b/archaeological_warehouse/migrations/0001_initial.py index 6c3b14e75..13abc0afa 100644 --- a/archaeological_warehouse/migrations/0001_initial.py +++ b/archaeological_warehouse/migrations/0001_initial.py @@ -1,229 +1,182 @@  # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): -        # Adding model 'WarehouseType' -        db.create_table('archaeological_warehouse_warehousetype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('archaeological_warehouse', ['WarehouseType']) - -        # Adding model 'Warehouse' -        db.create_table('archaeological_warehouse_warehouse', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)), -            ('warehouse_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.WarehouseType'])), -            ('person_in_charge', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'], null=True, blank=True)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -        )) -        db.send_create_signal('archaeological_warehouse', ['Warehouse']) - -        # Adding model 'ContainerType' -        db.create_table('archaeological_warehouse_containertype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -            ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('height', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('volume', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('reference', self.gf('django.db.models.fields.CharField')(max_length=30)), -        )) -        db.send_create_signal('archaeological_warehouse', ['ContainerType']) +from __future__ import unicode_literals -        # Adding model 'Container' -        db.create_table('archaeological_warehouse_container', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), -            ('location', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.Warehouse'])), -            ('container_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.ContainerType'])), -            ('reference', self.gf('django.db.models.fields.CharField')(max_length=40)), -            ('comment', self.gf('django.db.models.fields.TextField')()), -        )) -        db.send_create_signal('archaeological_warehouse', ['Container']) - - -    def backwards(self, orm): -        # Deleting model 'WarehouseType' -        db.delete_table('archaeological_warehouse_warehousetype') - -        # Deleting model 'Warehouse' -        db.delete_table('archaeological_warehouse_warehouse') - -        # Deleting model 'ContainerType' -        db.delete_table('archaeological_warehouse_containertype') +from django.db import models, migrations +import datetime +import django.core.validators +import django.db.models.deletion +from django.conf import settings +import re +import ishtar_common.models -        # Deleting model 'Container' -        db.delete_table('archaeological_warehouse_container') +class Migration(migrations.Migration): -    models = { -        'archaeological_warehouse.container': { -            'Meta': {'object_name': 'Container'}, -            'comment': ('django.db.models.fields.TextField', [], {}), -            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) -        }, -        'archaeological_warehouse.containertype': { -            'Meta': {'object_name': 'ContainerType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), -            'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'archaeological_warehouse.warehouse': { -            'Meta': {'object_name': 'Warehouse'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), -            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'null': 'True', 'blank': 'True'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) -        }, -        'archaeological_warehouse.warehousetype': { -            'Meta': {'object_name': 'WarehouseType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.wizard': { -            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) -        }, -        'ishtar_common.wizardstep': { -            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) -        } -    } +    dependencies = [ +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +    ] -    complete_apps = ['archaeological_warehouse']
\ No newline at end of file +    operations = [ +        migrations.CreateModel( +            name='Collection', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('history_date', models.DateTimeField(default=datetime.datetime.now)), +                ('name', models.CharField(max_length=200, null=True, verbose_name='Name', blank=True)), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +            ], +            options={ +                'ordering': ('name',), +                'verbose_name': 'Collection', +                'verbose_name_plural': 'Collection', +            }, +        ), +        migrations.CreateModel( +            name='Container', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('image', models.ImageField(max_length=255, null=True, upload_to=b'upload/', blank=True)), +                ('thumbnail', models.ImageField(max_length=255, null=True, upload_to=b'upload/thumbs/', blank=True)), +                ('history_date', models.DateTimeField(default=datetime.datetime.now)), +                ('reference', models.CharField(max_length=40, verbose_name='Container ref.')), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('cached_label', models.CharField(max_length=500, null=True, verbose_name='Localisation', blank=True)), +                ('cached_location', models.CharField(max_length=500, null=True, verbose_name='Cached location', blank=True)), +                ('index', models.IntegerField(default=0, verbose_name='ID')), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +            ], +            options={ +                'ordering': ('cached_label',), +                'verbose_name': 'Container', +                'verbose_name_plural': 'Containers', +            }, +        ), +        migrations.CreateModel( +            name='ContainerLocalisation', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('reference', models.CharField(default=b'', max_length=200, verbose_name='Reference')), +            ], +            options={ +                'ordering': ('container', 'division__order'), +                'verbose_name': 'Container localisation', +                'verbose_name_plural': 'Container localisations', +            }, +        ), +        migrations.CreateModel( +            name='ContainerType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('length', models.IntegerField(null=True, verbose_name='Length (mm)', blank=True)), +                ('width', models.IntegerField(null=True, verbose_name='Width (mm)', blank=True)), +                ('height', models.IntegerField(null=True, verbose_name='Height (mm)', blank=True)), +                ('volume', models.FloatField(null=True, verbose_name='Volume (l)', blank=True)), +                ('reference', models.CharField(max_length=30, verbose_name='Ref.')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Container type', +                'verbose_name_plural': 'Container types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Warehouse', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('address', models.TextField(null=True, verbose_name='Address', blank=True)), +                ('address_complement', models.TextField(null=True, verbose_name='Address complement', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Postal code', blank=True)), +                ('town', models.CharField(max_length=70, null=True, verbose_name='Town', blank=True)), +                ('country', models.CharField(max_length=30, null=True, verbose_name='Country', blank=True)), +                ('alt_address', models.TextField(null=True, verbose_name='Other address: address', blank=True)), +                ('alt_address_complement', models.TextField(null=True, verbose_name='Other address: address complement', blank=True)), +                ('alt_postal_code', models.CharField(max_length=10, null=True, verbose_name='Other address: postal code', blank=True)), +                ('alt_town', models.CharField(max_length=70, null=True, verbose_name='Other address: town', blank=True)), +                ('alt_country', models.CharField(max_length=30, null=True, verbose_name='Other address: country', blank=True)), +                ('phone', models.CharField(max_length=18, null=True, verbose_name='Phone', blank=True)), +                ('phone_desc', models.CharField(max_length=300, null=True, verbose_name='Phone description', blank=True)), +                ('phone2', models.CharField(max_length=18, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone_desc2', models.CharField(max_length=300, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone3', models.CharField(max_length=18, null=True, verbose_name='Phone 3', blank=True)), +                ('phone_desc3', models.CharField(max_length=300, null=True, verbose_name='Phone description 3', blank=True)), +                ('raw_phone', models.TextField(null=True, verbose_name='Raw phone', blank=True)), +                ('mobile_phone', models.CharField(max_length=18, null=True, verbose_name='Mobile phone', blank=True)), +                ('email', models.EmailField(max_length=300, null=True, verbose_name='Email', blank=True)), +                ('alt_address_is_prefered', models.BooleanField(default=False, verbose_name='Alternative address is prefered')), +                ('name', models.CharField(max_length=200, verbose_name='Name')), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('external_id', models.TextField(null=True, verbose_name='External ID', blank=True)), +                ('auto_external_id', models.BooleanField(default=False, verbose_name='External ID is set automatically')), +            ], +            options={ +                'verbose_name': 'Warehouse', +                'verbose_name_plural': 'Warehouses', +                'permissions': (('view_warehouse', 'Peut voir tous les D\xe9p\xf4ts'), ('view_own_warehouse', 'Peut voir son propre D\xe9p\xf4t'), ('add_own_warehouse', 'Peut ajouter son propre D\xe9p\xf4t'), ('change_own_warehouse', 'Peut modifier son propre D\xe9p\xf4t'), ('delete_own_warehouse', 'Peut supprimer son propre D\xe9p\xf4t')), +            }, +            bases=(models.Model, ishtar_common.models.DashboardFormItem, ishtar_common.models.OwnPerms), +        ), +        migrations.CreateModel( +            name='WarehouseDivision', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'verbose_name': 'Warehouse division type', +                'verbose_name_plural': 'Warehouse division types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='WarehouseDivisionLink', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('order', models.IntegerField(default=10, verbose_name='Order')), +                ('division', models.ForeignKey(to='archaeological_warehouse.WarehouseDivision')), +                ('warehouse', models.ForeignKey(to='archaeological_warehouse.Warehouse')), +            ], +            options={ +                'ordering': ('warehouse', 'order'), +            }, +        ), +        migrations.CreateModel( +            name='WarehouseType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Warehouse type', +                'verbose_name_plural': 'Warehouse types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.AddField( +            model_name='warehouse', +            name='associated_divisions', +            field=models.ManyToManyField(to='archaeological_warehouse.WarehouseDivision', verbose_name='Divisions', through='archaeological_warehouse.WarehouseDivisionLink', blank=True), +        ), +        migrations.AddField( +            model_name='warehouse', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='warehouse', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +    ] diff --git a/archaeological_warehouse/migrations/0002_auto_20170414_2123.py b/archaeological_warehouse/migrations/0002_auto_20170414_2123.py new file mode 100644 index 000000000..5b9c92785 --- /dev/null +++ b/archaeological_warehouse/migrations/0002_auto_20170414_2123.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_warehouse', '0001_initial'), +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +        ('ishtar_common', '0001_initial'), +    ] + +    operations = [ +        migrations.AddField( +            model_name='warehouse', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_warehouse_warehouse', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='warehouse', +            name='person_in_charge', +            field=models.ForeignKey(related_name='warehouse_in_charge', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Person in charge', blank=True, to='ishtar_common.Person', null=True), +        ), +        migrations.AddField( +            model_name='warehouse', +            name='warehouse_type', +            field=models.ForeignKey(verbose_name='Warehouse type', to='archaeological_warehouse.WarehouseType'), +        ), +        migrations.AddField( +            model_name='containerlocalisation', +            name='container', +            field=models.ForeignKey(related_name='division', verbose_name='Container', to='archaeological_warehouse.Container'), +        ), +        migrations.AddField( +            model_name='containerlocalisation', +            name='division', +            field=models.ForeignKey(verbose_name='Division', to='archaeological_warehouse.WarehouseDivisionLink'), +        ), +        migrations.AddField( +            model_name='container', +            name='container_type', +            field=models.ForeignKey(verbose_name='Container type', to='archaeological_warehouse.ContainerType'), +        ), +        migrations.AddField( +            model_name='container', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='container', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='container', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_warehouse_container', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='container', +            name='location', +            field=models.ForeignKey(related_name='containers', verbose_name='Location (warehouse)', to='archaeological_warehouse.Warehouse'), +        ), +        migrations.AddField( +            model_name='container', +            name='responsible', +            field=models.ForeignKey(related_name='owned_containers', verbose_name='Responsible warehouse', to='archaeological_warehouse.Warehouse'), +        ), +        migrations.AddField( +            model_name='collection', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='collection', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='collection', +            name='imports', +            field=models.ManyToManyField(related_name='imported_archaeological_warehouse_collection', to='ishtar_common.Import', blank=True), +        ), +        migrations.AddField( +            model_name='collection', +            name='warehouse', +            field=models.ForeignKey(related_name='collections', verbose_name='Warehouse', to='archaeological_warehouse.Warehouse'), +        ), +        migrations.AlterUniqueTogether( +            name='warehousedivisionlink', +            unique_together=set([('warehouse', 'division')]), +        ), +        migrations.AlterUniqueTogether( +            name='containerlocalisation', +            unique_together=set([('container', 'division')]), +        ), +        migrations.AlterUniqueTogether( +            name='container', +            unique_together=set([('index', 'location')]), +        ), +    ] diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 96814339c..35e5536fa 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -65,11 +65,11 @@ class Warehouse(Address, DashboardFormItem, OwnPerms):          verbose_name = _(u"Warehouse")          verbose_name_plural = _(u"Warehouses")          permissions = ( -            ("view_warehouse", ugettext(u"Can view all Warehouses")), -            ("view_own_warehouse", ugettext(u"Can view own Warehouse")), -            ("add_own_warehouse", ugettext(u"Can add own Warehouse")), -            ("change_own_warehouse", ugettext(u"Can change own Warehouse")), -            ("delete_own_warehouse", ugettext(u"Can delete own Warehouse")), +            ("view_warehouse", u"Can view all Warehouses"), +            ("view_own_warehouse", u"Can view own Warehouse"), +            ("add_own_warehouse", u"Can add own Warehouse"), +            ("change_own_warehouse", u"Can change own Warehouse"), +            ("delete_own_warehouse", u"Can delete own Warehouse"),          )      def __unicode__(self): @@ -81,8 +81,8 @@ class Warehouse(Address, DashboardFormItem, OwnPerms):                 slugify(unicode(self))      @classmethod -    def get_query_owns(cls, user): -        return Q(person_in_charge__ishtaruser=user.ishtaruser) +    def get_query_owns(cls, ishtaruser): +        return Q(person_in_charge__ishtaruser=ishtaruser)      @property      def number_of_finds(self): @@ -310,10 +310,10 @@ class Container(LightHistorizedItem, ImageModel):          return cached_label      @classmethod -    def get_query_owns(cls, user): -        return Q(history_creator=user) | \ -            Q(location__person_in_charge__ishtaruser=user.ishtaruser) | \ -            Q(responsible__person_in_charge__ishtaruser=user.ishtaruser) +    def get_query_owns(cls, ishtaruser): +        return Q(history_creator=ishtaruser.user_ptr) | \ +            Q(location__person_in_charge__ishtaruser=ishtaruser) | \ +            Q(responsible__person_in_charge__ishtaruser=ishtaruser)      @property      def associated_filename(self): diff --git a/archaeological_warehouse/old_migrations/0001_initial.py b/archaeological_warehouse/old_migrations/0001_initial.py new file mode 100644 index 000000000..6c3b14e75 --- /dev/null +++ b/archaeological_warehouse/old_migrations/0001_initial.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + +    def forwards(self, orm): +        # Adding model 'WarehouseType' +        db.create_table('archaeological_warehouse_warehousetype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('archaeological_warehouse', ['WarehouseType']) + +        # Adding model 'Warehouse' +        db.create_table('archaeological_warehouse_warehouse', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=40)), +            ('warehouse_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.WarehouseType'])), +            ('person_in_charge', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'], null=True, blank=True)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +        )) +        db.send_create_signal('archaeological_warehouse', ['Warehouse']) + +        # Adding model 'ContainerType' +        db.create_table('archaeological_warehouse_containertype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +            ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('height', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('volume', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('reference', self.gf('django.db.models.fields.CharField')(max_length=30)), +        )) +        db.send_create_signal('archaeological_warehouse', ['ContainerType']) + +        # Adding model 'Container' +        db.create_table('archaeological_warehouse_container', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), +            ('location', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.Warehouse'])), +            ('container_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_warehouse.ContainerType'])), +            ('reference', self.gf('django.db.models.fields.CharField')(max_length=40)), +            ('comment', self.gf('django.db.models.fields.TextField')()), +        )) +        db.send_create_signal('archaeological_warehouse', ['Container']) + + +    def backwards(self, orm): +        # Deleting model 'WarehouseType' +        db.delete_table('archaeological_warehouse_warehousetype') + +        # Deleting model 'Warehouse' +        db.delete_table('archaeological_warehouse_warehouse') + +        # Deleting model 'ContainerType' +        db.delete_table('archaeological_warehouse_containertype') + +        # Deleting model 'Container' +        db.delete_table('archaeological_warehouse_container') + + +    models = { +        'archaeological_warehouse.container': { +            'Meta': {'object_name': 'Container'}, +            'comment': ('django.db.models.fields.TextField', [], {}), +            'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}), +            'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) +        }, +        'archaeological_warehouse.containertype': { +            'Meta': {'object_name': 'ContainerType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}), +            'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), +            'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'archaeological_warehouse.warehouse': { +            'Meta': {'object_name': 'Warehouse'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), +            'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'null': 'True', 'blank': 'True'}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) +        }, +        'archaeological_warehouse.warehousetype': { +            'Meta': {'object_name': 'WarehouseType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'auth.group': { +            'Meta': {'object_name': 'Group'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), +            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) +        }, +        'auth.permission': { +            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, +            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) +        }, +        'auth.user': { +            'Meta': {'object_name': 'User'}, +            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), +            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), +            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), +            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'contenttypes.contenttype': { +            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, +            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) +        }, +        'ishtar_common.organization': { +            'Meta': {'object_name': 'Organization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.organizationtype': { +            'Meta': {'object_name': 'OrganizationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.person': { +            'Meta': {'object_name': 'Person'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.persontype': { +            'Meta': {'object_name': 'PersonType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.wizard': { +            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) +        }, +        'ishtar_common.wizardstep': { +            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) +        } +    } + +    complete_apps = ['archaeological_warehouse']
\ No newline at end of file diff --git a/archaeological_warehouse/migrations/0002_auto__add_field_warehouse_history_creator__add_field_container_history.py b/archaeological_warehouse/old_migrations/0002_auto__add_field_warehouse_history_creator__add_field_container_history.py index 75bd47a45..75bd47a45 100644 --- a/archaeological_warehouse/migrations/0002_auto__add_field_warehouse_history_creator__add_field_container_history.py +++ b/archaeological_warehouse/old_migrations/0002_auto__add_field_warehouse_history_creator__add_field_container_history.py diff --git a/archaeological_warehouse/migrations/0003_auto__add_field_warehouse_email.py b/archaeological_warehouse/old_migrations/0003_auto__add_field_warehouse_email.py index bcfabba98..bcfabba98 100644 --- a/archaeological_warehouse/migrations/0003_auto__add_field_warehouse_email.py +++ b/archaeological_warehouse/old_migrations/0003_auto__add_field_warehouse_email.py diff --git a/archaeological_warehouse/migrations/0004_auto__chg_field_warehouse_history_creator__chg_field_warehouse_person_.py b/archaeological_warehouse/old_migrations/0004_auto__chg_field_warehouse_history_creator__chg_field_warehouse_person_.py index 66d7c4926..66d7c4926 100644 --- a/archaeological_warehouse/migrations/0004_auto__chg_field_warehouse_history_creator__chg_field_warehouse_person_.py +++ b/archaeological_warehouse/old_migrations/0004_auto__chg_field_warehouse_history_creator__chg_field_warehouse_person_.py diff --git a/archaeological_warehouse/migrations/0005_auto__chg_field_warehouse_town.py b/archaeological_warehouse/old_migrations/0005_auto__chg_field_warehouse_town.py index c8f67c425..c8f67c425 100644 --- a/archaeological_warehouse/migrations/0005_auto__chg_field_warehouse_town.py +++ b/archaeological_warehouse/old_migrations/0005_auto__chg_field_warehouse_town.py diff --git a/archaeological_warehouse/migrations/0006_auto.py b/archaeological_warehouse/old_migrations/0006_auto.py index fae8058d6..fae8058d6 100644 --- a/archaeological_warehouse/migrations/0006_auto.py +++ b/archaeological_warehouse/old_migrations/0006_auto.py diff --git a/archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py b/archaeological_warehouse/old_migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py index a823623b9..a823623b9 100644 --- a/archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py +++ b/archaeological_warehouse/old_migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py diff --git a/archaeological_warehouse/migrations/0008_auto__add_field_warehouse_alt_address__add_field_warehouse_alt_address.py b/archaeological_warehouse/old_migrations/0008_auto__add_field_warehouse_alt_address__add_field_warehouse_alt_address.py index b543a501e..b543a501e 100644 --- a/archaeological_warehouse/migrations/0008_auto__add_field_warehouse_alt_address__add_field_warehouse_alt_address.py +++ b/archaeological_warehouse/old_migrations/0008_auto__add_field_warehouse_alt_address__add_field_warehouse_alt_address.py diff --git a/archaeological_warehouse/migrations/0009_auto__chg_field_warehouse_phone_desc3__chg_field_warehouse_phone_desc2.py b/archaeological_warehouse/old_migrations/0009_auto__chg_field_warehouse_phone_desc3__chg_field_warehouse_phone_desc2.py index 008faea54..008faea54 100644 --- a/archaeological_warehouse/migrations/0009_auto__chg_field_warehouse_phone_desc3__chg_field_warehouse_phone_desc2.py +++ b/archaeological_warehouse/old_migrations/0009_auto__chg_field_warehouse_phone_desc3__chg_field_warehouse_phone_desc2.py diff --git a/archaeological_warehouse/migrations/0010_auto__add_warehousedivisionlink__add_warehousedivision__chg_field_ware.py b/archaeological_warehouse/old_migrations/0010_auto__add_warehousedivisionlink__add_warehousedivision__chg_field_ware.py index 306ebe290..306ebe290 100644 --- a/archaeological_warehouse/migrations/0010_auto__add_warehousedivisionlink__add_warehousedivision__chg_field_ware.py +++ b/archaeological_warehouse/old_migrations/0010_auto__add_warehousedivisionlink__add_warehousedivision__chg_field_ware.py diff --git a/archaeological_warehouse/migrations/0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py b/archaeological_warehouse/old_migrations/0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py index 0b63f4d5b..0b63f4d5b 100644 --- a/archaeological_warehouse/migrations/0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py +++ b/archaeological_warehouse/old_migrations/0011_auto__add_containerlocalisation__add_unique_containerlocalisation_cont.py diff --git a/archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py b/archaeological_warehouse/old_migrations/0012_auto__add_field_container_cached_label.py index 2ffeaa231..2ffeaa231 100644 --- a/archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py +++ b/archaeological_warehouse/old_migrations/0012_auto__add_field_container_cached_label.py diff --git a/archaeological_warehouse/migrations/0013_auto__add_collection.py b/archaeological_warehouse/old_migrations/0013_auto__add_collection.py index 52c7e841e..52c7e841e 100644 --- a/archaeological_warehouse/migrations/0013_auto__add_collection.py +++ b/archaeological_warehouse/old_migrations/0013_auto__add_collection.py diff --git a/archaeological_warehouse/migrations/0014_auto__add_field_container_cached_location__add_field_container_index.py b/archaeological_warehouse/old_migrations/0014_auto__add_field_container_cached_location__add_field_container_index.py index 4e267e1ac..4e267e1ac 100644 --- a/archaeological_warehouse/migrations/0014_auto__add_field_container_cached_location__add_field_container_index.py +++ b/archaeological_warehouse/old_migrations/0014_auto__add_field_container_cached_location__add_field_container_index.py diff --git a/archaeological_warehouse/migrations/0015_auto_increment_existing_indexes.py b/archaeological_warehouse/old_migrations/0015_auto_increment_existing_indexes.py index 138c2165d..138c2165d 100644 --- a/archaeological_warehouse/migrations/0015_auto_increment_existing_indexes.py +++ b/archaeological_warehouse/old_migrations/0015_auto_increment_existing_indexes.py diff --git a/archaeological_warehouse/migrations/0016_auto__add_unique_container_index_location.py b/archaeological_warehouse/old_migrations/0016_auto__add_unique_container_index_location.py index 055497078..055497078 100644 --- a/archaeological_warehouse/migrations/0016_auto__add_unique_container_index_location.py +++ b/archaeological_warehouse/old_migrations/0016_auto__add_unique_container_index_location.py diff --git a/archaeological_warehouse/migrations/0017_auto__chg_field_container_comment.py b/archaeological_warehouse/old_migrations/0017_auto__chg_field_container_comment.py index bb6d2585e..bb6d2585e 100644 --- a/archaeological_warehouse/migrations/0017_auto__chg_field_container_comment.py +++ b/archaeological_warehouse/old_migrations/0017_auto__chg_field_container_comment.py diff --git a/archaeological_warehouse/migrations/0018_generate_cache_lbl_for_containers.py b/archaeological_warehouse/old_migrations/0018_generate_cache_lbl_for_containers.py index 2e3e62c23..2e3e62c23 100644 --- a/archaeological_warehouse/migrations/0018_generate_cache_lbl_for_containers.py +++ b/archaeological_warehouse/old_migrations/0018_generate_cache_lbl_for_containers.py diff --git a/archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py b/archaeological_warehouse/old_migrations/0019_auto__add_field_container_responsible.py index 21612d227..21612d227 100644 --- a/archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py +++ b/archaeological_warehouse/old_migrations/0019_auto__add_field_container_responsible.py diff --git a/archaeological_warehouse/migrations/0020_generate_cache_lbl_for_containers.py b/archaeological_warehouse/old_migrations/0020_generate_cache_lbl_for_containers.py index 4c6e08dbe..4c6e08dbe 100644 --- a/archaeological_warehouse/migrations/0020_generate_cache_lbl_for_containers.py +++ b/archaeological_warehouse/old_migrations/0020_generate_cache_lbl_for_containers.py diff --git a/archaeological_warehouse/migrations/0021_auto__chg_field_container_responsible.py b/archaeological_warehouse/old_migrations/0021_auto__chg_field_container_responsible.py index 65df3991b..65df3991b 100644 --- a/archaeological_warehouse/migrations/0021_auto__chg_field_container_responsible.py +++ b/archaeological_warehouse/old_migrations/0021_auto__chg_field_container_responsible.py diff --git a/archaeological_warehouse/migrations/0022_auto__chg_field_containertype_volume.py b/archaeological_warehouse/old_migrations/0022_auto__chg_field_containertype_volume.py index 4c0d67711..4c0d67711 100644 --- a/archaeological_warehouse/migrations/0022_auto__chg_field_containertype_volume.py +++ b/archaeological_warehouse/old_migrations/0022_auto__chg_field_containertype_volume.py diff --git a/archaeological_warehouse/migrations/0023_auto__add_field_container_external_id__add_field_container_auto_extern.py b/archaeological_warehouse/old_migrations/0023_auto__add_field_container_external_id__add_field_container_auto_extern.py index 05fd10ffd..05fd10ffd 100644 --- a/archaeological_warehouse/migrations/0023_auto__add_field_container_external_id__add_field_container_auto_extern.py +++ b/archaeological_warehouse/old_migrations/0023_auto__add_field_container_external_id__add_field_container_auto_extern.py diff --git a/archaeological_warehouse/migrations/0024_generate_cache_lbl_for_containers.py b/archaeological_warehouse/old_migrations/0024_generate_cache_lbl_for_containers.py index 51449c167..51449c167 100644 --- a/archaeological_warehouse/migrations/0024_generate_cache_lbl_for_containers.py +++ b/archaeological_warehouse/old_migrations/0024_generate_cache_lbl_for_containers.py diff --git a/archaeological_warehouse/migrations/0025_auto__add_field_container_image__add_field_container_thumbnail.py b/archaeological_warehouse/old_migrations/0025_auto__add_field_container_image__add_field_container_thumbnail.py index cc1f02807..cc1f02807 100644 --- a/archaeological_warehouse/migrations/0025_auto__add_field_container_image__add_field_container_thumbnail.py +++ b/archaeological_warehouse/old_migrations/0025_auto__add_field_container_image__add_field_container_thumbnail.py diff --git a/archaeological_warehouse/migrations/0026_generate_cache_lbl_for_containers.py b/archaeological_warehouse/old_migrations/0026_generate_cache_lbl_for_containers.py index 85df1bf21..85df1bf21 100644 --- a/archaeological_warehouse/migrations/0026_generate_cache_lbl_for_containers.py +++ b/archaeological_warehouse/old_migrations/0026_generate_cache_lbl_for_containers.py diff --git a/archaeological_warehouse/old_migrations/__init__.py b/archaeological_warehouse/old_migrations/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/archaeological_warehouse/old_migrations/__init__.py diff --git a/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html b/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html index 41be02748..4d0a63c17 100644 --- a/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html +++ b/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html @@ -1,6 +1,5 @@  {% extends "ishtar/wizard/default_wizard.html" %}  {% load i18n %} -{% load url from future %}  {% block form_head %}  {% if not wizard.form.fields %}  <p class="alert"> diff --git a/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html b/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html index 83dbfc0fe..cceabb4a0 100644 --- a/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html +++ b/archaeological_warehouse/templates/ishtar/wizard/wizard_warehouse_divisions.html @@ -1,6 +1,5 @@  {% extends "ishtar/wizard/default_wizard.html" %}  {% load i18n %} -{% load url from future %}  {% block form_head %}  {% if wizard.form.readonly %}  <p class="alert"> diff --git a/archaeological_warehouse/urls.py b/archaeological_warehouse/urls.py index ec3aa1beb..2ef3c8e58 100644 --- a/archaeological_warehouse/urls.py +++ b/archaeological_warehouse/urls.py @@ -17,7 +17,7 @@  # See the file COPYING for details. -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url  from ishtar_common.wizards import check_rights  import views diff --git a/archaeological_warehouse/views.py b/archaeological_warehouse/views.py index 677539a3f..60d31c09d 100644 --- a/archaeological_warehouse/views.py +++ b/archaeological_warehouse/views.py @@ -48,9 +48,9 @@ def autocomplete_warehouse(request):                                   models.Warehouse)\         and not request.user.has_perm(              'ishtar_common.view_own_warehouse', models.Warehouse): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -61,7 +61,7 @@ def autocomplete_warehouse(request):      warehouses = models.Warehouse.objects.filter(query)[:limit]      data = json.dumps([{'id': warehouse.pk, 'value': unicode(warehouse)}                         for warehouse in warehouses]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def autocomplete_container(request): @@ -69,9 +69,9 @@ def autocomplete_container(request):                                   models.Warehouse)\         and not request.user.has_perm(              'ishtar_common.view_own_warehouse', models.Warehouse): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -85,7 +85,7 @@ def autocomplete_container(request):      containers = models.Container.objects.filter(query)[:limit]      data = json.dumps([{'id': container.pk, 'value': unicode(container)}                         for container in containers]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  warehouse_packaging_wizard = PackagingWizard.as_view([      ('seleccontainer-packaging', ContainerFormSelection), diff --git a/django-simple-history/AUTHORS b/django-simple-history/AUTHORS deleted file mode 100644 index 2865a62cc..000000000 --- a/django-simple-history/AUTHORS +++ /dev/null @@ -1,14 +0,0 @@ -The current maintainer of django-simple-history is Corey Bertram 
 -<corey@qr7.com>, who may be found online at <http://www.qr7.com/>.
 -
 -This code originally comes from Pro Django, published by Apress, Inc.
 -in December 2008. The author of the book and primary author
 -of the code is Marty Alchin <marty@martyalchin.com>, who
 -may be found online at <http://martyalchin.com/>.
 -
 -As part of the technical review process, additional code
 -modifications were provided by the technical reviewer,
 -George Vilches <gav@thataddress.com>.
 -
 -Others who have contributed to the application:
 -* Your name here!
 diff --git a/django-simple-history/CHANGELOG b/django-simple-history/CHANGELOG deleted file mode 100644 index 420d95b09..000000000 --- a/django-simple-history/CHANGELOG +++ /dev/null @@ -1,5 +0,0 @@ -Oct 22, 2010: - - Merged setup.py from Klaas van Schelven - Thanks!  - -Feb 21, 2010: - - Initial project creation, with changes to support ForeignKey relations. diff --git a/django-simple-history/LICENSE.txt b/django-simple-history/LICENSE.txt deleted file mode 100644 index 1d62e68c7..000000000 --- a/django-simple-history/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2008, Marty Alchin
 -All rights reserved.
 -
 -Redistribution and use in source and binary forms, with or without
 -modification, are permitted provided that the following conditions are
 -met:
 -
 -    * Redistributions of source code must retain the above copyright
 -      notice, this list of conditions and the following disclaimer.
 -    * Redistributions in binary form must reproduce the above
 -      copyright notice, this list of conditions and the following
 -      disclaimer in the documentation and/or other materials provided
 -      with the distribution.
 -    * Neither the name of the author nor the names of other
 -      contributors may be used to endorse or promote products derived
 -      from this software without specific prior written permission.
 -
 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file diff --git a/django-simple-history/MANIFEST.in b/django-simple-history/MANIFEST.in deleted file mode 100644 index f1b15f396..000000000 --- a/django-simple-history/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include CHANGELOG -include MANIFEST.in -include README -include AUTHORS -include LICENSE.txt diff --git a/django-simple-history/README b/django-simple-history/README deleted file mode 100644 index 3a12cfbf2..000000000 --- a/django-simple-history/README +++ /dev/null @@ -1,77 +0,0 @@ -django-simple-history is a tool to store state of DB objects on every create/update/delete. It has been tested to work in django 1.X (including 1.2.3 as of 10/25/2010). - -== Install == -Download the tar.gz, extract it and run the following inside the directory: -    python setup.py install - -== Basic usage == -Using this package is _really_ simple; you just have to import HistoricalRecords and create an instance of it on every model you want to historically track. - -On your models you need to include the following line at the top: -    from simple_history.models import HistoricalRecords - -Then in your model class, include the following line: -    history = HistoricalRecords() - -Then from either the model class or from an instance, you can access history.all() which will give you either every history item of the class, or every history item of the specific instance. - -== Example == -class Poll(models.Model): -    question = models.CharField(max_length = 200) -    pub_date = models.DateTimeField('date published') - -    history = HistoricalRecords() - -class Choice(models.Model): -    poll = models.ForeignKey(Poll) -    choice = models.CharField(max_length=200) -    votes = models.IntegerField() - -    history = HistoricalRecords() -                                         - -$ ./manage.py shell -In [2]: from poll.models import Poll, Choice - -In [3]: Poll.objects.all() -Out[3]: [] - -In [4]: import datetime - -In [5]: p = Poll(question="what's up?", pub_date=datetime.datetime.now()) - -In [6]: p.save() - -In [7]: p -Out[7]: <Poll: Poll object> - -In [9]: p.history.all() -Out[9]: [<HistoricalPoll: Poll object as of 2010-10-25 18:03:29.855689>] - -In [10]: p.pub_date = datetime.datetime(2007,4,1,0,0) - -In [11]: p.save() - -In [13]: p.history.all() -Out[13]: [<HistoricalPoll: Poll object as of 2010-10-25 18:04:13.814128>, <HistoricalPoll: Poll object as of 2010-10-25 18:03:29.855689>] - -In [14]: p.choice_set.create(choice='Not Much', votes=0) -Out[14]: <Choice: Choice object> - -In [15]: p.choice_set.create(choice='The sky', votes=0) -Out[15]: <Choice: Choice object> - -In [16]: c = p.choice_set.create(choice='Just hacking again', votes=0) - -In [17]: c.poll -Out[17]: <Poll: Poll object> - -In [19]: c.history.all() -Out[19]: [<HistoricalChoice: Choice object as of 2010-10-25 18:05:30.160595>] - -In [20]: Choice.history -Out[20]: <simple_history.manager.HistoryManager object at 0x1cc4290> - -In [21]: Choice.history.all() -Out[21]: [<HistoricalChoice: Choice object as of 2010-10-25 18:05:30.160595>, <HistoricalChoice: Choice object as of 2010-10-25 18:05:12.183340>, <HistoricalChoice: Choice object as of 2010-10-25 18:04:59.047351>] - diff --git a/django-simple-history/setup.py b/django-simple-history/setup.py deleted file mode 100644 index 712d7d2d4..000000000 --- a/django-simple-history/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from distutils.core import setup -import os - -# compile the list of packages available, because distutils doesn't have an easy way to do this -packages, data_files = [], [] -root_dir = os.path.dirname(__file__) -if root_dir: -    os.chdir(root_dir) - -for dirpath, dirnames, filenames in os.walk('simple_history'): -    # ignore dirnames that start with '.' -    for i, dirname in enumerate(dirnames): -        if dirname.startswith('.'): -            del dirnames[i] -    if '__init__.py' in filenames: -        pkg = dirpath.replace(os.path.sep, '.') -        if os.path.altsep: -            pkg = pkg.replace(os.path.altsep, '.') -        packages.append(pkg) -    elif filenames: -        # strip 'simple_history/' or 'simple_history\' -        prefix = dirpath[15:] -        for f in filenames: -            data_files.append(os.path.join(prefix, f)) - -setup(name='simple_history', -      version='1.1.3', -      description='Store Django model history with the ability to revert back to a specific change at any time.', -      author='Corey Bertram', -      author_email='corey@qr7.com', -      mantainer='Joao Pedro Francese', -      mantainer_email='joaofrancese@gmail.com', -      url='http://bitbucket.org/joaofrancese/django-simple-history', -      package_dir={'simple_history': 'simple_history'}, -      packages=packages, -      package_data={'simple_history': data_files}, -      classifiers=[ -          "Development Status :: 5 - Production/Stable", -          "Framework :: Django", -          ], -      ) diff --git a/django-simple-history/simple_history/__init__.py b/django-simple-history/simple_history/__init__.py deleted file mode 100755 index 6df0b60b6..000000000 --- a/django-simple-history/simple_history/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -import models - - -registered_models = {} - - -def register(model, app=None, manager_name='history'): -    """ -    Create historical model for `model` and attach history manager to `model`. - -    Keyword arguments: -    app -- App to install historical model into (defaults to model.__module__) -    manager_name -- class attribute name to use for historical manager - -    This method should be used as an alternative to attaching an -    `HistoricalManager` instance directly to `model`. -    """ -    if not model in registered_models: -        records = models.HistoricalRecords() -        records.manager_name = manager_name -        records.module = ("%s.models" % app) or model.__module__ -        records.finalize(model) diff --git a/django-simple-history/simple_history/admin.py b/django-simple-history/simple_history/admin.py deleted file mode 100644 index 7d83e1016..000000000 --- a/django-simple-history/simple_history/admin.py +++ /dev/null @@ -1,139 +0,0 @@ -from django import template -from django.core.exceptions import PermissionDenied -from django.conf.urls.defaults import patterns, url -from django.contrib import admin -from django.contrib.admin import helpers -from django.contrib.contenttypes.models import ContentType -from django.core.urlresolvers import reverse -from django.shortcuts import get_object_or_404, render_to_response -from django.contrib.admin.util import unquote -from django.utils.text import capfirst -from django.utils.html import mark_safe -from django.utils.translation import ugettext as _ -from django.utils.encoding import force_unicode - - -class SimpleHistoryAdmin(admin.ModelAdmin): -    object_history_template = "simple_history/object_history.html" -    object_history_form_template = "simple_history/object_history_form.html" - -    def get_urls(self): -        """Returns the additional urls used by the Reversion admin.""" -        urls = super(SimpleHistoryAdmin, self).get_urls() -        admin_site = self.admin_site -        opts = self.model._meta -        info = opts.app_label, opts.module_name, -        history_urls = patterns("", -            url("^([^/]+)/history/([^/]+)/$", -                admin_site.admin_view(self.history_form_view), -                name='%s_%s_simple_history' % info),) -        return history_urls + urls - -    def history_view(self, request, object_id, extra_context=None): -        "The 'history' admin view for this model." -        model = self.model -        opts = model._meta -        app_label = opts.app_label -        pk_name = opts.pk.attname -        history = getattr(model, model._meta.simple_history_manager_attribute) -        action_list = history.filter(**{pk_name: object_id}) -        # If no history was found, see whether this object even exists. -        obj = get_object_or_404(model, pk=unquote(object_id)) -        context = { -            'title': _('Change history: %s') % force_unicode(obj), -            'action_list': action_list, -            'module_name': capfirst(force_unicode(opts.verbose_name_plural)), -            'object': obj, -            'root_path': getattr(self.admin_site, 'root_path', None), -            'app_label': app_label, -            'opts': opts -        } -        context.update(extra_context or {}) -        context_instance = template.RequestContext(request, current_app=self.admin_site.name) -        return render_to_response(self.object_history_template, context, context_instance=context_instance) - -    def history_form_view(self, request, object_id, version_id): -        original_model = self.model -        original_opts = original_model._meta -        history = getattr(self.model, self.model._meta.simple_history_manager_attribute) -        model = history.model -        opts = model._meta -        pk_name = original_opts.pk.attname -        record = get_object_or_404(model, **{pk_name: object_id, 'history_id': version_id}) -        obj = record.instance -        obj._state.adding = False - -        if not self.has_change_permission(request, obj): -            raise PermissionDenied - -        if request.method == 'POST' and '_saveas_new' in request.POST: -            return self.add_view(request, form_url='../add/') - -        formsets = [] -        ModelForm = self.get_form(request, obj) -        if request.method == 'POST': -            form = ModelForm(request.POST, request.FILES, instance=obj) -            if form.is_valid(): -                form_validated = True -                new_object = self.save_form(request, form, change=True) -            else: -                form_validated = False -                new_object = obj -            prefixes = {} - -            if form_validated: -                self.save_model(request, new_object, form, change=True) -                form.save_m2m() - -                change_message = self.construct_change_message(request, form, formsets) -                self.log_change(request, new_object, change_message) -                return self.response_change(request, new_object) - -        else: -            form = ModelForm(instance=obj) - -        adminForm = helpers.AdminForm(form, self.get_fieldsets(request, obj), -            self.prepopulated_fields, self.get_readonly_fields(request, obj), -            model_admin=self) -        media = self.media + adminForm.media - -        url_triplet = (self.admin_site.name, original_opts.app_label, -                            original_opts.module_name) -        context = { -            'title': _('Revert %s') % force_unicode(obj), -            'adminform': adminForm, -            'object_id': object_id, -            'original': obj, -            'is_popup': False, -            'media': mark_safe(media), -            'errors': helpers.AdminErrorList(form, formsets), -            'app_label': opts.app_label, -            'original_opts': original_opts, -            'changelist_url': reverse('%s:%s_%s_changelist' % url_triplet), -            'change_url': reverse('%s:%s_%s_change' % url_triplet, args=(obj.pk,)), -            'history_url': reverse('%s:%s_%s_history' % url_triplet, args=(obj.pk,)), -            # Context variables copied from render_change_form -            'add': False, -            'change': True, -            'has_add_permission': self.has_add_permission(request), -            'has_change_permission': self.has_change_permission(request, obj), -            'has_delete_permission': self.has_delete_permission(request, obj), -            'has_file_field': True, -            'has_absolute_url': False, -            'ordered_objects': opts.get_ordered_objects(), -            'form_url': '', -            'opts': opts, -            'content_type_id': ContentType.objects.get_for_model(self.model).id, -            'save_as': self.save_as, -            'save_on_top': self.save_on_top, -            'root_path': getattr(self.admin_site, 'root_path', None), -        } -        context_instance = template.RequestContext(request, current_app=self.admin_site.name) -        return render_to_response(self.object_history_form_template, context, context_instance) - -    def save_model(self, request, obj, form, change): -        """ -        Add the admin user to a special model attribute for reference after save -        """ -        obj._history_user = request.user -        super(SimpleHistoryAdmin, self).save_model(request, obj, form, change) diff --git a/django-simple-history/simple_history/manager.py b/django-simple-history/simple_history/manager.py deleted file mode 100755 index 923b310eb..000000000 --- a/django-simple-history/simple_history/manager.py +++ /dev/null @@ -1,75 +0,0 @@ -from django.db import models - - -class HistoryDescriptor(object): -    def __init__(self, model): -        self.model = model - -    def __get__(self, instance, owner): -        if instance is None: -            return HistoryManager(self.model) -        return HistoryManager(self.model, instance) - - -class HistoryManager(models.Manager): -    def __init__(self, model, instance=None): -        super(HistoryManager, self).__init__() -        self.model = model -        self.instance = instance - -    def get_query_set(self): -        if self.instance is None: -            return super(HistoryManager, self).get_query_set() - -        if isinstance(self.instance._meta.pk, models.OneToOneField): -            filter = {self.instance._meta.pk.name + "_id": self.instance.pk} -        else: -            filter = {self.instance._meta.pk.name: self.instance.pk} -        return super(HistoryManager, self).get_query_set().filter(**filter) - -    def most_recent(self): -        """ -        Returns the most recent copy of the instance available in the history. -        """ -        if not self.instance: -            raise TypeError("Can't use most_recent() without a %s instance." % -                            self.instance._meta.object_name) -        tmp = [] -        for field in self.instance._meta.fields: -            if isinstance(field, models.ForeignKey): -                tmp.append(field.name + "_id") -            else: -                tmp.append(field.name) -        fields = tuple(tmp) -        try: -            values = self.values_list(*fields)[0] -        except IndexError: -            raise self.instance.DoesNotExist("%s has no historical record." % -                                             self.instance._meta.object_name) -        return self.instance.__class__(*values) - -    def as_of(self, date): -        """ -        Returns an instance of the original model with all the attributes set -        according to what was present on the object on the date provided. -        """ -        if not self.instance: -            raise TypeError("Can't use as_of() without a %s instance." % -                            self.instance._meta.object_name) -        tmp = [] -        for field in self.instance._meta.fields: -            if isinstance(field, models.ForeignKey): -                tmp.append(field.name + "_id") -            else: -                tmp.append(field.name) -        fields = tuple(tmp) -        qs = self.filter(history_date__lte=date) -        try: -            values = qs.values_list('history_type', *fields)[0] -        except IndexError: -            raise self.instance.DoesNotExist("%s had not yet been created." % -                                             self.instance._meta.object_name) -        if values[0] == '-': -            raise self.instance.DoesNotExist("%s had already been deleted." % -                                             self.instance._meta.object_name) -        return self.instance.__class__(*values[1:]) diff --git a/django-simple-history/simple_history/models.py b/django-simple-history/simple_history/models.py deleted file mode 100644 index 06054ba34..000000000 --- a/django-simple-history/simple_history/models.py +++ /dev/null @@ -1,169 +0,0 @@ -import copy -from django.db import models -from django.contrib import admin -from django.contrib.auth.models import User -from django.utils import importlib -from manager import HistoryDescriptor - - -class HistoricalRecords(object): -    def contribute_to_class(self, cls, name): -        self.manager_name = name -        self.module = cls.__module__ -        models.signals.class_prepared.connect(self.finalize, sender=cls) - -        def save_without_historical_record(self, *args, **kwargs): -            """Caution! Make sure you know what you're doing before you use this method.""" -            self.skip_history_when_saving = True -            ret = self.save(*args, **kwargs) -            del self.skip_history_when_saving -            return ret -        setattr(cls, 'save_without_historical_record', save_without_historical_record) - -    def finalize(self, sender, **kwargs): -        history_model = self.create_history_model(sender) -        module = importlib.import_module(self.module) -        setattr(module, history_model.__name__, history_model) - -        # The HistoricalRecords object will be discarded, -        # so the signal handlers can't use weak references. -        models.signals.post_save.connect(self.post_save, sender=sender, -                                         weak=False) -        models.signals.post_delete.connect(self.post_delete, sender=sender, -                                           weak=False) - -        descriptor = HistoryDescriptor(history_model) -        setattr(sender, self.manager_name, descriptor) -        sender._meta.simple_history_manager_attribute = self.manager_name - -    def create_history_model(self, model): -        """ -        Creates a historical model to associate with the model provided. -        """ -        attrs = {'__module__': self.module} - -        fields = self.copy_fields(model) -        attrs.update(fields) -        attrs.update(self.get_extra_fields(model, fields)) -        attrs.update(Meta=type('Meta', (), self.get_meta_options(model))) -        name = 'Historical%s' % model._meta.object_name -        return type(name, (models.Model,), attrs) - -    def copy_fields(self, model): -        """ -        Creates copies of the model's original fields, returning -        a dictionary mapping field name to copied field object. -        """ -        fields = {} - -        for field in model._meta.fields: -            field = copy.copy(field) -            fk = None - -            if isinstance(field, models.AutoField): -                # The historical model gets its own AutoField, so any -                # existing one must be replaced with an IntegerField. -                field.__class__ = models.IntegerField - -            if isinstance(field, models.ForeignKey): -                field.__class__ = models.IntegerField -                #ughhhh. open to suggestions here -                try: -                    field.rel = None -                except: -                    pass -                try: -                    field.related = None -                except: -                    pass -                try: -                    field.related_query_name = None -                except: -                    pass -                field.null = True -                field.blank = True -                fk = True -            else: -                fk = False - -            # The historical instance should not change creation/modification timestamps. -            field.auto_now = False -            field.auto_now_add = False - -            if field.primary_key or field.unique: -                # Unique fields can no longer be guaranteed unique, -                # but they should still be indexed for faster lookups. -                field.primary_key = False -                field._unique = False -                field.db_index = True -                field.serialize = True -            if fk: -                field.name = field.name + "_id" -            fields[field.name] = field - -        return fields - -    def get_extra_fields(self, model, fields): -        """ -        Returns a dictionary of fields that will be added to the historical -        record model, in addition to the ones returned by copy_fields below. -        """ -        @models.permalink -        def revert_url(self): -            opts = model._meta -            return ('%s:%s_%s_simple_history' % -                    (admin.site.name, opts.app_label, opts.module_name), -                    [getattr(self, opts.pk.attname), self.history_id]) -        def get_instance(self): -            return model(**dict([(k, getattr(self, k)) for k in fields])) - -        return { -            'history_id': models.AutoField(primary_key=True), -            'history_date': models.DateTimeField(auto_now_add=True), -            'history_user': models.ForeignKey(User, null=True), -            'history_type': models.CharField(max_length=1, choices=( -                ('+', 'Created'), -                ('~', 'Changed'), -                ('-', 'Deleted'), -            )), -            'history_object': HistoricalObjectDescriptor(model), -            'instance': property(get_instance), -            'revert_url': revert_url, -            '__unicode__': lambda self: u'%s as of %s' % (self.history_object, -                                                          self.history_date) -        } - -    def get_meta_options(self, model): -        """ -        Returns a dictionary of fields that will be added to -        the Meta inner class of the historical record model. -        """ -        return { -            'ordering': ('-history_date', '-history_id'), -        } - -    def post_save(self, instance, created, **kwargs): -        if not created and hasattr(instance, 'skip_history_when_saving'): -            return -        if not kwargs.get('raw', False): -            self.create_historical_record(instance, created and '+' or '~') - -    def post_delete(self, instance, **kwargs): -        self.create_historical_record(instance, '-') - -    def create_historical_record(self, instance, type): -        history_user = getattr(instance, '_history_user', None) -        manager = getattr(instance, self.manager_name) -        attrs = {} -        for field in instance._meta.fields: -            attrs[field.attname] = getattr(instance, field.attname) -        manager.create(history_type=type, history_user=history_user, **attrs) - - -class HistoricalObjectDescriptor(object): -    def __init__(self, model): -        self.model = model - -    def __get__(self, instance, owner): -        values = (getattr(instance, f.attname) for f in self.model._meta.fields) -        return self.model(*values) diff --git a/django-simple-history/simple_history/templates/simple_history/object_history.html b/django-simple-history/simple_history/templates/simple_history/object_history.html deleted file mode 100644 index d14338232..000000000 --- a/django-simple-history/simple_history/templates/simple_history/object_history.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends "admin/object_history.html" %} -{% load i18n %} - - -{% block content %} -	<div id="content-main"> - -		<p>{% blocktrans %}Choose a date from the list below to revert to a previous version of this object.{% endblocktrans %}</p> - -		<div class="module"> -			{% if action_list %} -				<table id="change-history"> -					<thead> -						<tr> -							<th scope="col">{% trans 'Object' %}</th> -							<th scope="col">{% trans 'Date/time' %}</th> -							<th scope="col">{% trans 'Comment' %}</th> -							<th scope="col">{% trans 'Changed by' %}</th> -						</tr> -					</thead> -					<tbody> -						{% for action in action_list %} -							<tr> -								<td><a href="{{ action.revert_url }}">{{ action.history_object }}</a></td> -								<td>{{ action.history_date }}</td> -								<td>{{ action.get_history_type_display }}</td> -								<td><a href="{% url admin:auth_user_change action.history_user_id %}">{{ action.history_user }}</a></td> -							</tr> -						{% endfor %} -					</tbody> -				</table> -			{% else %} -				<p>{% trans "This object doesn't have a change history." %}</p> -			{% endif %} -		</div> -	</div> -{% endblock %} - diff --git a/django-simple-history/simple_history/templates/simple_history/object_history_form.html b/django-simple-history/simple_history/templates/simple_history/object_history_form.html deleted file mode 100644 index fdc8f1a87..000000000 --- a/django-simple-history/simple_history/templates/simple_history/object_history_form.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "admin/change_form.html" %} -{% load i18n %} - -{% block breadcrumbs %} -	<div class="breadcrumbs"> -		<a href="{% url admin:index %}">{% trans "Home" %}</a> › -		<a href="{% url admin:app_list app_label %}">{{app_label|capfirst|escape}}</a> › -		<a href="{{changelist_url}}">{{opts.verbose_name_plural|capfirst}}</a> › -		<a href="{{change_url}}">{{original|truncatewords:"18"}}</a> › -		<a href="../">{% trans "History" %}</a> › -		{% blocktrans with original_opts.verbose_name as verbose_name %}Revert {{verbose_name}}{% endblocktrans %} -	</div> -{% endblock %} - -{% comment %}Hack to remove "Save as New" and "Save and Continue" buttons {% endcomment %} -{% block content %} -	{% with 1 as is_popup %} -		{{block.super}} -	{% endwith %} -{% endblock %} - -{% block form_top %} -	<p>{% blocktrans %}Press the save button below to revert to this version of the object.{% endblocktrans %}</p> -{% endblock %} diff --git a/example_project/__init__.py b/example_project/__init__.py index 0cfc3ae26..c6adb7559 100644 --- a/example_project/__init__.py +++ b/example_project/__init__.py @@ -1,5 +1,6 @@  # force the retranslation of generated strings and external module -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ +  _(u"username")  _(u"email address")  _(u"warehouse") diff --git a/example_project/local_settings.py.gitlab-ci b/example_project/local_settings.py.gitlab-ci index 81196b4a0..913f10fea 100644 --- a/example_project/local_settings.py.gitlab-ci +++ b/example_project/local_settings.py.gitlab-ci @@ -4,7 +4,7 @@ DATABASES = {          'NAME': 'gis',          'USER': 'gis',          'PASSWORD': 'gis', -        'HOST': 'iggdrasil-postgis-1.5', +        'HOST': 'mdillon-postgis',          'PORT': '5432',      }  } @@ -13,3 +13,5 @@ LOGFILE = '/tmp/ishtar.log'  PROJECT_SLUG = "CI-instance"  USE_SPATIALITE_FOR_TESTS = False + +SECRET_KEY = "not-so-secret-key" diff --git a/example_project/local_settings.py.sample b/example_project/local_settings.py.sample index 5a7550d9a..f49963c84 100644 --- a/example_project/local_settings.py.sample +++ b/example_project/local_settings.py.sample @@ -4,14 +4,13 @@  # rename this file to local_settings.py and overload settings in this file  # Make this string unique, and don't share it with anybody. +# Don't leave it empty  SECRET_KEY = ''  ADMINS = (      # ('Your Name', 'your_email@domain.com'),  ) -MANAGERS = ADMINS -  DATABASES = {      'default': {          'NAME': 'ishtar', diff --git a/example_project/manage.py b/example_project/manage.py index 4981a4830..80114eb68 100755 --- a/example_project/manage.py +++ b/example_project/manage.py @@ -1,15 +1,12 @@  #!/usr/bin/env python -from django.core.management import execute_manager -import os, sys +import os +import sys  sys.path.append(os.path.abspath('..')) -try: -    import settings # Assumed to be in the same directory. -except ImportError: -    import sys -    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) -    sys.exit(1) -  if __name__ == "__main__": -    execute_manager(settings) +    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") + +    from django.core.management import execute_from_command_line + +    execute_from_command_line(sys.argv) diff --git a/example_project/settings.py b/example_project/settings.py index c7880d8c8..778a16610 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -7,10 +7,12 @@ import sys  DEBUG = False  DEBUG_TOOLBAR = False +DEBUG_TO_CONSOLE = False  TEMPLATE_DEBUG = DEBUG  SQL_DEBUG = False  DJANGO_EXTENSIONS = False -USE_SPATIALITE_FOR_TESTS = True +USE_SPATIALITE_FOR_TESTS = False +TEST_VIEWS = True  if "test" in sys.argv:      sys.path.insert(0, '..') @@ -35,7 +37,6 @@ ODT_TEMPLATE = ROOT_PATH + "../ishtar_common/static/template.odt"  LOGIN_REDIRECT_URL = "/" + URL_PATH -AUTH_PROFILE_MODULE = 'ishtar_common.IshtarUser'  ACCOUNT_ACTIVATION_DAYS = 7  # change this in local_settings @@ -137,10 +138,8 @@ INSTALLED_APPS = [      'django.contrib.sites',      'django.contrib.gis',      'django.contrib.staticfiles', -    'django.contrib.formtools',      'django.contrib.messages',      'django.contrib.humanize', -    'south',      'registration',      # 'geodjangofla',      'ishtar_pdl', @@ -234,9 +233,6 @@ ISHTAR_DOC_TYPES = {u"undefined": u"Undefined"}  ISHTAR_DPTS = [] -PRE_APPS = [] -EXTRA_APPS = [] -  TEST_RUNNER = 'ishtar_common.tests.ManagedModelTestRunner'  try: @@ -246,12 +242,9 @@ except ImportError, e:  TESTING = sys.argv[1:2] == ['test'] -if TESTING: -    SOUTH_TESTS_MIGRATE = False - -    if USE_SPATIALITE_FOR_TESTS: -        DATABASES['default']['ENGINE'] = \ -            'django.contrib.gis.db.backends.spatialite' +# if TESTING and USE_SPATIALITE_FOR_TESTS: +#     DATABASES['default']['ENGINE'] = \ +#         'django.contrib.gis.db.backends.spatialite'  PROJECT_SLUG = locals().get('PROJECT_SLUG', 'default') @@ -269,7 +262,10 @@ JQUERY_UI_URL = STATIC_URL + "js/jquery-ui/"  if DEBUG:      # make all loggers use the console      for logger in LOGGING['loggers']: -        LOGGING['loggers'][logger]['handlers'] += ['console'] +        if DEBUG_TO_CONSOLE: +            LOGGING['loggers'][logger]['handlers'] = ['console'] +        elif 'console' not in LOGGING['loggers'][logger]['handlers']: +            LOGGING['loggers'][logger]['handlers'] += ['console']  if DJANGO_EXTENSIONS:      INSTALLED_APPS.append('django_extensions') diff --git a/example_project/urls.py b/example_project/urls.py index 62a6b1e04..0e138eb8e 100644 --- a/example_project/urls.py +++ b/example_project/urls.py @@ -1,5 +1,5 @@  from django.conf import settings -from django.conf.urls.defaults import * +from django.conf.urls import patterns, include, url  from django.contrib import admin  admin.autodiscover() diff --git a/install/README b/install/README deleted file mode 100644 index dc15fa147..000000000 --- a/install/README +++ /dev/null @@ -1,9 +0,0 @@ -cd /tmp -apt-get install wget -wget http://lysithea.proxience.net/ishtar-install.tar.gz - -tar xvzf ishtar-install.tar.gz -rm ishtar-install.tar.gz -cd install -export APP_NAME=myinstance && export URL=localhost \ -       && export PROJECT_NAME="Project name" && bash install.sh diff --git a/install/README.md b/install/README.md new file mode 100644 index 000000000..0235c2d6e --- /dev/null +++ b/install/README.md @@ -0,0 +1,33 @@ +Follow theses instruction to install Ishtar from sources on a Debian Jessie installation. + +### Get installations scripts + +``` +apt-get install wget +cd /usr/local/src +wget https://ishtar-archeo.net/install/install-ishtar.tar.bz2 + +tar xvzf ishtar-install.tar.gz +rm ishtar-install.tar.gz +``` + +#### Install Ishtar + +``` +cd /usr/local/src/install +bash ./ishtar-install +``` + +#### Configure an Ishtar instance + +``` +cd /usr/local/src/install +bash ./ishtar-prepare-instance +``` + +#### Delete an Ishtar instance + +``` +cd /usr/local/src/install +bash ./ishtar-delete-instance +``` diff --git a/install/django.wsgi.template b/install/django.wsgi.template deleted file mode 100644 index a618f0a41..000000000 --- a/install/django.wsgi.template +++ /dev/null @@ -1,7 +0,0 @@ -import os, sys -MAIN_PATH = os.path.realpath(os.path.dirname(__file__)) + "/.." -sys.path.append(MAIN_PATH) -os.environ['DJANGO_SETTINGS_MODULE'] = '#APP_NAME#.settings' -import django.core.handlers.wsgi -application = django.core.handlers.wsgi.WSGIHandler() - diff --git a/install/install.sh b/install/install.sh deleted file mode 100755 index 7a9a55bd7..000000000 --- a/install/install.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/bash - -###################################################################### -# Minimum configuration                                              # -###################################################################### - -# only lower alpha-numeric char and '_' and must start with a letter -[ -z "$APP_NAME" ] && ( echo 'APP_NAME empty. Default to: "default".' ; ); -APP_NAME=${APP_NAME-default} - -[ -z $URL ] && ( echo 'URL empty. Default to: "localhost".' ; URL=localhost ; ); -URL=${URL-localhost} - -[ -z "$PROJECT_NAME" ] && ( echo 'PROJECT_NAME empty. Default to: "'$APP_NAME'".' ; ); -PROJECT_NAME=${PROJECT_NAME-$APP_NAME} - -DEFAULT_DATA='fr' # available data: 'fr' - -###################################################################### -# Advanced configuration                                             # -###################################################################### - -# if the database is not local the database will be not automatically -# created -[ -z $DB_HOST ] && ( echo 'DB_HOST empty. Default to: "127.0.0.1".' ; ); -DB_HOST=${DB_HOST-127.0.0.1} - -# if not set automatically generated -DB_PASSWORD=${DB_PASSWORD-''} -DB_PORT='5432' -PG_VERSION=9.1 - -# ishtar git branch -[ -z "$VERSION" ] && ( echo 'VERSION empty. Default to: "stable".' ; ); -VERSION=${VERSION-stable} - -# change it for each instance on a same server -UWSGI_PORT=${UWSGI_PORT-8891} - -# webserver port - default "80" -NGINX_PORT=${NGINX_PORT-80} - -# don't forget the trailing slash -INSTALL_PREFIX=/srv/ - -# if a virtualenv is used put the full path of the python to use -PYTHON=python - -# proxy for pip -PIP_OPTIONS='' -[ -z "$http_proxy" ] || PIP_OPTIONS=' --proxy '$http_proxy; -[ -z "$HTTP_PROXY" ] || PIP_OPTIONS=' --proxy '$HTTP_PROXY; - -# default for debian -UWSGI_AVAILABLE_PATH='/etc/uwsgi/apps-available/' -UWSGI_ENABLE_PATH='/etc/uwsgi/apps-enabled/' -NGINX_AVAILABLE_PATH='/etc/nginx/sites-available/' -NGINX_ENABLE_PATH='/etc/nginx/sites-enabled/' - -# Don't edit below this line -###################################################################### - -echo "* installing dependencies" - -if [ $DB_HOST = "127.0.0.1" ]; then -    apt-get -q -y install postgresql postgresql-$PG_VERSION-postgis postgresql 2> /dev/null > /dev/null -fi - -apt-get -q -y install git apg python-pip 2> /dev/null > /dev/null - -apt-get -q -y install python python-django \ -      libjs-jquery libjs-jquery-ui python-pisa python-django-registration \ -      python-utidylib python-lxml python-imaging python-django-south \ -      python-psycopg2 python-gdal gettext python-bs4 python-tidylib \ -      python-unicodecsv \ -      python-django-extra-views python-memcache python-dbf 2> /dev/null > /dev/null - -apt-get -q -y install uwsgi uwsgi-plugin-python nginx memcached 2> /dev/null > /dev/null - -pip install$PIP_OPTIONS BeautifulSoup4==4.3.2 - -if [ -z "$DB_PASSWORD" ] -then - -DB_PASSWORD=`apg -a 0 -M ncl -n 6 -x 10 -m 10 |head -n 1` - -fi - -DB_NAME='ishtar'$APP_NAME -INSTALL_PATH=$INSTALL_PREFIX$DB_NAME -DATE=`date +%F` -CDIR=`pwd` -SECRET_KEY=`apg -a 0 -M ncl -n 6 -x 10 -m 40 |head -n 1` - -if [ $DB_HOST = '127.0.0.1' ] -then - -echo "* create database and user" -DB_PASSWORD=$DB_PASSWORD DB_NAME=$DB_NAME PROJECT_NAME=$PROJECT_NAME PG_VERSION=$PG_VERSION su postgres <<'EOF' -cd -if [ `psql -l | grep template_postgis | wc -l` -ne 1 ]; then -    echo "  * create template_postgis" -    createdb template_postgis -    psql -d template_postgis -f /usr/share/postgresql/$PG_VERSION/contrib/postgis-1.5/postgis.sql 2> /dev/null > /dev/null -    psql -d template_postgis -f /usr/share/postgresql/$PG_VERSION/contrib/postgis-1.5/spatial_ref_sys.sql 2> /dev/null > /dev/null - -fi -if [ `psql -l | grep $DB_NAME | wc -l` -ne 1 ]; then -    echo "  * create "$DB_NAME -    createuser --echo --adduser --createdb --encrypted $DB_NAME 2> /dev/null > /dev/null -    psql --command "ALTER USER \""$DB_NAME"\" with password '"$DB_PASSWORD"';" 2> /dev/null > /dev/null -    createdb -T template_postgis --echo --owner $DB_NAME --encoding UNICODE $DB_NAME "$PROJECT_NAME" 2> /dev/null > /dev/null - -fi -EOF - -fi - - -echo '* get sources' - -mkdir $INSTALL_PATH -mkdir $INSTALL_PATH'/conf' -cd $INSTALL_PATH - -echo '  * ishtar' -git clone https://gitlab.com/iggdrasil/ishtar.git 2> /dev/null -# echo '  * oook!' -# git clone git://git.proxience.com/git/oook_replace.git 2> /dev/null -# ln -s $INSTALL_PATH'/oook_replace/oook_replace' $INSTALL_PATH'/ishtar/' - -cd ishtar -git fetch 2> /dev/null -git checkout $VERSION 2> /dev/null - -cd django-simple-history -python setup.py install -cd .. - -cp -ra example_project $APP_NAME 2> /dev/null > /dev/null - -rm $APP_NAME/settings.py -ln -s $INSTALL_PATH"/ishtar/example_project/settings.py" $INSTALL_PATH"/ishtar/"$APP_NAME"/" - -APP_DIR=$INSTALL_PATH'/ishtar/'$APP_NAME - -echo '* load parameters' -sed -s "s|#APP_NAME#|$APP_NAME|g;\ -        s|#INSTALL_PATH#|$INSTALL_PATH|g;\ -        s|#DATE#|$DATE|g;\ -        s|#PROJECT_NAME#|$PROJECT_NAME|g;\ -        s|#DB_HOST#|$DB_HOST|g;\ -        s|#DB_NAME#|$DB_NAME|g;\ -        s|#DB_PORT#|$DB_PORT|g;\ -        s|#APP_DIR#|$APP_DIR|g;\ -        s|#SECRET_KEY#|$SECRET_KEY|g;\ -        s|#DB_PASSWORD#|$DB_PASSWORD|g;\ -        s|#UWSGI_PORT#|$UWSGI_PORT|g;" $CDIR'/local_settings.py.sample' > \ -                                  $INSTALL_PATH'/conf/local_settings.py' - -ln -s $INSTALL_PATH'/conf/local_settings.py' $APP_DIR'/local_settings.py' - -# rights -mkdir -p "$APP_DIR/media/imported" -mkdir -p "$APP_DIR/media/upload" -chown -R root:www-data $APP_DIR'/media' -chmod -R g+w $APP_DIR'/media' - -# logs -mkdir -p /var/log/django/ -chown root:www-data '/var/log/django' -touch '/var/log/django/ishtar-'$APP_NAME'.log' -chown root:www-data '/var/log/django/ishtar-'$APP_NAME'.log' -chmod g+w '/var/log/django/ishtar-'$APP_NAME'.log' - -cd $APP_DIR -./manage.py collectstatic --noinput 2> /dev/null > /dev/null - -# load locale data - -cd $INSTALL_PATH'/ishtar/archaeological_context_records' -django-admin compilemessages -l fr 2> /dev/null -cd $INSTALL_PATH'/ishtar/archaeological_files' -django-admin compilemessages -l fr 2> /dev/null -cd $INSTALL_PATH'/ishtar/archaeological_finds' -django-admin compilemessages -l fr 2> /dev/null -cd $INSTALL_PATH'/ishtar/archaeological_operations' -django-admin compilemessages -l fr 2> /dev/null -cd $INSTALL_PATH'/ishtar/archaeological_warehouse' -django-admin compilemessages -l fr 2> /dev/null -cd $INSTALL_PATH'/ishtar/ishtar_common' -django-admin compilemessages -l fr 2> /dev/null - -echo "* sync database" - -cd $APP_DIR -python ./manage.py syncdb --noinput 2> /dev/null > /dev/null -python ./manage.py migrate ishtar_common 2> /dev/null > /dev/null -python ./manage.py migrate archaeological_files 0013 2> /dev/null > /dev/null -python ./manage.py migrate archaeological_operations 2> /dev/null > /dev/null -python ./manage.py migrate archaeological_files 2> /dev/null > /dev/null -python ./manage.py migrate 2> /dev/null > /dev/null - -echo "* load default data" -# data migrations have created some default data - return to a clean state -python ./manage.py flush --noinput 2> /dev/null - -python ./manage.py loaddata \ -    '../fixtures/initial_data-auth-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../ishtar_common/fixtures/initial_data-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../ishtar_common/fixtures/initial_towns-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../archaeological_operations/fixtures/initial_data-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../archaeological_files/fixtures/initial_data-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../archaeological_context_records/fixtures/initial_data-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../archaeological_finds/fixtures/initial_data-'$DEFAULT_DATA'.json' 2> /dev/null -python ./manage.py loaddata \ -    '../archaeological_warehouse/fixtures/initial_data-'$DEFAULT_DATA'.json' 2> /dev/null - -echo "* create superuser" -python ./manage.py createsuperuser - -# "de-flush" migrations -$PYTHON ./manage.py migrate --fake 2> /dev/null > /dev/null - -# add a default site -#echo '[{"pk":null, "model": "sites.site", "fields": {"domain": "'$URL'", "name": "'$PROJECT_NAME'"}}]' > \ -#    /tmp/site.json -#python ./manage.py loaddata /tmp/site.json -#rm /tmp/site.json - -echo '* uwsgi configuration' - -sed -s "s|#APP_NAME#|$APP_NAME|g;\ -        s|#DB_NAME#|$DB_NAME|g;\ -        s|#URL#|$URL|g;\ -        s|#UWSGI_PORT#|$UWSGI_PORT|g;" $CDIR'/uwsgi.ini.template' > \ -                                       $INSTALL_PATH'/conf/uwsgi.ini' - -sed -s "s#APP_NAME#/$APP_NAME/g;" $CDIR'/django.wsgi.template' > \ -                    $INSTALL_PATH'/conf/'$APP_NAME'.wsgi' - -ln -s $INSTALL_PATH'/conf/uwsgi.ini' \ -      $UWSGI_AVAILABLE_PATH$APP_NAME'.ini' -ln -s $UWSGI_AVAILABLE_PATH$APP_NAME'.ini' \ -      $UWSGI_ENABLE_PATH$APP_NAME'.ini' - -service uwsgi restart - -echo '* nginx configuration' - - -sed -s "s|#APP_NAME#|$APP_NAME|g;\ -        s|#UWSGI_PORT#|$UWSGI_PORT|g;\ -        s|#DB_NAME#|$DB_NAME|g;\ -        s|#DATE#|$DATE|g;\ -        s|#NGINX_PORT#|$NGINX_PORT|g;\ -        s|#URL#|$URL|g;" $CDIR'/nginx.conf.template' > \ -                                       $INSTALL_PATH'/conf/nginx.conf' -ln -s $INSTALL_PATH'/conf/nginx.conf' \ -      $NGINX_AVAILABLE_PATH$APP_NAME'.conf' -ln -s $NGINX_AVAILABLE_PATH$APP_NAME'.conf' \ -      $NGINX_ENABLE_PATH$APP_NAME'.conf' - -service nginx restart - diff --git a/install/ishtar-delete-instance b/install/ishtar-delete-instance new file mode 100755 index 000000000..0cd004de3 --- /dev/null +++ b/install/ishtar-delete-instance @@ -0,0 +1,101 @@ +#!/bin/bash + +set -e + +cecho() { +  local code="\033[" +  case "$1" in +    black  | bk) color="${code}0;30m";; +    red    |  r) color="${code}1;31m";; +    green  |  g) color="${code}1;32m";; +    yellow |  y) color="${code}1;33m";; +    blue   |  b) color="${code}1;34m";; +    purple |  p) color="${code}1;35m";; +    cyan   |  c) color="${code}1;36m";; +    gray   | gr) color="${code}0;37m";; +    *) local text="$1" +  esac +  [ -z "$text" ] && local text="$color$2${code}0m" +  echo -e "$text" +} + +do_delete_instance() { +    NGINX_AVAILABLE_PATH='/etc/nginx/sites-available' +    NGINX_ENABLE_PATH='/etc/nginx/sites-enabled' +    UWSGI_AVAILABLE_PATH='/etc/uwsgi/apps-available' +    UWSGI_ENABLE_PATH='/etc/uwsgi/apps-enabled' + +    if [ ! -z '$CONFIG_PATH' ]; then +        CONFIG_PATH="/etc/ishtar/" +    fi + +    if [ ! -f $CONFIG_PATH/config ]; then +        echo ""; +        cecho r ""$CONFIG_PATH" is not a valid config file." +        echo "Have you properly install Ishtar sources?" +        echo "Run ishtar-install before this script."; +        echo ""; +        exit 1; +    fi + +    source $CONFIG_PATH/config + +    INSTANCES_FILE=$CONFIG_PATH/instances +    if [ ! -f $INSTANCES_FILE ]; then +        echo ""; +        cecho r "No instance installed. Exiting." +        echo ""; +        exit 1; +    fi +    echo "" +    cecho g "*******************************************************************************" +    cecho g "++++++               Ishtar instance deletion script                     ++++++" +    cecho g "*******************************************************************************" +    echo "" +    cecho y "Available instances:" +    echo "" + +    cat $INSTANCES_FILE + +    to_delete='' +    echo "" +    while [ "$to_delete" == '' ] +    do +        read -p "* Which one would you like to delete? " choice +        GRP=`cat $INSTANCES_FILE | grep "^$choice$"` +        if [ "$GRP" != '' ]; then +            to_delete=$choice +        fi +    done +    echo "" +    cecho r "Are you really sure to delete configuration, database and media attached to the " +    cecho r "instance "$to_delete"?" +    echo "" +    read -p "* Type DELETE if you are sure: " choice +    if [ "$choice" != "DELETE" ]; then +        exit 1 +    fi + +    sed '/'$to_delete'/d' $INSTANCES_FILE > /tmp/new_instances +    mv /tmp/new_instances $INSTANCES_FILE + +    INSTANCE=$to_delete +    rm -rf $ISHTAR_PATH/$INSTANCE +    rm -f "$NGINX_AVAILABLE_PATH/ishtar-$INSTANCE.conf" +    rm -f "$NGINX_ENABLE_PATH/ishtar-$INSTANCE.conf" +    rm -f "$UWSGI_AVAILABLE_PATH/ishtar-$INSTANCE.ini" +    rm -f "$UWSGI_ENABLE_PATH/ishtar-$INSTANCE.ini" + +    DB_NAME="ishtar-$INSTANCE" +    export DB_NAME +    su postgres <<'EOF' +        dropdb "$DB_NAME" +        dropuser "$DB_NAME" +EOF + +    echo "" +    cecho g $to_delete" have been completly removed" +    echo "" +} + +do_delete_instance diff --git a/install/install-ishtar.sh b/install/ishtar-install index 4c5995ca0..a94ce34d7 100644..100755 --- a/install/install-ishtar.sh +++ b/install/ishtar-install @@ -1,7 +1,24 @@ -#!/bin/sh +#!/bin/bash  set -e +cecho() { +  local code="\033[" +  case "$1" in +    black  | bk) color="${code}0;30m";; +    red    |  r) color="${code}1;31m";; +    green  |  g) color="${code}1;32m";; +    yellow |  y) color="${code}1;33m";; +    blue   |  b) color="${code}1;34m";; +    purple |  p) color="${code}1;35m";; +    cyan   |  c) color="${code}1;36m";; +    gray   | gr) color="${code}0;37m";; +    *) local text="$1" +  esac +  [ -z "$text" ] && local text="$color$2${code}0m" +  echo -e "$text" +} +  command_exists() {      command -v "$@" > /dev/null 2>&1  } @@ -37,13 +54,11 @@ EOF  do_install() { -    cat >&2 <<-'EOF' - -******************************************************************************* -++++++                    Ishtar installation script                     ++++++ -******************************************************************************* - -EOF +    echo "" +    cecho g "*******************************************************************************" +    cecho g "++++++                      Ishtar installation script                   ++++++" +    cecho g "*******************************************************************************" +    echo ""      # check user      user="$(id -un 2>/dev/null || true)" @@ -55,10 +70,8 @@ EOF          elif command_exists su; then              sh_c='su -c'          else -            cat >&2 <<-'EOF' -  Error: this installer needs the ability to run commands as root. -  We are unable to find either "sudo" or "su" available to make this happen. -EOF +            cecho r "  Error: this installer needs the ability to run commands as root." +            cecho r "  We are unable to find either "sudo" or "su" available to make this happen."              exit 1          fi      fi @@ -66,6 +79,7 @@ EOF      # check distribution      lsb_dist=''      dist_version='' +    backports_activated=''      if command_exists lsb_release; then          lsb_dist="$(lsb_release -si)"      fi @@ -104,6 +118,14 @@ EOF          ;;          debian) +            MAINBACKS=`cat /etc/apt/sources.list | grep jessie-backports |grep -v "^#"` +            ALLBACKS='' +            if [ "$(ls -A /etc/apt/sources.list.d/)" ]; then +                ALLBACKS=`cat /etc/apt/sources.list.d/* | grep jessie-backports |grep -v "^#"` +            fi +            if [ "$ALLBACKS" != '' ] || [ "$MAINBACKS" != '' ]; then +                backports_activated='true'; +            fi              dist_version="$(cat /etc/debian_version | sed 's/\/.*//' | sed 's/\..*//')"              case "$dist_version" in                  8) @@ -144,12 +166,10 @@ EOF          ubuntu|debian)              ;;          *) -            cat >&2 <<-'EOF' - -  Sorry. Either your platform is not easily detectable or not supported by -  this installer. - -EOF +            echo "" +            cecho r " Sorry. Either your platform is not easily detectable or not supported by" +            cecho r " this installer." +            echo ""              exit 1      esac @@ -163,7 +183,8 @@ EOF  EOF      while [ "$default_db" == '' ]      do -        read -p '* Default PostgreSQL host? [localhost] ' choice +        cecho y '* Default PostgreSQL host? [localhost] ' +        read choice          if [ "$choice" == '' ]; then              default_db='127.0.0.1'          elif [ "$choice" == 'localhost' ]; then @@ -185,7 +206,8 @@ EOF      MSG=""      while [ "$webserver" == '' ]      do -        read -p '* Which webserver do you want to use? ([nginx]/none) ' choice +        cecho y '* Which webserver do you want to use? ([nginx]/none) ' +        read choice          case "$choice" in              nginx ) webserver="nginx";;              none ) webserver="none";; @@ -197,26 +219,28 @@ EOF      cat >&2 <<-'EOF'  ------------------------------------------------------------------------------- -  Two version are usually available for Ishtar: master/stable. Master is the +  Two version are usually available for Ishtar: develop/master. Develop is the    bleeding edge version and you can experience problems with this version. -  Stable is the safest choice. +  Master is the safest choice.  EOF      while [ "$version" == '' ]      do -        read -p "* Which version would you like to use? ([stable]/master) " choice +        cecho y "* Which version would you like to use? ([develop]/master) " +        read choice          case "$choice" in -            stable ) version="stable";; +            develop ) version="develop";;              master ) version="master";; -            '' ) version="stable";; +            '' ) version="develop";;          esac      done -    etc_path="/etc/ishtar/"$version"/" +    etc_path="/etc/ishtar/"      if [ -d "$etc_path" ]; then          echo "" -        echo "ERROR: it seems that "$etc_path" already exists. If this is a remnant " -        echo "of an old installation please delete this path before installing." +        cecho r "ERROR: it seems that "$etc_path" already exists. If this is a remnant " +        cecho r "of an old installation please delete this path before installing." +        echo ""          exit 1      fi @@ -231,9 +255,10 @@ EOF  EOF      while [ "$install_path" == '' ]      do -        read -p "* Which base install path for Ishtar? [/srv/] " choice +        cecho y "* Which base install path for Ishtar? [/srv/]" +        read choice          if [ -z "$choice" ]; then -            install_path='/srv/' +            install_path='/srv'          elif [ ! -d "$choice" ]; then              echo 'Not a valid path.'          else @@ -241,106 +266,159 @@ EOF          fi      done -    full_install_path=$install_path'/ishtar/'$version +    full_install_path=$install_path'/ishtar/'      if [ -d "$full_install_path" ]; then          echo "" -        echo "ERROR: it seems that "$full_install_path" already exists. If this is a " -        echo "remnant of an old installation please delete this directory before installing." +        cecho r "ERROR: it seems that "$full_install_path" already exists. If this is a " +        cecho r "remnant of an old installation please delete this directory before installing." +        echo ""          exit 1      fi      echo "" -    echo "*******************************************************************************" +    cecho g "*******************************************************************************"      echo ""      # Run setup for each distro accordingly      case "$lsb_dist" in          ubuntu|debian) -            if [ "$dist_version" != "wheezy" ]; then -                cat >&2 <<-'EOF' - -  Sorry this script cannot manage your version of Debian/Ubuntu. - -EOF +            if [ "$dist_version" != "jessie" ] && [ "$dist_version" != "wheezy" ]; then +                echo "" +                cecho r " Sorry this script cannot manage your version of Debian/Ubuntu." +                echo ""                  exit 1              fi +            echo "-------------------------------------------------------------------------------"; +            cecho y "Update debian packages cache"; +            echo "";              export DEBIAN_FRONTEND=noninteractive              ( set -x; $sh_c 'sleep 3; apt-get update' ) -            if [ "$default_db" == 'localhost' ]; then -                POSTGIS=postgresql-9.1-postgis -                if [ "$dist_version" == "jessie" ]; then -                    POSTGIS=postgresql-9.4-postgis-2.1 -                fi -                ( set -x; $sh_c 'sleep 3; apt-get install -y -q postgresql '$POSTGIS ) -            fi              if ! command_exists git; then                  echo "-------------------------------------------------------------------------------"; -                echo "Installing git..."; +                cecho y "Installing git...";                  echo "";                  ( set -x; $sh_c 'sleep 3; apt-get install -y -q git' )              fi              if ! command_exists apg; then                  echo "-------------------------------------------------------------------------------"; -                echo "Installing apg..."; +                cecho y "Installing apg...";                  echo "";                  ( set -x; $sh_c 'sleep 3; apt-get install -y -q apg' )              fi              if ! command_exists pip; then                  echo "-------------------------------------------------------------------------------"; -                echo "Installing pip..."; +                cecho y "Installing pip...";                  echo "";                  ( set -x; $sh_c 'sleep 3; apt-get install -y -q python-pip' )              fi              if [ "$webserver" == 'nginx' ]; then                  echo "-------------------------------------------------------------------------------"; -                echo "Installing nginx and uwsgi..."; +                cecho y "Installing nginx and uwsgi...";                  echo "";                  ( set -x; $sh_c 'sleep 3; apt-get install -y -q  uwsgi uwsgi-plugin-python nginx' )              fi -            echo "-------------------------------------------------------------------------------"; -            echo "Installing Ishtar dependencies" -            echo ""; -            ( set -x; $sh_c 'sleep 3; apt-get install -y -q python python-django \ -      libjs-jquery libjs-jquery-ui python-pisa python-django-registration \ -      python-utidylib python-lxml python-imaging python-django-south \ -      python-psycopg2 python-gdal gettext python-unicodecsv memcached \ -      python-tidylib python-django-extra-views python-memcache python-dbf' ) -            ;; +            if [ "$dist_version" == "wheezy" ]; then +                if [ "$default_db" == '127.0.0.1' ]; then +                    echo "-------------------------------------------------------------------------------"; +                    cecho y "Installing postgresql" +                    echo "" +                    POSTGIS=postgresql-9.1-postgis +                    ( set -x; $sh_c 'sleep 3; apt-get install -y -q postgresql '$POSTGIS ) +                fi -    esac -    echo "-------------------------------------------------------------------------------"; -    echo "Installing BeautifulSoup4" -    echo ""; +                echo "-------------------------------------------------------------------------------"; +                cecho y "Installing Ishtar dependencies" +                echo ""; +                ( set -x; $sh_c 'sleep 3; apt-get install -y -q python python-django \ +          libjs-jquery libjs-jquery-ui python-pisa python-django-registration \ +          python-utidylib python-lxml python-imaging python-django-south \ +          python-psycopg2 python-gdal gettext python-unicodecsv memcached \ +          python-tidylib python-django-extra-views python-memcache python-dbf' ) -    ( set -x; $sh_c 'pip install BeautifulSoup4==4.3.2' ) -    echo "-------------------------------------------------------------------------------"; -    echo "Installing django-simple-history" -    echo ""; -    ( set -x; $sh_c 'pip install git+https://github.com/treyhunner/django-simple-history.git@0fd9b8e9c6f36b0141367b502420efe92d4e21ce' ) +                echo "-------------------------------------------------------------------------------"; +                cecho y "Installing BeautifulSoup4" +                echo ""; +                ( set -x; $sh_c 'pip install BeautifulSoup4==4.3.2' ) +                echo "-------------------------------------------------------------------------------"; +                cecho y "Installing django-simple-history" +                echo ""; +                ( set -x; $sh_c 'pip install git+https://github.com/treyhunner/django-simple-history.git@0fd9b8e9c6f36b0141367b502420efe92d4e21ce' ) + +            fi + +            if [ "$dist_version" == "jessie" ]; then +                if [ "$backports_activated" != 'true' ]; then +                    echo "" +                    cecho r "  In order to install Ishtar you have to activate Debian backports." +                    echo "  To do that:" +                    echo "" +                    echo "    echo 'deb http://ftp.debian.org/debian jessie-backports main contrib non-free' >> /etc/apt/sources.list" +                    echo "" +                    cecho p "  Run again Ishtar installation script after that." +                    exit 1 +                fi + +                if [ "$default_db" == '127.0.0.1' ]; then +                    echo "-------------------------------------------------------------------------------"; +                    cecho y "Installing postgresql" +                    echo "" +                    POSTGIS=postgresql-9.4-postgis-2.3 +                    ( set -x; $sh_c 'sleep 3; apt-get install -y -q postgresql '$POSTGIS ) +                fi +                echo "-------------------------------------------------------------------------------"; +                cecho y "Installing Ishtar dependencies" +                echo ""; +                ( set -x; $sh_c 'sleep 3; apt-get install -t jessie-backports -y -q python python-django\ +                      python-django-registration' ) +                ( set -x; $sh_c 'sleep 3; apt-get install -y -q \ +                      python-pisa python-bs4 python-django-formtools\ +                      python-tidylib python-lxml python-imaging python-html5lib\ +                      python-psycopg2 python-gdal gettext python-unicodecsv memcached \ +                      python-django-extra-views python-memcache python-dbf python-markdown' ) +                echo "-------------------------------------------------------------------------------"; +                cecho y "Installing django-simple-history" +                echo ""; +                ( set -x; $sh_c 'pip install git+https://github.com/treyhunner/django-simple-history.git@1.8.2#egg=django-simple-history' ) +                echo "-------------------------------------------------------------------------------"; +                cecho y "Installing python-secretary" +                echo ""; +                ( set -x; $sh_c 'pip install secretary==0.2.14' ) + +            fi +            ;; + +    esac      echo "-------------------------------------------------------------------------------"; -    echo "Installing Ishtar sources" +    cecho y "Installing Ishtar sources"      echo ""; -    mkdir -p $full_install_path -    cd $full_install_path -    ( set -x; git clone git://git.proxience.com/git/oook_replace.git 2> /dev/null ) +    cd $install_path +    if [ "$dist_version" == "wheezy" ]; then +        ( set -x; git clone https://nimn@gitlab.com/iggdrasil/oook_replace.git 2> /dev/null ) +    fi      ( set -x; git clone https://gitlab.com/iggdrasil/ishtar.git 2> /dev/null )      cd ishtar      git fetch 2> /dev/null      git checkout $version 2> /dev/null      mkdir -p $etc_path -    echo "PATH="$full_install_path > $etc_path"config" -    echo "DEFAULT_DB="$default_db >> $etc_path"config" -    echo "WEBSERVER="$webserver >> $etc_path"config" +    echo "ISHTAR_PATH="$full_install_path > $etc_path"config" +    echo "ISHTAR_DB="$default_db >> $etc_path"config" +    echo "ISHTAR_WEBSERVER="$webserver >> $etc_path"config" +    echo "# settings added to all instances" >> $etc_path"extra_settings.py" +    echo "" +    cecho g "*******************************************************************************" +    echo ""; +    cecho g "Installation done." +    cecho g "Base configuration stored in: "$etc_path"config"      echo "" -    echo "*******************************************************************************"; +    echo "You can edit "$etc_path"extra_settings.py to add Django settings to all new" +    echo "instances.";      echo ""; -    echo "Installation done. Base configuration stored in "$etc_path"config file." -    echo "Next you'll have to create an instance." +    cecho y "Next you will have to create an instance with: ./ishtar-prepare-instance"      echo "";  } diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance new file mode 100755 index 000000000..e7ac1152a --- /dev/null +++ b/install/ishtar-prepare-instance @@ -0,0 +1,329 @@ +#!/bin/bash + +set -e + +cecho() { +  local code="\033[" +  case "$1" in +    black  | bk) color="${code}0;30m";; +    red    |  r) color="${code}1;31m";; +    green  |  g) color="${code}1;32m";; +    yellow |  y) color="${code}1;33m";; +    blue   |  b) color="${code}1;34m";; +    purple |  p) color="${code}1;35m";; +    cyan   |  c) color="${code}1;36m";; +    gray   | gr) color="${code}0;37m";; +    *) local text="$1" +  esac +  [ -z "$text" ] && local text="$color$2${code}0m" +  echo -e "$text" +} + +do_install_instance() { + +    NGINX_PORT=${NGINX_PORT-80} +    NGINX_AVAILABLE_PATH='/etc/nginx/sites-available' +    NGINX_ENABLE_PATH='/etc/nginx/sites-enabled' +    UWSGI_AVAILABLE_PATH='/etc/uwsgi/apps-available' +    UWSGI_ENABLE_PATH='/etc/uwsgi/apps-enabled' +    PG_VERSION=9.4 +    POSTGIS_VERSION=2.3.1 + +    echo "" +    cecho g "*******************************************************************************" +    cecho g "++++++                  Ishtar instance preparation script               ++++++" +    cecho g "*******************************************************************************" +    echo "" + +    # check user +    user="$(id -un 2>/dev/null || true)" + +    sh_c='sh -c' +    if [ "$user" != 'root' ]; then +        if command_exists sudo; then +            sh_c='sudo -E sh -c' +        elif command_exists su; then +            sh_c='su -c' +        else +            cecho r "  Error: this installer needs the ability to run commands as root." +            cecho r "  We are unable to find either "sudo" or "su" available to make this happen." +            exit 1 +        fi +    fi + +    export LANG=fr_FR.UTF-8 +    if [ "$(locale 2>&1 >/dev/null|wc -l)" != 0 ]; then +        cecho r "Unable to set LANG=$LANG properly" +        cecho "Try: 'dpkg-reconfigure locales' or install the 'locales-all' package" +        exit 1 +    fi + +    if [ ! -z '$CONFIG_PATH' ]; then +        CONFIG_PATH="/etc/ishtar/" +    fi + +    if [ ! -f $CONFIG_PATH/config ]; then +        echo ""; +        cecho r ""$CONFIG_PATH" is not a valid config file." +        echo "Have you properly install Ishtar sources?" +        echo "Run ishtar-install before this script."; +        echo ""; +        exit 1; +    fi + +    source $CONFIG_PATH/config + +    cd $ISHTAR_PATH + +    INSTANCES_FILE=$CONFIG_PATH/instances + +    if [ ! -f $INSTANCES_FILE ]; then +        touch $INSTANCES_FILE +    fi + +    if [ -z '$INSTANCE' ]; then +        if [ -d "$INSTANCE" ]; then +            cecho r "Sorry, $INSTANCE already exists." +            echo "Give another code name." +            exit 1 +        fi + +    else +        INSTANCE='' +        cat >&2 <<-'EOF' + +------------------------------------------------------------------------------- +  You should select a code name for this instance. This code name should have +  only lower alphanumeric characters, with no spaces, no accents and should not +  begin with an alphabetical character. The only special character allowed is +  "_". + +EOF +        while [ "$INSTANCE" == '' ] +        do +            cecho y "* Which instance code name? [my_ishtar_instance] " +            read choice +            if [ -z "$choice" ]; then +                INSTANCE='my_ishtar_instance' +            else +                INSTANCE=$choice +            fi +            if [ -d "$INSTANCE" ]; then +                echo "Sorry, $INSTANCE already exists. Give another name." +                INSTANCE='' +            fi +        done +    fi + +    if [ ! -z '$URL' ]; then +        URL='' +        cat >&2 <<-'EOF' + +------------------------------------------------------------------------------- +  You should select an url to join your instance. Only a full domain is +  accepted. Don't forget to set up your DNS to point this url name to this +  server. Only put the url not the protocol part (no http://). +  For instance: ishtar.mydomain.org + +EOF +        while [ "$URL" == '' ] +        do +            cecho y "* Which url? " +            read choice +            URL=$choice +        done +    fi + +    DEST=$ISHTAR_PATH + +        cat >&2 <<-'EOF' + +------------------------------------------------------------------------------- +EOF +    echo "Preparing ishtar instance: $INSTANCE under $DEST" +    echo "" +    # register instance +    echo "$INSTANCE" >> $INSTANCES_FILE + +    mkdir -p            /var/log/django +    chown root:www-data /var/log/django +    touch               "/var/log/django/ishtar-$INSTANCE.log" +    chown root:www-data "/var/log/django/ishtar-$INSTANCE.log" +    chmod g+w           "/var/log/django/ishtar-$INSTANCE.log" + + +    cecho y " * duplicate example_project into our instance" +    # Duplicate example_project into our instance: +    cd $ISHTAR_PATH +    cp -ra example_project $INSTANCE + +    rm $INSTANCE/settings.py +    ln -s $DEST/example_project/settings.py $DEST/$INSTANCE/settings.py + +    # Permissions: +    mkdir -p -m 755     "$INSTANCE/media" +    mkdir -p -m 755     "$INSTANCE/media/imported" +    mkdir -p -m 755     "$INSTANCE/media/upload" +    chown -R www-data:www-data "$INSTANCE/media" + +    # Preparing DB: +    DB_HOST=${ISHTAR_DB-127.0.0.1} +    DB_PORT=${ISHTAR_DB_PORT-5432} +    DB_PASSWORD=${DB_PASSWORD-''} +    DB_NAME="ishtar-$INSTANCE" + +    # Generate a password on the fly if none was specified: +    if [ -z "$DB_PASSWORD" ]; then +        DB_PASSWORD=$(apg -a 0 -M ncl -n 1 -x 10 -m 10) +    fi + +    export PG_VERSION DB_HOST DB_PORT DB_PASSWORD DB_NAME POSTGIS_VERSION +    su postgres <<'EOF' +      echo " * Checking template_postgis" +      if ! psql -l | grep -qs template_postgis; then +        echo "   - not present, creating" +        createdb -E UTF8 template_postgis +        psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis'" +        psql -q -d template_postgis -f /usr/share/postgresql/$PG_VERSION/extensions/postgis--$POSTGIS_VERSION.sql +        psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" +        psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;" +        psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" +      else +        echo "   - already present" +      fi + +      echo " * Checking database $DB_NAME" +      if ! psql -l | grep -qs "$DB_NAME"; then +        echo "   - not present, creating" +        createuser --echo --adduser --createdb --encrypted $DB_NAME +        psql --command "ALTER USER \""$DB_NAME"\" with password '"$DB_PASSWORD"';" +        createdb -T template_postgis --echo --owner $DB_NAME --encoding UNICODE $DB_NAME +        psql -d $DB_NAME -c "CREATE EXTENSION postgis;" +      else +        echo "   - already present" +      fi +EOF + +    ### LOCAL SETTINGS + +    cecho y " * creating config files" +    # Set some variables to avoid changing sed calls too much compared to +    # the initial install/install.sh script: +    INSTALL_PATH=$DEST +    INSTALL_PREFIX=$DEST +    APP_DIR="$DEST/$INSTANCE" +    DATE=`date +%F` +    SECRET_KEY=$(apg -a 0 -M ncl -n 1 -x 10 -m 40) + +    PORT_FILE=$CONFIG_PATH/last_uswgi_port + +    if [ -f $PORT_FILE ]; then +        UWSGI_PORT=`cat $PORT_FILE` +        UWSGI_PORT=`expr $UWSGI_PORT + 1` +    else +        UWSGI_PORT=8889 +    fi +    echo $UWSGI_PORT > $PORT_FILE + +    ### local_settings.py + +    sed -s "s|#APP_NAME#|$INSTANCE|g;\ +            s|#INSTALL_PATH#|$INSTALL_PATH|g;\ +            s|#DB_HOST#|$DB_HOST|g;\ +            s|#DB_NAME#|$DB_NAME|g;\ +            s|#DB_PORT#|$DB_PORT|g;\ +            s|#DB_PASSWORD#|$DB_PASSWORD|g;\ +            s|#URL#|$URL|g;\ +            s|#APP_DIR#|$APP_DIR|g;\ +            s|#SECRET_KEY#|$SECRET_KEY|g;" \ +        "install/local_settings.py.sample" > \ +        "$INSTANCE/local_settings.py" + +    if [ -f $CONFIG_PATH"extra_settings.py" ]; then +        cat $CONFIG_PATH"extra_settings.py" >> "$INSTANCE/local_settings.py" +    fi + +    ### UWSGI + +    sed -s "s|#APP_NAME#|$INSTANCE|g;\ +            s|#INSTALL_PREFIX#|$INSTALL_PREFIX|g;\ +            s|#URL#|$URL|g;\ +            s|#UWSGI_PORT#|$UWSGI_PORT|g;" \ +        "install/uwsgi.ini.template" > \ +        "$INSTANCE/uwsgi.ini" + +    ln -sf "$DEST/$INSTANCE/uwsgi.ini" \ +           "$UWSGI_AVAILABLE_PATH/ishtar-$INSTANCE.ini" +    ln -sf "$UWSGI_AVAILABLE_PATH/ishtar-$INSTANCE.ini" \ +           "$UWSGI_ENABLE_PATH/ishtar-$INSTANCE.ini" + +    ### NGINX + +    sed -s "s|#APP_NAME#|$INSTANCE|g;\ +            s|#UWSGI_PORT#|$UWSGI_PORT|g;\ +            s|#NGINX_PORT#|$NGINX_PORT|g;\ +            s|#INSTALL_PATH#|$INSTALL_PATH|g;\ +            s|#URL#|$URL|g;" \ +        "install/nginx.conf.template" > \ +        "$INSTANCE/nginx.conf" + +    ln -sf "$DEST/$INSTANCE/nginx.conf" \ +           "$NGINX_AVAILABLE_PATH/ishtar-$INSTANCE.conf" +    ln -sf "$NGINX_AVAILABLE_PATH/ishtar-$INSTANCE.conf" \ +           "$NGINX_ENABLE_PATH/ishtar-$INSTANCE.conf" + + +    cecho y " * collect static data" +    cd $INSTANCE +    ./manage.py collectstatic --noinput > /dev/null +    cd - + +    # only language available +    LOCALE=fr +    cecho y " * compile translations" +    for d in archaeological_* ishtar_common; do +        cd $d +        ../$INSTANCE/manage.py compilemessages -l $LOCALE +        cd - +    done + +    ### DB feeding +    cd $INSTANCE +    cecho y " * db feeding" +    cecho y "   - migrations" +    ./manage.py migrate + +    cecho y "   - loading fixtures" +    FIXTURES="$DEST/fixtures/initial_data-auth-fr.json $DEST/ishtar_common/fixtures/initial_data-fr.json $DEST/ishtar_common/fixtures/initial_importtypes-fr.json $DEST/archaeological_operations/fixtures/initial_data-fr.json $DEST/archaeological_context_records/fixtures/initial_data-fr.json $DEST/archaeological_files/fixtures/initial_data-fr.json $DEST/archaeological_finds/fixtures/initial_data-fr.json $DEST/archaeological_warehouse/fixtures/initial_data-fr.json" +    for data in $FIXTURES; do +        echo $data; +        ./manage.py loaddata $data; +    done + +    cecho y "   - create superuser" +    ./manage.py createsuperuser + +    cecho y "   - post install script" +    cd .. +    python ./install/post_install_script.py $INSTANCE $URL + +    cat >&2 <<-'EOF' + +------------------------------------------------------------------------------- +EOF +    cecho g "  Your instance has been configured." +    echo "" +    cecho g "   * instance name: "$INSTANCE +    cecho g "   * url: http://"$URL + +    cat >&2 <<-'EOF' + +    You should restart uwsgi and nginx: +EOF +    cecho y "systemctl restart uwsgi nginx" +    echo "" +    echo "  And then enjoy ishtar!" +    echo "" +} + +do_install_instance diff --git a/install/ishtar-update b/install/ishtar-update new file mode 100755 index 000000000..3e2797c76 --- /dev/null +++ b/install/ishtar-update @@ -0,0 +1,103 @@ +#!/bin/bash + +set -e + +cecho() { +  local code="\033[" +  case "$1" in +    black  | bk) color="${code}0;30m";; +    red    |  r) color="${code}1;31m";; +    green  |  g) color="${code}1;32m";; +    yellow |  y) color="${code}1;33m";; +    blue   |  b) color="${code}1;34m";; +    purple |  p) color="${code}1;35m";; +    cyan   |  c) color="${code}1;36m";; +    gray   | gr) color="${code}0;37m";; +    *) local text="$1" +  esac +  [ -z "$text" ] && local text="$color$2${code}0m" +  echo -e "$text" +} + +update_instances() { +    echo "" +    cecho g "*******************************************************************************" +    cecho g "++++++                  Ishtar instance update instances                 ++++++" +    cecho g "*******************************************************************************" +    echo "" + +    # check user +    user="$(id -un 2>/dev/null || true)" + +    sh_c='sh -c' +    if [ "$user" != 'root' ]; then +        if command_exists sudo; then +            sh_c='sudo -E sh -c' +        elif command_exists su; then +            sh_c='su -c' +        else +            cecho r "  Error: this installer needs the ability to run commands as root." +            cecho r "  We are unable to find either "sudo" or "su" available to make this happen." +            exit 1 +        fi +    fi + +    if [ ! -z '$CONFIG_PATH' ]; then +        CONFIG_PATH="/etc/ishtar/" +    fi + +    if [ ! -f $CONFIG_PATH/config ]; then +        echo ""; +        cecho r ""$CONFIG_PATH" is not a valid config file." +        echo "Have you properly install Ishtar sources?" +        echo "Run ishtar-install before this script."; +        echo ""; +        exit 1; +    fi + +    source $CONFIG_PATH/config + +    cd $ISHTAR_PATH + +    cecho g "Update Ishtar library from git repository" +    git pull + +    INSTANCES_FILE=$CONFIG_PATH/instances +    instances="$( (cat $INSTANCES_FILE 2>/dev/null || true) | xargs )" + +    if [ -n "$instances" ]; then +        translated='' +        for instance in $instances; do + +            if [ "$translated" == '' ]; then +                cecho g "* Compile translations" +                maybe_localized=$(cd $ISHTAR_PATH; find -maxdepth 2 -name 'locale') +                for candidate in $maybe_localized; do +                    if find $ISHTAR_PATH/$candidate -name '*.po' >/dev/null 2>&1; then +                        app=${candidate%%/locale} +                        (cd $ISHTAR_PATH/$app; python $ISHTAR_PATH/$instance/manage.py compilemessages) +                    fi +                done +                translated='true' +            fi + +            cd $ISHTAR_PATH/$instance +            cecho g "Instance: $instance" +            cecho y " * collect static" +            python manage.py collectstatic --noinput 2> /dev/null +            cecho y " * database migrations" +            python manage.py migrate + +        done +    fi +    echo "" +    cecho g "All instances have been updated" +    cat >&2 <<-'EOF' + +    You should restart uwsgi and nginx: +EOF +    cecho y "systemctl restart uwsgi nginx" +    echo "" +} + +update_instances diff --git a/install/local_settings.py.sample b/install/local_settings.py.sample index 459828c00..0a81fa68b 100644 --- a/install/local_settings.py.sample +++ b/install/local_settings.py.sample @@ -6,10 +6,8 @@ DEBUG_TOOLBAR = False  TEMPLATE_DEBUG = DEBUG  SQL_DEBUG = False -APP_NAME = u"#PROJECT_NAME#" -PROJECT_SLUG = u"#PROJECT_NAME#" +PROJECT_SLUG = "#APP_NAME#"  ROOT_URLCONF = '#APP_NAME#.urls' -STATIC_URL = '/static-#DATE#/'  SECRET_KEY = "#SECRET_KEY#"  LOGFILE = "/var/log/django/ishtar-#APP_NAME#.log" @@ -17,12 +15,12 @@ MEDIA_ROOT = "#APP_DIR#/media/"  ODT_TEMPLATE = "#INSTALL_PATH#/ishtar/ishtar_common/static/template.odt" +ALLOWED_HOSTS = ["#URL#"] +  ADMINS = (      # ('Your Name', 'your_email@domain.com'),  ) -MANAGERS = ADMINS -  DATABASES = {      'default': {          'ENGINE': 'django.contrib.gis.db.backends.postgis', @@ -33,11 +31,3 @@ DATABASES = {          'PASSWORD': '#DB_PASSWORD#',      }  } - -# choose the extensions to install -EXTRA_APPS = [ -    'archaeological_files', -    'archaeological_context_records', -    'archaeological_warehouse', -    'archaeological_finds', -] diff --git a/install/nginx.conf.template b/install/nginx.conf.template index dd236d113..15333393b 100644 --- a/install/nginx.conf.template +++ b/install/nginx.conf.template @@ -1,28 +1,18 @@  server {      listen #NGINX_PORT#;      server_name #URL#; -    root /srv/#DB_NAME#/ishtar/; +    root #INSTALL_PATH#;      access_log /var/log/django/#APP_NAME#-access.log;      error_log /var/log/django/#APP_NAME#-error.log;      client_max_body_size 20M; -    location /static-#DATE#/ { # STATIC_URL -        alias /srv/#DB_NAME#/ishtar/#APP_NAME#/static/; # STATIC_ROOT +    location /static/ { # STATIC_URL +        alias #INSTALL_PATH#/#APP_NAME#/static/; # STATIC_ROOT          expires 30d;      }      location /media/ { # MEDIA_URL -        alias /srv/#DB_NAME#/ishtar/#APP_NAME#/media/; # MEDIA_ROOT -        expires 30d; -    } - -    location /tinymce/ { -        alias /usr/share/tinymce/www/; -        expires 30d; -    } - -    location /javascript/ { -        alias /usr/share/javascript/; +        alias #INSTALL_PATH#/#APP_NAME#/media/; # MEDIA_ROOT          expires 30d;      } diff --git a/install/post_install_script.py b/install/post_install_script.py new file mode 100644 index 000000000..141b738d0 --- /dev/null +++ b/install/post_install_script.py @@ -0,0 +1,28 @@ +import sys +import os +import django + +sys.path.append(os.path.abspath('.')) + +app_name, url = sys.argv[1], sys.argv[2] +os.environ.setdefault("DJANGO_SETTINGS_MODULE", app_name + ".settings") +django.setup() + +from django.contrib.sites.models import Site +from ishtar_common.models import IshtarSiteProfile + +q = Site.objects.filter(domain='example.com') + +if q.count(): +    site = q.get() +    site.domain = url +    site.name = url +    site.save() + +q = IshtarSiteProfile.objects.filter(slug='default') + +if q.count(): +    profile = q.get() +    profile.label = app_name +    profile.slug = app_name +    profile.save() diff --git a/install/uninstall.sh b/install/uninstall.sh deleted file mode 100755 index 71a5dae17..000000000 --- a/install/uninstall.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# only lower alpha-numeric char and '_' and must start with a letter -[ $APP_NAME ] || ( echo 'APP_NAME empty. Default to: "default".' ; ); -APP_NAME=${APP_NAME-default} -# don't forget the trailing slash -INSTALL_PREFIX=/srv/ - -read -r -p "Are you sure to delete "$APP_NAME" app? [y/N] " response -response=${response,,}    # tolower -if [[ $response =~ ^(yes|y)$ ]] -then -    echo '* deleting '$APP_NAME; -else -    echo "canceled"; -    exit; -fi - -# default for debian -UWSGI_AVAILABLE_PATH='/etc/uwsgi/apps-available/' -UWSGI_ENABLE_PATH='/etc/uwsgi/apps-enabled/' -NGINX_AVAILABLE_PATH='/etc/nginx/sites-available/' -NGINX_ENABLE_PATH='/etc/nginx/sites-enabled/' - -DB_NAME='ishtar'$APP_NAME -INSTALL_PATH=$INSTALL_PREFIX$DB_NAME - -rm -f $UWSGI_AVAILABLE_PATH$APP_NAME'.ini' -rm -f $UWSGI_ENABLE_PATH$APP_NAME'.ini' -rm -f $NGINX_AVAILABLE_PATH$APP_NAME'.conf' -rm -f $NGINX_ENABLE_PATH$APP_NAME'.conf' - -rm -rf $INSTALL_PATH - -echo "All file cleaned." -echo "You can delete database '"$DB_NAME"' to fully clean your installation." diff --git a/install/uwsgi.ini.template b/install/uwsgi.ini.template index 7a20c058c..51a4c5b7f 100644 --- a/install/uwsgi.ini.template +++ b/install/uwsgi.ini.template @@ -2,7 +2,7 @@  # variables  projectname = #APP_NAME#  projectdomain = #URL# -base = /srv/#DB_NAME#/ishtar/ +base = #INSTALL_PREFIX#  # config  plugins = python diff --git a/ishtar_common/__init__.py b/ishtar_common/__init__.py index 5d2eadd7d..2b432d908 100644 --- a/ishtar_common/__init__.py +++ b/ishtar_common/__init__.py @@ -2,7 +2,7 @@  # -*- coding: utf-8 -*-  # Copyright (C) 2014-2015  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _  # overload of translation of registration module  _(u"username") diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py index adf006502..9f8265033 100644 --- a/ishtar_common/admin.py +++ b/ishtar_common/admin.py @@ -97,7 +97,7 @@ def export_as_csv_action(description=_(u"Export selected as CSV file"),              excludeset = set(exclude)              field_names = field_names - excludeset -        response = HttpResponse(mimetype='text/csv') +        response = HttpResponse(content_type='text/csv')          response['Content-Disposition'] = 'attachment; filename=%s.csv' % \              unicode(opts).replace('.', '_') @@ -300,12 +300,6 @@ class SpatialReferenceSystemAdmin(GeneralTypeAdmin):  admin.site.register(models.SpatialReferenceSystem, SpatialReferenceSystemAdmin) -class IshtarUserAdmin(admin.ModelAdmin): -    readonly_fields = ('password',) - -admin.site.register(models.IshtarUser, IshtarUserAdmin) - -  class ItemKeyAdmin(admin.ModelAdmin):      list_display = ('content_type', 'key', 'content_object', 'importer')      search_fields = ('key', ) @@ -338,7 +332,7 @@ class AdministrationTaskAdmin(admin.ModelAdmin):  admin.site.register(models.AdministrationTask, AdministrationTaskAdmin) -basic_models = [models.DocumentTemplate] +basic_models = [models.DocumentTemplate, models.IshtarUser]  if settings.COUNTRY == 'fr':      basic_models += [models.Arrondissement, models.Canton] diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index f48e6ddec..261e4dc6f 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2010-2013 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2017 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -23,7 +23,7 @@ Permission backend to manage "own" objects  from django.contrib.auth.backends import ModelBackend  from django.core.exceptions import ObjectDoesNotExist -from django.db.models.loading import cache +from django.apps import apps  import models @@ -55,8 +55,8 @@ class ObjectPermBackend(ModelBackend):          if obj is None:              model_name = perm.split('_')[-1].lower()              model = None -            for app in cache.get_apps(): -                for modl in cache.get_models(app): +            for app in apps.get_apps(): +                for modl in apps.get_models(app):                      if modl.__name__.lower() == model_name:                          model = modl              if not model: diff --git a/ishtar_common/context_processors.py b/ishtar_common/context_processors.py index 5050d667e..1c3babb8f 100644 --- a/ishtar_common/context_processors.py +++ b/ishtar_common/context_processors.py @@ -50,8 +50,7 @@ def get_base_context(request):      menu.init()      if menu.selected_idx is not None:          dct['current_theme'] = "theme-%d" % (menu.selected_idx + 1) -    request.session['MENU'] = menu -    dct['MENU'] = request.session['MENU'] +    dct['MENU'] = menu      dct['JQUERY_URL'] = settings.JQUERY_URL      dct['JQUERY_UI_URL'] = settings.JQUERY_UI_URL      dct['COUNTRY'] = settings.COUNTRY diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index e11e72449..76b186038 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2013-2015  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2013-2017 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -342,7 +342,7 @@ class StrChoiceFormater(Formater, ChoiceChecker):                  if hasattr(value, 'pk'):                      value = value.pk                  q['value'] = value -                with transaction.commit_on_success(): +                with transaction.atomic():                      try:                          t, created = TargetKey.objects.get_or_create(**q)                      except IntegrityError: @@ -404,7 +404,7 @@ class StrChoiceFormater(Formater, ChoiceChecker):                      target.is_set = True                      target.save()                  else: -                    with transaction.commit_on_success(): +                    with transaction.atomic():                          q['value'] = self.equiv_dict[value]                          q['is_set'] = True                          try: @@ -418,7 +418,7 @@ class StrChoiceFormater(Formater, ChoiceChecker):                       'associated_import': import_instance}                  if TargetKey.objects.filter(**q).count():                      continue -                with transaction.commit_on_success(): +                with transaction.atomic():                      try:                          TargetKey.objects.create(**q)                      except IntegrityError: @@ -811,7 +811,7 @@ class Importer(object):          self.output = output          if not self.history_modifier:              if self.import_instance: -                self.history_modifier = self.import_instance.user +                self.history_modifier = self.import_instance.user.user_ptr              else:                  # import made by the CLI: get the first admin                  self.history_modifier = User.objects.filter( diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 7eb36f6cc..4e5a8bd1c 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2010-2016 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2017 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -159,7 +159,7 @@ class FormSet(BaseFormSet):  class TableSelect(forms.Form):      def __init__(self, *args, **kwargs):          super(TableSelect, self).__init__(*args, **kwargs) -        key = self.fields.keyOrder[0] +        key = self.fields.keys()[0]          self.fields[key].widget.attrs['autofocus'] = 'autofocus'      def get_input_ids(self): diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 44af3a588..4d14e4544 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -585,7 +585,7 @@ class AccountForm(forms.Form):          if 'initial' in kwargs and 'pk' in kwargs['initial']:              try:                  person = models.Person.objects.get(pk=kwargs['initial']['pk']) -                account = models.IshtarUser.objects.get(person=person) +                account = models.IshtarUser.objects.get(person=person).user_ptr                  if not kwargs['initial'].get('username'):                      kwargs['initial']['username'] = account.username                  if not kwargs['initial'].get('email'): @@ -613,7 +613,7 @@ class AccountForm(forms.Form):                                                u"password."))          # check username unicity          q = models.IshtarUser.objects.filter( -            username=cleaned_data.get('username')) +            user_ptr__username=cleaned_data.get('username'))          if cleaned_data.get('pk'):              q = q.exclude(person__pk=cleaned_data.get('pk'))          if q.count(): diff --git a/ishtar_common/management/commands/ishtar_migrate_odts.py b/ishtar_common/management/commands/ishtar_migrate_odts.py new file mode 100644 index 000000000..49ed9f2d8 --- /dev/null +++ b/ishtar_common/management/commands/ishtar_migrate_odts.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2017  Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +# GNU Affero General Public License for more details. + +# You should have received a copy of the GNU Affero General Public License +# along with this program.  If not, see <http://www.gnu.org/licenses/>. + +# See the file COPYING for details. + +from django.core.management.base import BaseCommand +from optparse import make_option +import sys + +from ishtar_common.models import DocumentTemplate +from ishtar_common.utils import BColors + +try: +    input = raw_input +except NameError: +    pass + + +class Command(BaseCommand): +    help = "Update ODT templates from v1 to v2" +    option_list = BaseCommand.option_list + ( +        make_option('--quiet', +                    action='store_true', +                    dest='quiet', +                    default=False, +                    help='Proceed silently with no interactive input.'), +    ) + +    def interactive_start(self): +        sys.stdout.write( +            BColors.HEADER + BColors.BOLD + +            "Update ODT templates from v1 to v2\n") +        sys.stdout.write( +            BColors.ENDC + BColors.WARNING + +            "This script need to be run only once. Running it on already " +            "migrated ODT files may be a source of error.\n") +        sys.stdout.write(BColors.ENDC) +        yes = None +        while yes != "yes": +            sys.stdout.write( +                "Are you sure you want to proceed? (yes/[n])\n") +            yes = input() +            if not yes or yes == "n": +                sys.stdout.write(BColors.FAIL + "Aborting\n") +                sys.stdout.write(BColors.ENDC) +                sys.exit() + +    def handle(self, *args, **options): +        quiet = options['quiet'] +        if not quiet: +            self.interactive_start() +        q = DocumentTemplate.objects +        nb = q.count() +        len_of_nb = str(len(str(nb))) +        if not quiet: +            sys.stdout.write(BColors.OKGREEN) + +        errors = [] +        for idx, document in enumerate(q.all()): +            if not quiet: +                sys.stdout.write( +                    ("Processing {:" + len_of_nb + "d}/{}\r").format( +                        idx + 1, nb)) +                sys.stdout.flush() +                try: +                    document.convert_from_v1() +                except IOError as e: +                    errors.append("Document ({}): ".format(document.pk) + +                                  str(e)) +        if errors: +            sys.stdout.write(BColors.FAIL + "Error while processing:\n") +            for error in errors: +                sys.stdout.write("* {}\n".format(error)) + +        sys.stdout.write(BColors.ENDC) +        print("\n\n") + diff --git a/ishtar_common/menus.py b/ishtar_common/menus.py index 36b53b162..7d24b0fd2 100644 --- a/ishtar_common/menus.py +++ b/ishtar_common/menus.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2010-2013 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2017 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -23,7 +23,6 @@ Menus  from django.conf import settings -  _extra_menus = []  # collect menu from INSTALLED_APPS  for app in settings.INSTALLED_APPS: diff --git a/ishtar_common/migrations/0001_initial.py b/ishtar_common/migrations/0001_initial.py index fc22881bc..7b46a3ea5 100644 --- a/ishtar_common/migrations/0001_initial.py +++ b/ishtar_common/migrations/0001_initial.py @@ -1,408 +1,836 @@  # -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): -        # Adding model 'Wizard' -        db.create_table('ishtar_common_wizard', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('url_name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)), -        )) -        db.send_create_signal('ishtar_common', ['Wizard']) - -        # Adding model 'WizardStep' -        db.create_table('ishtar_common_wizardstep', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('order', self.gf('django.db.models.fields.IntegerField')()), -            ('wizard', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Wizard'])), -            ('url_name', self.gf('django.db.models.fields.CharField')(max_length=128)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=128)), -        )) -        db.send_create_signal('ishtar_common', ['WizardStep']) - -        # Adding model 'Department' -        db.create_table('ishtar_common_department', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=30)), -            ('number', self.gf('django.db.models.fields.CharField')(unique=True, max_length=3)), -        )) -        db.send_create_signal('ishtar_common', ['Department']) - -        # Adding model 'OrganizationType' -        db.create_table('ishtar_common_organizationtype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('ishtar_common', ['OrganizationType']) - -        # Adding model 'HistoricalOrganization' -        db.create_table('ishtar_common_historicalorganization', ( -            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), -            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('organization_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), -            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), -            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), -            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), -        )) -        db.send_create_signal('ishtar_common', ['HistoricalOrganization']) - -        # Adding model 'Organization' -        db.create_table('ishtar_common_organization', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('organization_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.OrganizationType'])), -        )) -        db.send_create_signal('ishtar_common', ['Organization']) - -        # Adding model 'PersonType' -        db.create_table('ishtar_common_persontype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('ishtar_common', ['PersonType']) - -        # Adding M2M table for field rights on 'PersonType' -        db.create_table('ishtar_common_persontype_rights', ( -            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), -            ('persontype', models.ForeignKey(orm['ishtar_common.persontype'], null=False)), -            ('wizardstep', models.ForeignKey(orm['ishtar_common.wizardstep'], null=False)) -        )) -        db.create_unique('ishtar_common_persontype_rights', ['persontype_id', 'wizardstep_id']) - -        # Adding model 'Person' -        db.create_table('ishtar_common_person', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), -            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), -            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), -            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), -            ('title', self.gf('django.db.models.fields.CharField')(max_length=2)), -            ('surname', self.gf('django.db.models.fields.CharField')(max_length=20)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), -            ('email', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)), -            ('person_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.PersonType'])), -            ('attached_to', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Organization'], null=True, blank=True)), -        )) -        db.send_create_signal('ishtar_common', ['Person']) - -        # Adding model 'IshtarUser' -        db.create_table('ishtar_common_ishtaruser', ( -            ('user_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, primary_key=True)), -            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'], unique=True)), -        )) -        db.send_create_signal('ishtar_common', ['IshtarUser']) - -        # Adding model 'AuthorType' -        db.create_table('ishtar_common_authortype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('ishtar_common', ['AuthorType']) - -        # Adding model 'Author' -        db.create_table('ishtar_common_author', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])), -            ('author_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.AuthorType'])), -        )) -        db.send_create_signal('ishtar_common', ['Author']) - -        # Adding model 'SourceType' -        db.create_table('ishtar_common_sourcetype', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), -            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), -        )) -        db.send_create_signal('ishtar_common', ['SourceType']) - -        # Adding model 'Arrondissement' -        db.create_table('ishtar_common_arrondissement', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), -            ('department', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Department'])), -        )) -        db.send_create_signal('ishtar_common', ['Arrondissement']) - -        # Adding model 'Canton' -        db.create_table('ishtar_common_canton', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), -            ('arrondissement', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Arrondissement'])), -        )) -        db.send_create_signal('ishtar_common', ['Canton']) - -        # Adding model 'Town' -        db.create_table('ishtar_common_town', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), -            ('surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), -            ('center', self.gf('django.contrib.gis.db.models.fields.PointField')(srid=27572, null=True, blank=True)), -            ('numero_insee', self.gf('django.db.models.fields.CharField')(unique=True, max_length=6)), -            ('departement', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Department'], null=True, blank=True)), -            ('canton', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Canton'], null=True, blank=True)), -        )) -        db.send_create_signal('ishtar_common', ['Town']) +from __future__ import unicode_literals +import datetime -    def backwards(self, orm): -        # Deleting model 'Wizard' -        db.delete_table('ishtar_common_wizard') - -        # Deleting model 'WizardStep' -        db.delete_table('ishtar_common_wizardstep') - -        # Deleting model 'Department' -        db.delete_table('ishtar_common_department') - -        # Deleting model 'OrganizationType' -        db.delete_table('ishtar_common_organizationtype') - -        # Deleting model 'HistoricalOrganization' -        db.delete_table('ishtar_common_historicalorganization') - -        # Deleting model 'Organization' -        db.delete_table('ishtar_common_organization') - -        # Deleting model 'PersonType' -        db.delete_table('ishtar_common_persontype') - -        # Removing M2M table for field rights on 'PersonType' -        db.delete_table('ishtar_common_persontype_rights') - -        # Deleting model 'Person' -        db.delete_table('ishtar_common_person') - -        # Deleting model 'IshtarUser' -        db.delete_table('ishtar_common_ishtaruser') - -        # Deleting model 'AuthorType' -        db.delete_table('ishtar_common_authortype') - -        # Deleting model 'Author' -        db.delete_table('ishtar_common_author') - -        # Deleting model 'SourceType' -        db.delete_table('ishtar_common_sourcetype') - -        # Deleting model 'Arrondissement' -        db.delete_table('ishtar_common_arrondissement') - -        # Deleting model 'Canton' -        db.delete_table('ishtar_common_canton') - -        # Deleting model 'Town' -        db.delete_table('ishtar_common_town') - - -    models = { -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.historicalorganization': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOrganization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.ishtaruser': { -            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, -            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'unique': 'True'}), -            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.wizard': { -            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) -        }, -        'ishtar_common.wizardstep': { -            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'order': ('django.db.models.fields.IntegerField', [], {}), -            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) -        } -    } - -    complete_apps = ['ishtar_common']
\ No newline at end of file +from django.db import models, migrations +import re +import django.contrib.gis.db.models.fields +import ishtar_common.models +import django.contrib.auth.models +import django.db.models.deletion +from django.conf import settings +import django.core.validators + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('contenttypes', '0002_remove_content_type_name'), +        migrations.swappable_dependency(settings.AUTH_USER_MODEL), +        # ('auth', 'ishtar_profile'), +    ] + +    operations = [ +        migrations.CreateModel( +            name='Arrondissement', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=30, verbose_name='Nom')), +            ], +        ), +        migrations.CreateModel( +            name='Author', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +            ], +            options={ +                'ordering': ('author_type__order', 'person__name'), +                'verbose_name': 'Author', +                'verbose_name_plural': 'Authors', +                'permissions': (('view_author', 'Can view all Authors'), ('view_own_author', 'Can view own Author'), ('add_own_author', 'Can add own Author'), ('change_own_author', 'Can change own Author'), ('delete_own_author', 'Can delete own Author')), +            }, +        ), +        migrations.CreateModel( +            name='AuthorType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +            ], +            options={ +                'ordering': ['order', 'label'], +                'verbose_name': 'Author type', +                'verbose_name_plural': 'Author types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Canton', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=30, verbose_name='Nom')), +                ('arrondissement', models.ForeignKey(verbose_name='Arrondissement', to='ishtar_common.Arrondissement')), +            ], +        ), +        migrations.CreateModel( +            name='Department', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=30, verbose_name='Label')), +                ('number', models.CharField(unique=True, max_length=3, verbose_name='Number')), +            ], +            options={ +                'ordering': ['number'], +                'verbose_name': 'Department', +                'verbose_name_plural': 'Departments', +            }, +        ), +        migrations.CreateModel( +            name='DocumentTemplate', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=100, verbose_name='Name')), +                ('template', models.FileField(upload_to=b'upload/templates/', verbose_name='Template')), +                ('associated_object_name', models.CharField(max_length=100, verbose_name='Associated object', choices=[(b'archaeological_operations.models.AdministrativeAct', 'Administrative Act')])), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ['associated_object_name', 'name'], +                'verbose_name': 'Document template', +                'verbose_name_plural': 'Document templates', +            }, +        ), +        migrations.CreateModel( +            name='Format', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ['label'], +                'verbose_name': 'Format type', +                'verbose_name_plural': 'Format types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='FormaterType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('formater_type', models.CharField(max_length=20, verbose_name='Formater type', choices=[(b'IntegerFormater', 'Integer'), (b'FloatFormater', 'Float'), (b'UnicodeFormater', 'String'), (b'DateFormater', 'Date'), (b'TypeFormater', 'Type'), (b'YearFormater', 'Year'), (b'StrToBoolean', 'String to boolean'), (b'FileFormater', 'File'), (b'UnknowType', 'Unknow type')])), +                ('options', models.CharField(max_length=500, null=True, verbose_name='Options', blank=True)), +                ('many_split', models.CharField(max_length=10, null=True, verbose_name='Split character(s)', blank=True)), +            ], +            options={ +                'ordering': ('formater_type', 'options'), +                'verbose_name': 'Importer - Formater type', +                'verbose_name_plural': 'Importer - Formater types', +            }, +        ), +        migrations.CreateModel( +            name='GlobalVar', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('slug', models.SlugField(unique=True, verbose_name='Variable name')), +                ('description', models.TextField(null=True, verbose_name='Description of the variable', blank=True)), +                ('value', models.TextField(null=True, verbose_name='Value', blank=True)), +            ], +            options={ +                'ordering': ['slug'], +                'verbose_name': 'Global variable', +                'verbose_name_plural': 'Global variables', +            }, +            bases=(models.Model, ishtar_common.models.Cached), +        ), +        migrations.CreateModel( +            name='HistoricalOrganization', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('address', models.TextField(null=True, verbose_name='Address', blank=True)), +                ('address_complement', models.TextField(null=True, verbose_name='Address complement', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Postal code', blank=True)), +                ('town', models.CharField(max_length=70, null=True, verbose_name='Town', blank=True)), +                ('country', models.CharField(max_length=30, null=True, verbose_name='Country', blank=True)), +                ('alt_address', models.TextField(null=True, verbose_name='Other address: address', blank=True)), +                ('alt_address_complement', models.TextField(null=True, verbose_name='Other address: address complement', blank=True)), +                ('alt_postal_code', models.CharField(max_length=10, null=True, verbose_name='Other address: postal code', blank=True)), +                ('alt_town', models.CharField(max_length=70, null=True, verbose_name='Other address: town', blank=True)), +                ('alt_country', models.CharField(max_length=30, null=True, verbose_name='Other address: country', blank=True)), +                ('phone', models.CharField(max_length=18, null=True, verbose_name='Phone', blank=True)), +                ('phone_desc', models.CharField(max_length=300, null=True, verbose_name='Phone description', blank=True)), +                ('phone2', models.CharField(max_length=18, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone_desc2', models.CharField(max_length=300, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone3', models.CharField(max_length=18, null=True, verbose_name='Phone 3', blank=True)), +                ('phone_desc3', models.CharField(max_length=300, null=True, verbose_name='Phone description 3', blank=True)), +                ('raw_phone', models.TextField(null=True, verbose_name='Raw phone', blank=True)), +                ('mobile_phone', models.CharField(max_length=18, null=True, verbose_name='Mobile phone', blank=True)), +                ('email', models.EmailField(max_length=300, null=True, verbose_name='Email', blank=True)), +                ('alt_address_is_prefered', models.BooleanField(default=False, verbose_name='Alternative address is prefered')), +                ('merge_key', models.TextField(null=True, verbose_name='Merge key', blank=True)), +                ('archived', models.NullBooleanField(default=False)), +                ('name', models.CharField(max_length=500, verbose_name='Name')), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Organization', +            }, +        ), +        migrations.CreateModel( +            name='HistoricalPerson', +            fields=[ +                ('id', models.IntegerField(verbose_name='ID', db_index=True, auto_created=True, blank=True)), +                ('address', models.TextField(null=True, verbose_name='Address', blank=True)), +                ('address_complement', models.TextField(null=True, verbose_name='Address complement', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Postal code', blank=True)), +                ('town', models.CharField(max_length=70, null=True, verbose_name='Town', blank=True)), +                ('country', models.CharField(max_length=30, null=True, verbose_name='Country', blank=True)), +                ('alt_address', models.TextField(null=True, verbose_name='Other address: address', blank=True)), +                ('alt_address_complement', models.TextField(null=True, verbose_name='Other address: address complement', blank=True)), +                ('alt_postal_code', models.CharField(max_length=10, null=True, verbose_name='Other address: postal code', blank=True)), +                ('alt_town', models.CharField(max_length=70, null=True, verbose_name='Other address: town', blank=True)), +                ('alt_country', models.CharField(max_length=30, null=True, verbose_name='Other address: country', blank=True)), +                ('phone', models.CharField(max_length=18, null=True, verbose_name='Phone', blank=True)), +                ('phone_desc', models.CharField(max_length=300, null=True, verbose_name='Phone description', blank=True)), +                ('phone2', models.CharField(max_length=18, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone_desc2', models.CharField(max_length=300, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone3', models.CharField(max_length=18, null=True, verbose_name='Phone 3', blank=True)), +                ('phone_desc3', models.CharField(max_length=300, null=True, verbose_name='Phone description 3', blank=True)), +                ('raw_phone', models.TextField(null=True, verbose_name='Raw phone', blank=True)), +                ('mobile_phone', models.CharField(max_length=18, null=True, verbose_name='Mobile phone', blank=True)), +                ('email', models.EmailField(max_length=300, null=True, verbose_name='Email', blank=True)), +                ('alt_address_is_prefered', models.BooleanField(default=False, verbose_name='Alternative address is prefered')), +                ('merge_key', models.TextField(null=True, verbose_name='Merge key', blank=True)), +                ('archived', models.NullBooleanField(default=False)), +                ('old_title', models.CharField(blank=True, max_length=100, null=True, verbose_name='Title', choices=[(b'Mr', 'Mr'), (b'Ms', 'Miss'), (b'Mr and Miss', 'Mr and Mrs'), (b'Md', 'Mrs'), (b'Dr', 'Doctor')])), +                ('salutation', models.CharField(max_length=200, null=True, verbose_name='Salutation', blank=True)), +                ('surname', models.CharField(max_length=50, null=True, verbose_name='Surname', blank=True)), +                ('name', models.CharField(max_length=200, null=True, verbose_name='Name', blank=True)), +                ('raw_name', models.CharField(max_length=300, null=True, verbose_name='Raw name', blank=True)), +                ('contact_type', models.CharField(max_length=300, null=True, verbose_name='Contact type', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('history_id', models.AutoField(serialize=False, primary_key=True)), +                ('history_date', models.DateTimeField()), +                ('history_type', models.CharField(max_length=1, choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')])), +            ], +            options={ +                'ordering': ('-history_date', '-history_id'), +                'get_latest_by': 'history_date', +                'verbose_name': 'historical Person', +            }, +        ), +        migrations.CreateModel( +            name='Import', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=500, null=True, verbose_name='Name', blank=True)), +                ('imported_file', models.FileField(upload_to=b'upload/imports/', max_length=220, verbose_name='Imported file')), +                ('imported_images', models.FileField(max_length=220, upload_to=b'upload/imports/', null=True, verbose_name='Associated images (zip file)', blank=True)), +                ('encoding', models.CharField(default=b'utf-8', max_length=15, verbose_name='Encoding', choices=[(b'windows-1252', b'windows-1252'), (b'ISO-8859-15', b'ISO-8859-15'), (b'utf-8', b'utf-8')])), +                ('skip_lines', models.IntegerField(default=1, verbose_name='Skip lines')), +                ('error_file', models.FileField(max_length=255, upload_to=b'upload/imports/', null=True, verbose_name='Error file', blank=True)), +                ('result_file', models.FileField(max_length=255, upload_to=b'upload/imports/', null=True, verbose_name='Result file', blank=True)), +                ('match_file', models.FileField(max_length=255, upload_to=b'upload/imports/', null=True, verbose_name='Match file', blank=True)), +                ('state', models.CharField(default=b'C', max_length=2, verbose_name='State', choices=[(b'C', 'Created'), (b'AP', 'Analyse in progress'), (b'A', 'Analysed'), (b'P', 'Import pending'), (b'IP', 'Import in progress'), (b'FE', 'Finished with errors'), (b'F', 'Finished'), (b'AC', 'Archived')])), +                ('conservative_import', models.BooleanField(default=False, help_text=b'If set to true, do not overload existing values', verbose_name='Conservative import')), +                ('creation_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation date', null=True)), +                ('end_date', models.DateTimeField(verbose_name='End date', null=True, editable=False, blank=True)), +                ('seconds_remaining', models.IntegerField(verbose_name='Remaining seconds', null=True, editable=False, blank=True)), +            ], +            options={ +                'verbose_name': 'Import', +                'verbose_name_plural': 'Imports', +            }, +        ), +        migrations.CreateModel( +            name='ImporterColumn', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=200, null=True, verbose_name='Label', blank=True)), +                ('col_number', models.IntegerField(default=1, verbose_name='Column number')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('required', models.BooleanField(default=False, verbose_name='Required')), +                ('export_field_name', models.CharField(help_text='Fill this field if the field name is ambiguous for export. For instance: concatenated fields.', max_length=200, null=True, verbose_name='Export field name', blank=True)), +            ], +            options={ +                'ordering': ('importer_type', 'col_number'), +                'verbose_name': 'Importer - Column', +                'verbose_name_plural': 'Importer - Columns', +            }, +        ), +        migrations.CreateModel( +            name='ImporterDefault', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('target', models.CharField(max_length=500, verbose_name='Target')), +            ], +            options={ +                'verbose_name': 'Importer - Default', +                'verbose_name_plural': 'Importer - Defaults', +            }, +        ), +        migrations.CreateModel( +            name='ImporterDefaultValues', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('target', models.CharField(max_length=500, verbose_name='Target')), +                ('value', models.CharField(max_length=500, verbose_name='Value')), +                ('default_target', models.ForeignKey(related_name='default_values', to='ishtar_common.ImporterDefault')), +            ], +            options={ +                'verbose_name': 'Importer - Default value', +                'verbose_name_plural': 'Importer - Default values', +            }, +        ), +        migrations.CreateModel( +            name='ImporterDuplicateField', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('field_name', models.CharField(max_length=200, null=True, verbose_name='Field name', blank=True)), +                ('force_new', models.BooleanField(default=False, verbose_name='Force creation of new items')), +                ('concat', models.BooleanField(default=False, verbose_name='Concatenate with existing')), +                ('concat_str', models.CharField(max_length=5, null=True, verbose_name='Concatenate character', blank=True)), +                ('column', models.ForeignKey(related_name='duplicate_fields', to='ishtar_common.ImporterColumn')), +            ], +            options={ +                'verbose_name': 'Importer - Duplicate field', +                'verbose_name_plural': 'Importer - Duplicate fields', +            }, +        ), +        migrations.CreateModel( +            name='ImporterModel', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=200, verbose_name='Name')), +                ('klass', models.CharField(max_length=200, verbose_name='Class name')), +            ], +            options={ +                'ordering': ('name',), +                'verbose_name': 'Importer - Model', +                'verbose_name_plural': 'Importer - Models', +            }, +        ), +        migrations.CreateModel( +            name='ImporterType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=100, null=True, verbose_name='Name', blank=True)), +                ('slug', models.SlugField(null=True, max_length=100, blank=True, unique=True, verbose_name='Slug')), +                ('description', models.CharField(max_length=500, null=True, verbose_name='Description', blank=True)), +                ('is_template', models.BooleanField(default=False, verbose_name='Is template')), +                ('unicity_keys', models.CharField(max_length=500, null=True, verbose_name='Unicity keys (separator ";")', blank=True)), +                ('associated_models', models.ForeignKey(related_name='+', verbose_name='Associated model', blank=True, to='ishtar_common.ImporterModel', null=True)), +                ('created_models', models.ManyToManyField(help_text='Leave blank for no restrictions', related_name='+', verbose_name='Models that can accept new items', to='ishtar_common.ImporterModel', blank=True)), +            ], +            options={ +                'ordering': ('name',), +                'verbose_name': 'Importer - Type', +                'verbose_name_plural': 'Importer - Types', +            }, +        ), +        migrations.CreateModel( +            name='ImportTarget', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('target', models.CharField(max_length=500, verbose_name='Target')), +                ('force_new', models.BooleanField(default=False, verbose_name='Force creation of new items')), +                ('concat', models.BooleanField(default=False, verbose_name='Concatenate with existing')), +                ('concat_str', models.CharField(max_length=5, null=True, verbose_name='Concatenate character', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('column', models.ForeignKey(related_name='targets', to='ishtar_common.ImporterColumn')), +                ('formater_type', models.ForeignKey(to='ishtar_common.FormaterType')), +            ], +            options={ +                'verbose_name': 'Importer - Target', +                'verbose_name_plural': 'Importer - Targets', +            }, +        ), +        migrations.CreateModel( +            name='IshtarSiteProfile', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.TextField(verbose_name='Name')), +                ('slug', models.SlugField(unique=True, verbose_name='Slug')), +                ('description', models.TextField(null=True, verbose_name='Description', blank=True)), +                ('base_color', models.CharField(default=b'rgba(0, 0, 0, 0)', max_length=200, verbose_name='CSS color code for base module')), +                ('files', models.BooleanField(default=False, verbose_name='Files module')), +                ('files_color', models.CharField(default=b'rgba(0, 32, 210, 0.1)', max_length=200, verbose_name='CSS color code for files module')), +                ('context_record', models.BooleanField(default=False, verbose_name='Context records module')), +                ('context_record_color', models.CharField(default=b'rgba(210,200,0,0.2)', max_length=200, verbose_name='CSS color code for context record module')), +                ('find', models.BooleanField(default=False, help_text='Need context records module', verbose_name='Finds module')), +                ('find_index', models.CharField(default=b'O', help_text='To prevent irrelevant indexes, change this parameter only if there is no find in the database', max_length=2, verbose_name='Find index is based on', choices=[('O', 'Operations'), ('CR', 'Context records')])), +                ('find_color', models.CharField(default=b'rgba(210,0,0,0.15)', max_length=200, verbose_name='CSS color code for find module')), +                ('warehouse', models.BooleanField(default=False, help_text='Need finds module', verbose_name='Warehouses module')), +                ('warehouse_color', models.CharField(default=b'rgba(10,20,200,0.15)', max_length=200, verbose_name='CSS code for warehouse module')), +                ('mapping', models.BooleanField(default=False, verbose_name='Mapping module')), +                ('mapping_color', models.CharField(default=b'rgba(72, 236, 0, 0.15)', max_length=200, verbose_name='CSS code for mapping module')), +                ('homepage', models.TextField(help_text='Homepage of Ishtar - if not defined a default homepage will appear. Use the markdown syntax. {random_image} can be used to display a random image.', null=True, verbose_name='Home page', blank=True)), +                ('file_external_id', models.TextField(default=b'{year}-{numeric_reference}', help_text='Formula to manage file external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='File external id')), +                ('parcel_external_id', models.TextField(default=b'{associated_file__external_id}{operation__code_patriarche}-{town__numero_insee}-{section}{parcel_number}', help_text='Formula to manage parcel external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Parcel external id')), +                ('context_record_external_id', models.TextField(default=b'{parcel__external_id}-{label}', help_text='Formula to manage context record external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Context record external id')), +                ('base_find_external_id', models.TextField(default=b'{context_record__external_id}-{label}', help_text='Formula to manage base find external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Base find external id')), +                ('find_external_id', models.TextField(default=b'{get_first_base_find__context_record__external_id}-{label}', help_text='Formula to manage find external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Find external id')), +                ('container_external_id', models.TextField(default=b'{responsible__external_id}-{index}', help_text='Formula to manage container external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Container external id')), +                ('warehouse_external_id', models.TextField(default=b'{name|slug}', help_text='Formula to manage warehouse external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Warehouse external id')), +                ('person_raw_name', models.TextField(default=b'{name|upper} {surname}', help_text='Formula to manage person raw_name. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Raw name for person')), +                ('active', models.BooleanField(default=False, verbose_name='Current active')), +                ('currency', models.CharField(default='\u20ac', max_length=b'5', verbose_name='Currency', choices=[('\u20ac', 'Euro'), ('$', 'US dollar')])), +            ], +            options={ +                'ordering': ['label'], +                'verbose_name': 'Ishtar site profile', +                'verbose_name_plural': 'Ishtar site profiles', +            }, +            bases=(models.Model, ishtar_common.models.Cached), +        ), +        migrations.CreateModel( +            name='IshtarUser', +            fields=[ +                ('user_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)), +                ('advanced_shortcut_menu', models.BooleanField(default=False, verbose_name='Advanced shortcut menu')), +            ], +            options={ +                'verbose_name': 'Ishtar user', +                'verbose_name_plural': 'Ishtar users', +            }, +            bases=('auth.user',), +            managers=[ +                (b'objects', django.contrib.auth.models.UserManager()), +            ], +        ), +        migrations.CreateModel( +            name='ItemKey', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('key', models.CharField(max_length=100, verbose_name='Key')), +                ('object_id', models.PositiveIntegerField()), +                ('content_type', models.ForeignKey(to='contenttypes.ContentType')), +                ('importer', models.ForeignKey(blank=True, to='ishtar_common.Import', help_text='Specific key to an import', null=True)), +            ], +        ), +        migrations.CreateModel( +            name='OperationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=1, verbose_name='Order')), +                ('preventive', models.BooleanField(default=True, verbose_name='Is preventive')), +            ], +            options={ +                'ordering': ['-preventive', 'order', 'label'], +                'verbose_name': 'Operation type', +                'verbose_name_plural': 'Operation types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Organization', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('address', models.TextField(null=True, verbose_name='Address', blank=True)), +                ('address_complement', models.TextField(null=True, verbose_name='Address complement', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Postal code', blank=True)), +                ('town', models.CharField(max_length=70, null=True, verbose_name='Town', blank=True)), +                ('country', models.CharField(max_length=30, null=True, verbose_name='Country', blank=True)), +                ('alt_address', models.TextField(null=True, verbose_name='Other address: address', blank=True)), +                ('alt_address_complement', models.TextField(null=True, verbose_name='Other address: address complement', blank=True)), +                ('alt_postal_code', models.CharField(max_length=10, null=True, verbose_name='Other address: postal code', blank=True)), +                ('alt_town', models.CharField(max_length=70, null=True, verbose_name='Other address: town', blank=True)), +                ('alt_country', models.CharField(max_length=30, null=True, verbose_name='Other address: country', blank=True)), +                ('phone', models.CharField(max_length=18, null=True, verbose_name='Phone', blank=True)), +                ('phone_desc', models.CharField(max_length=300, null=True, verbose_name='Phone description', blank=True)), +                ('phone2', models.CharField(max_length=18, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone_desc2', models.CharField(max_length=300, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone3', models.CharField(max_length=18, null=True, verbose_name='Phone 3', blank=True)), +                ('phone_desc3', models.CharField(max_length=300, null=True, verbose_name='Phone description 3', blank=True)), +                ('raw_phone', models.TextField(null=True, verbose_name='Raw phone', blank=True)), +                ('mobile_phone', models.CharField(max_length=18, null=True, verbose_name='Mobile phone', blank=True)), +                ('email', models.EmailField(max_length=300, null=True, verbose_name='Email', blank=True)), +                ('alt_address_is_prefered', models.BooleanField(default=False, verbose_name='Alternative address is prefered')), +                ('merge_key', models.TextField(null=True, verbose_name='Merge key', blank=True)), +                ('archived', models.NullBooleanField(default=False)), +                ('name', models.CharField(max_length=500, verbose_name='Name')), +                ('history_creator', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('history_modifier', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('imports', models.ManyToManyField(related_name='imported_ishtar_common_organization', to='ishtar_common.Import', blank=True)), +                ('merge_candidate', models.ManyToManyField(related_name='merge_candidate_rel_+', to='ishtar_common.Organization', blank=True)), +                ('merge_exclusion', models.ManyToManyField(related_name='merge_exclusion_rel_+', to='ishtar_common.Organization', blank=True)), +            ], +            options={ +                'verbose_name': 'Organization', +                'verbose_name_plural': 'Organizations', +                'permissions': (('view_organization', 'Peut voir toutes les Organisations'), ('view_own_organization', 'Peut voir sa propre Organisation'), ('add_own_organization', 'Peut ajouter sa propre Organisation'), ('change_own_organization', 'Peut modifier sa propre Organisation'), ('delete_own_organization', 'Peut supprimer sa propre Organisation')), +            }, +            bases=(models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter), +        ), +        migrations.CreateModel( +            name='OrganizationType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Organization type', +                'verbose_name_plural': 'Organization types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Person', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('address', models.TextField(null=True, verbose_name='Address', blank=True)), +                ('address_complement', models.TextField(null=True, verbose_name='Address complement', blank=True)), +                ('postal_code', models.CharField(max_length=10, null=True, verbose_name='Postal code', blank=True)), +                ('town', models.CharField(max_length=70, null=True, verbose_name='Town', blank=True)), +                ('country', models.CharField(max_length=30, null=True, verbose_name='Country', blank=True)), +                ('alt_address', models.TextField(null=True, verbose_name='Other address: address', blank=True)), +                ('alt_address_complement', models.TextField(null=True, verbose_name='Other address: address complement', blank=True)), +                ('alt_postal_code', models.CharField(max_length=10, null=True, verbose_name='Other address: postal code', blank=True)), +                ('alt_town', models.CharField(max_length=70, null=True, verbose_name='Other address: town', blank=True)), +                ('alt_country', models.CharField(max_length=30, null=True, verbose_name='Other address: country', blank=True)), +                ('phone', models.CharField(max_length=18, null=True, verbose_name='Phone', blank=True)), +                ('phone_desc', models.CharField(max_length=300, null=True, verbose_name='Phone description', blank=True)), +                ('phone2', models.CharField(max_length=18, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone_desc2', models.CharField(max_length=300, null=True, verbose_name='Phone description 2', blank=True)), +                ('phone3', models.CharField(max_length=18, null=True, verbose_name='Phone 3', blank=True)), +                ('phone_desc3', models.CharField(max_length=300, null=True, verbose_name='Phone description 3', blank=True)), +                ('raw_phone', models.TextField(null=True, verbose_name='Raw phone', blank=True)), +                ('mobile_phone', models.CharField(max_length=18, null=True, verbose_name='Mobile phone', blank=True)), +                ('email', models.EmailField(max_length=300, null=True, verbose_name='Email', blank=True)), +                ('alt_address_is_prefered', models.BooleanField(default=False, verbose_name='Alternative address is prefered')), +                ('merge_key', models.TextField(null=True, verbose_name='Merge key', blank=True)), +                ('archived', models.NullBooleanField(default=False)), +                ('old_title', models.CharField(blank=True, max_length=100, null=True, verbose_name='Title', choices=[(b'Mr', 'Mr'), (b'Ms', 'Miss'), (b'Mr and Miss', 'Mr and Mrs'), (b'Md', 'Mrs'), (b'Dr', 'Doctor')])), +                ('salutation', models.CharField(max_length=200, null=True, verbose_name='Salutation', blank=True)), +                ('surname', models.CharField(max_length=50, null=True, verbose_name='Surname', blank=True)), +                ('name', models.CharField(max_length=200, null=True, verbose_name='Name', blank=True)), +                ('raw_name', models.CharField(max_length=300, null=True, verbose_name='Raw name', blank=True)), +                ('contact_type', models.CharField(max_length=300, null=True, verbose_name='Contact type', blank=True)), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('attached_to', models.ForeignKey(related_name='members', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Is attached to', blank=True, to='ishtar_common.Organization', null=True)), +                ('history_creator', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Creator', blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('history_modifier', models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, verbose_name='Last editor', blank=True, to=settings.AUTH_USER_MODEL, null=True)), +                ('imports', models.ManyToManyField(related_name='imported_ishtar_common_person', to='ishtar_common.Import', blank=True)), +                ('merge_candidate', models.ManyToManyField(related_name='merge_candidate_rel_+', to='ishtar_common.Person', blank=True)), +                ('merge_exclusion', models.ManyToManyField(related_name='merge_exclusion_rel_+', to='ishtar_common.Person', blank=True)), +            ], +            options={ +                'verbose_name': 'Person', +                'verbose_name_plural': 'Persons', +                'permissions': (('view_person', 'Peut voir toutes les Personnes'), ('view_own_person', 'Peut voir sa propre Personne'), ('add_own_person', 'Peut ajouter sa propre Personne'), ('change_own_person', 'Peut modifier sa propre Personne'), ('delete_own_person', 'Peut supprimer sa propre Personne')), +            }, +            bases=(models.Model, ishtar_common.models.OwnPerms, ishtar_common.models.ValueGetter), +        ), +        migrations.CreateModel( +            name='PersonType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('groups', models.ManyToManyField(to='auth.Group', verbose_name='Groups', blank=True)), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Person type', +                'verbose_name_plural': 'Person types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Regexp', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=100, verbose_name='Name')), +                ('description', models.CharField(max_length=500, null=True, verbose_name='Description', blank=True)), +                ('regexp', models.CharField(max_length=500, verbose_name='Regular expression')), +            ], +            options={ +                'verbose_name': 'Importer - Regular expression', +                'verbose_name_plural': 'Importer - Regular expressions', +            }, +        ), +        migrations.CreateModel( +            name='SourceType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ['label'], +                'verbose_name': 'Source type', +                'verbose_name_plural': 'Source types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='SpatialReferenceSystem', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +                ('order', models.IntegerField(default=10, verbose_name='Order')), +                ('auth_name', models.CharField(default=b'EPSG', max_length=256, verbose_name='Authority name')), +                ('srid', models.IntegerField(verbose_name='Authority SRID')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Spatial reference system', +                'verbose_name_plural': 'Spatial reference systems', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='State', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=30, verbose_name='Label')), +                ('number', models.CharField(unique=True, max_length=3, verbose_name='Number')), +            ], +            options={ +                'ordering': ['number'], +                'verbose_name': 'State', +            }, +        ), +        migrations.CreateModel( +            name='SupportType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'verbose_name': 'Support type', +                'verbose_name_plural': 'Support types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='TargetKey', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('key', models.TextField(verbose_name='Key')), +                ('value', models.TextField(null=True, verbose_name='Value', blank=True)), +                ('is_set', models.BooleanField(default=False, verbose_name='Is set')), +                ('associated_import', models.ForeignKey(blank=True, to='ishtar_common.Import', null=True)), +                ('associated_user', models.ForeignKey(blank=True, to='ishtar_common.IshtarUser', null=True)), +                ('target', models.ForeignKey(related_name='keys', to='ishtar_common.ImportTarget')), +            ], +            options={ +                'verbose_name': 'Importer - Target key', +                'verbose_name_plural': 'Importer - Targets keys', +            }, +        ), +        migrations.CreateModel( +            name='TitleType', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('label', models.CharField(max_length=100, verbose_name='Label')), +                ('txt_idx', models.CharField(unique=True, max_length=100, verbose_name='Textual ID', validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])), +                ('comment', models.TextField(null=True, verbose_name='Comment', blank=True)), +                ('available', models.BooleanField(default=True, verbose_name='Available')), +            ], +            options={ +                'ordering': ('label',), +                'verbose_name': 'Title type', +                'verbose_name_plural': 'Title types', +            }, +            bases=(ishtar_common.models.Cached, models.Model), +        ), +        migrations.CreateModel( +            name='Town', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('name', models.CharField(max_length=100, verbose_name='Name')), +                ('surface', models.IntegerField(null=True, verbose_name='Surface (m2)', blank=True)), +                ('center', django.contrib.gis.db.models.fields.PointField(srid=27572, null=True, verbose_name='Localisation', blank=True)), +                ('numero_insee', models.CharField(unique=True, max_length=6, verbose_name='Num\xe9ro INSEE')), +                ('canton', models.ForeignKey(verbose_name='Canton', blank=True, to='ishtar_common.Canton', null=True)), +                ('departement', models.ForeignKey(verbose_name='D\xe9partement', blank=True, to='ishtar_common.Department', null=True)), +                ('imports', models.ManyToManyField(related_name='imported_ishtar_common_town', to='ishtar_common.Import', blank=True)), +            ], +            options={ +                'ordering': ['numero_insee'], +                'verbose_name': 'Town', +                'verbose_name_plural': 'Towns', +            }, +        ), +        migrations.AddField( +            model_name='person', +            name='person_types', +            field=models.ManyToManyField(to='ishtar_common.PersonType', verbose_name='Types'), +        ), +        migrations.AddField( +            model_name='person', +            name='title', +            field=models.ForeignKey(verbose_name='Title', blank=True, to='ishtar_common.TitleType', null=True), +        ), +        migrations.AddField( +            model_name='organization', +            name='organization_type', +            field=models.ForeignKey(verbose_name='Type', to='ishtar_common.OrganizationType'), +        ), +        migrations.AddField( +            model_name='ishtaruser', +            name='person', +            field=models.OneToOneField(related_name='ishtaruser', verbose_name='Person', to='ishtar_common.Person'), +        ), +        migrations.AddField( +            model_name='importtarget', +            name='regexp_filter', +            field=models.ForeignKey(blank=True, to='ishtar_common.Regexp', null=True), +        ), +        migrations.AddField( +            model_name='importertype', +            name='users', +            field=models.ManyToManyField(to='ishtar_common.IshtarUser', verbose_name='Users', blank=True), +        ), +        migrations.AddField( +            model_name='importerdefault', +            name='importer_type', +            field=models.ForeignKey(related_name='defaults', to='ishtar_common.ImporterType'), +        ), +        migrations.AddField( +            model_name='importercolumn', +            name='importer_type', +            field=models.ForeignKey(related_name='columns', to='ishtar_common.ImporterType'), +        ), +        migrations.AddField( +            model_name='importercolumn', +            name='regexp_pre_filter', +            field=models.ForeignKey(blank=True, to='ishtar_common.Regexp', null=True), +        ), +        migrations.AddField( +            model_name='import', +            name='importer_type', +            field=models.ForeignKey(to='ishtar_common.ImporterType'), +        ), +        migrations.AddField( +            model_name='import', +            name='user', +            field=models.ForeignKey(to='ishtar_common.IshtarUser'), +        ), +        migrations.AddField( +            model_name='historicalperson', +            name='attached_to', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.Organization', null=True), +        ), +        migrations.AddField( +            model_name='historicalperson', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalperson', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalperson', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalperson', +            name='title', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.TitleType', null=True), +        ), +        migrations.AddField( +            model_name='historicalorganization', +            name='history_creator', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalorganization', +            name='history_modifier', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalorganization', +            name='history_user', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True), +        ), +        migrations.AddField( +            model_name='historicalorganization', +            name='organization_type', +            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.DO_NOTHING, db_constraint=False, blank=True, to='ishtar_common.OrganizationType', null=True), +        ), +        migrations.AlterUniqueTogether( +            name='formatertype', +            unique_together=set([('formater_type', 'options', 'many_split')]), +        ), +        migrations.AddField( +            model_name='department', +            name='state', +            field=models.ForeignKey(verbose_name='State', blank=True, to='ishtar_common.State', null=True), +        ), +        migrations.AddField( +            model_name='author', +            name='author_type', +            field=models.ForeignKey(verbose_name='Author type', to='ishtar_common.AuthorType'), +        ), +        migrations.AddField( +            model_name='author', +            name='person', +            field=models.ForeignKey(related_name='author', verbose_name='Person', to='ishtar_common.Person'), +        ), +        migrations.AddField( +            model_name='arrondissement', +            name='department', +            field=models.ForeignKey(verbose_name='D\xe9partement', to='ishtar_common.Department'), +        ), +        migrations.AlterUniqueTogether( +            name='targetkey', +            unique_together=set([('target', 'key', 'associated_user', 'associated_import')]), +        ), +        migrations.AlterUniqueTogether( +            name='importercolumn', +            unique_together=set([('importer_type', 'col_number')]), +        ), +        migrations.CreateModel( +            name='AdministrationScript', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('path', models.CharField(max_length=30, verbose_name='Filename')), +                ('name', models.TextField(null=True, verbose_name='Name', blank=True)), +            ], +            options={ +                'ordering': ['name'], +                'verbose_name': 'Administration script', +                'verbose_name_plural': 'Administration scripts', +            }, +        ), +        migrations.CreateModel( +            name='AdministrationTask', +            fields=[ +                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), +                ('state', models.CharField(default=b'S', max_length=2, verbose_name='State', choices=[(b'S', 'Scheduled'), (b'P', 'In progress'), (b'FE', 'Finished with errors'), (b'F', 'Finished')])), +                ('creation_date', models.DateTimeField(default=datetime.datetime.now)), +                ('launch_date', models.DateTimeField(null=True, blank=True)), +                ('finished_date', models.DateTimeField(null=True, blank=True)), +                ('result', models.TextField(null=True, verbose_name='Result', blank=True)), +                ('script', models.ForeignKey(to='ishtar_common.AdministrationScript')), +            ], +            options={ +                'ordering': ['script'], +                'verbose_name': 'Administration task', +                'verbose_name_plural': 'Administration tasks', +            }, +        ), +    ] diff --git a/ishtar_common/migrations/0002_change_ishtaruser_management.py b/ishtar_common/migrations/0002_change_ishtaruser_management.py new file mode 100644 index 000000000..3dda6d7cb --- /dev/null +++ b/ishtar_common/migrations/0002_change_ishtaruser_management.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('ishtar_common', '0001_initial'), +    ] + +    operations = [ +        migrations.AlterModelManagers( +            name='ishtaruser', +            managers=[ +            ], +        ), +        migrations.AlterField( +            model_name='ishtaruser', +            name='user_ptr', +            field=models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL), +        ), +    ] diff --git a/ishtar_common/migrations/0003_auto_20170421_1613.py b/ishtar_common/migrations/0003_auto_20170421_1613.py new file mode 100644 index 000000000..f82860ff3 --- /dev/null +++ b/ishtar_common/migrations/0003_auto_20170421_1613.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +from django.conf import settings + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('ishtar_common', '0002_change_ishtaruser_management'), +    ] + +    operations = [ +        migrations.AlterField( +            model_name='ishtaruser', +            name='user_ptr', +            field=models.OneToOneField(related_name='ishtaruser', primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL), +        ), +    ] diff --git a/ishtar_common/migrations/0077_auto__add_administrationscript__add_administrationtask.py b/ishtar_common/migrations/0077_auto__add_administrationscript__add_administrationtask.py deleted file mode 100644 index b6f2680e6..000000000 --- a/ishtar_common/migrations/0077_auto__add_administrationscript__add_administrationtask.py +++ /dev/null @@ -1,530 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - -    def forwards(self, orm): -        # Adding model 'AdministrationScript' -        db.create_table('ishtar_common_administrationscript', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('path', self.gf('django.db.models.fields.CharField')(max_length=30)), -            ('name', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -        )) -        db.send_create_signal('ishtar_common', ['AdministrationScript']) - -        # Adding model 'AdministrationTask' -        db.create_table('ishtar_common_administrationtask', ( -            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), -            ('script', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.AdministrationScript'])), -            ('state', self.gf('django.db.models.fields.CharField')(default='S', max_length=2)), -            ('creation_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)), -            ('launch_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), -            ('finished_date', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), -            ('result', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), -        )) -        db.send_create_signal('ishtar_common', ['AdministrationTask']) - - -    def backwards(self, orm): -        # Deleting model 'AdministrationScript' -        db.delete_table('ishtar_common_administrationscript') - -        # Deleting model 'AdministrationTask' -        db.delete_table('ishtar_common_administrationtask') - - -    models = { -        'auth.group': { -            'Meta': {'object_name': 'Group'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), -            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) -        }, -        'auth.permission': { -            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, -            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) -        }, -        'auth.user': { -            'Meta': {'object_name': 'User'}, -            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), -            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), -            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), -            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), -            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) -        }, -        'contenttypes.contenttype': { -            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, -            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) -        }, -        'ishtar_common.administrationscript': { -            'Meta': {'ordering': "['name']", 'object_name': 'AdministrationScript'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'path': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.administrationtask': { -            'Meta': {'ordering': "['script']", 'object_name': 'AdministrationTask'}, -            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), -            'finished_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'launch_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'result': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'script': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AdministrationScript']"}), -            'state': ('django.db.models.fields.CharField', [], {'default': "'S'", 'max_length': '2'}) -        }, -        'ishtar_common.arrondissement': { -            'Meta': {'object_name': 'Arrondissement'}, -            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.author': { -            'Meta': {'ordering': "('author_type__order', 'person__name')", 'object_name': 'Author'}, -            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"}) -        }, -        'ishtar_common.authortype': { -            'Meta': {'ordering': "['order', 'label']", 'object_name': 'AuthorType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.canton': { -            'Meta': {'object_name': 'Canton'}, -            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) -        }, -        'ishtar_common.department': { -            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}), -            'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.documenttemplate': { -            'Meta': {'ordering': "['associated_object_name', 'name']", 'object_name': 'DocumentTemplate'}, -            'associated_object_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'template': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) -        }, -        'ishtar_common.format': { -            'Meta': {'ordering': "['label']", 'object_name': 'Format'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.formatertype': { -            'Meta': {'ordering': "('formater_type', 'options')", 'unique_together': "(('formater_type', 'options', 'many_split'),)", 'object_name': 'FormaterType'}, -            'formater_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'many_split': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'options': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.globalvar': { -            'Meta': {'ordering': "['slug']", 'object_name': 'GlobalVar'}, -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), -            'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.historicalorganization': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOrganization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'organization_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.historicalperson': { -            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalPerson'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'attached_to_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), -            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), -            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), -            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'title_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.import': { -            'Meta': {'object_name': 'Import'}, -            'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), -            'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), -            'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), -            'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '220'}), -            'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '220', 'null': 'True', 'blank': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), -            'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), -            'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), -            'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), -            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) -        }, -        'ishtar_common.importercolumn': { -            'Meta': {'ordering': "('importer_type', 'col_number')", 'unique_together': "(('importer_type', 'col_number'),)", 'object_name': 'ImporterColumn'}, -            'col_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'export_field_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'columns'", 'to': "orm['ishtar_common.ImporterType']"}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'regexp_pre_filter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Regexp']", 'null': 'True', 'blank': 'True'}), -            'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) -        }, -        'ishtar_common.importerdefault': { -            'Meta': {'object_name': 'ImporterDefault'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'defaults'", 'to': "orm['ishtar_common.ImporterType']"}), -            'target': ('django.db.models.fields.CharField', [], {'max_length': '500'}) -        }, -        'ishtar_common.importerdefaultvalues': { -            'Meta': {'object_name': 'ImporterDefaultValues'}, -            'default_target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'default_values'", 'to': "orm['ishtar_common.ImporterDefault']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'target': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'value': ('django.db.models.fields.CharField', [], {'max_length': '500'}) -        }, -        'ishtar_common.importerduplicatefield': { -            'Meta': {'object_name': 'ImporterDuplicateField'}, -            'column': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'duplicate_fields'", 'to': "orm['ishtar_common.ImporterColumn']"}), -            'concat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'concat_str': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True', 'blank': 'True'}), -            'field_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'force_new': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) -        }, -        'ishtar_common.importermodel': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterModel'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'klass': ('django.db.models.fields.CharField', [], {'max_length': '200'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}) -        }, -        'ishtar_common.importertype': { -            'Meta': {'ordering': "('name',)", 'object_name': 'ImporterType'}, -            'associated_models': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.ImporterModel']"}), -            'created_models': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.ImporterModel']"}), -            'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), -            'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.importtarget': { -            'Meta': {'object_name': 'ImportTarget'}, -            'column': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'targets'", 'to': "orm['ishtar_common.ImporterColumn']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'concat': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'concat_str': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True', 'blank': 'True'}), -            'force_new': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'formater_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.FormaterType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'regexp_filter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Regexp']", 'null': 'True', 'blank': 'True'}), -            'target': ('django.db.models.fields.CharField', [], {'max_length': '500'}) -        }, -        'ishtar_common.ishtarsiteprofile': { -            'Meta': {'ordering': "['label']", 'object_name': 'IshtarSiteProfile'}, -            'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'base_color': ('django.db.models.fields.CharField', [], {'default': "'rgba(0, 0, 0, 0)'", 'max_length': '200'}), -            'base_find_external_id': ('django.db.models.fields.TextField', [], {'default': "'{context_record__external_id}-{label}'"}), -            'container_external_id': ('django.db.models.fields.TextField', [], {'default': "'{responsible__external_id}-{index}'"}), -            'context_record': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'context_record_color': ('django.db.models.fields.CharField', [], {'default': "'rgba(210,200,0,0.2)'", 'max_length': '200'}), -            'context_record_external_id': ('django.db.models.fields.TextField', [], {'default': "'{parcel__external_id}-{label}'"}), -            'currency': ('django.db.models.fields.CharField', [], {'default': "u'\\u20ac'", 'max_length': "'5'"}), -            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'file_external_id': ('django.db.models.fields.TextField', [], {'default': "'{year}-{numeric_reference}'"}), -            'files': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'files_color': ('django.db.models.fields.CharField', [], {'default': "'rgba(0, 32, 210, 0.1)'", 'max_length': '200'}), -            'find': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'find_color': ('django.db.models.fields.CharField', [], {'default': "'rgba(210,0,0,0.15)'", 'max_length': '200'}), -            'find_external_id': ('django.db.models.fields.TextField', [], {'default': "'{get_first_base_find__context_record__external_id}-{label}'"}), -            'find_index': ('django.db.models.fields.CharField', [], {'default': "'O'", 'max_length': '2'}), -            'homepage': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.TextField', [], {}), -            'mapping': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'mapping_color': ('django.db.models.fields.CharField', [], {'default': "'rgba(72, 236, 0, 0.15)'", 'max_length': '200'}), -            'parcel_external_id': ('django.db.models.fields.TextField', [], {'default': "'{associated_file__external_id}{operation__code_patriarche}-{town__numero_insee}-{section}{parcel_number}'"}), -            'person_raw_name': ('django.db.models.fields.TextField', [], {'default': "'{name|upper} {surname}'"}), -            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), -            'warehouse': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'warehouse_color': ('django.db.models.fields.CharField', [], {'default': "'rgba(10,20,200,0.15)'", 'max_length': '200'}), -            'warehouse_external_id': ('django.db.models.fields.TextField', [], {'default': "'{name|slug}'"}) -        }, -        'ishtar_common.ishtaruser': { -            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, -            'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), -            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) -        }, -        'ishtar_common.itemkey': { -            'Meta': {'object_name': 'ItemKey'}, -            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'importer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Import']", 'null': 'True', 'blank': 'True'}), -            'key': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}) -        }, -        'ishtar_common.operationtype': { -            'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), -            'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.organization': { -            'Meta': {'object_name': 'Organization'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), -            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.organizationtype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.person': { -            'Meta': {'object_name': 'Person'}, -            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), -            'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), -            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), -            'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), -            'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), -            'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), -            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), -            'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), -            'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), -            'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), -            'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), -            'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), -            'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.persontype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.regexp': { -            'Meta': {'object_name': 'Regexp'}, -            'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'regexp': ('django.db.models.fields.CharField', [], {'max_length': '500'}) -        }, -        'ishtar_common.sourcetype': { -            'Meta': {'ordering': "['label']", 'object_name': 'SourceType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.spatialreferencesystem': { -            'Meta': {'ordering': "('label',)", 'object_name': 'SpatialReferenceSystem'}, -            'auth_name': ('django.db.models.fields.CharField', [], {'default': "'EPSG'", 'max_length': '256'}), -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), -            'srid': ('django.db.models.fields.IntegerField', [], {}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.state': { -            'Meta': {'ordering': "['number']", 'object_name': 'State'}, -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), -            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) -        }, -        'ishtar_common.supporttype': { -            'Meta': {'object_name': 'SupportType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.targetkey': { -            'Meta': {'unique_together': "(('target', 'key', 'associated_user', 'associated_import'),)", 'object_name': 'TargetKey'}, -            'associated_import': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Import']", 'null': 'True', 'blank': 'True'}), -            'associated_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'is_set': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), -            'key': ('django.db.models.fields.TextField', [], {}), -            'target': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'keys'", 'to': "orm['ishtar_common.ImportTarget']"}), -            'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) -        }, -        'ishtar_common.titletype': { -            'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, -            'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), -            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) -        }, -        'ishtar_common.town': { -            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, -            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), -            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), -            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), -            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), -            'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_town'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), -            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), -            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), -            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) -        } -    } - -    complete_apps = ['ishtar_common']
\ No newline at end of file diff --git a/ishtar_common/model_merging.py b/ishtar_common/model_merging.py index c577a8cf1..be2867cb6 100644 --- a/ishtar_common/model_merging.py +++ b/ishtar_common/model_merging.py @@ -1,11 +1,22 @@  # from https://djangosnippets.org/snippets/2283/ +from django.apps import apps  from django.db import transaction -from django.db.models import get_models, Model -from django.contrib.contenttypes.generic import GenericForeignKey +from django.db.models import Model +from django.contrib.contenttypes.fields import GenericForeignKey +from django.core.exceptions import ObjectDoesNotExist -@transaction.commit_on_success +def get_models(): +    _apps = apps.app_configs.items() +    models = [] +    for app_name, app_config in _apps: +        models += [apps.get_model(app_name, m) +                   for m in apps.get_app_config(app_name).models] +    return models + + +@transaction.atomic  def merge_model_objects(primary_object, alias_objects=[], keep_old=False):      """      Use this function to merge model objects (i.e. Users, Organizations, Polls, @@ -63,7 +74,10 @@ def merge_model_objects(primary_object, alias_objects=[], keep_old=False):              alias_varname = related_object.get_accessor_name()              # The variable name on the related model.              obj_varname = related_object.field.name -            related_objects = getattr(alias_object, alias_varname) +            try: +                related_objects = getattr(alias_object, alias_varname) +            except ObjectDoesNotExist: +                continue              for obj in related_objects.all():                  setattr(obj, obj_varname, primary_object)                  obj.save() diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 5c84447a4..6082fb4e0 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -30,9 +30,11 @@ import logging  import os  from os.path import isfile, join  import re +from secretary import Renderer as SecretaryRenderer  import shutil  from subprocess import Popen, PIPE  import tempfile +import time  import unicodecsv  import zipfile @@ -57,38 +59,29 @@ from django.template.defaultfilters import slugify  from django.contrib.auth.models import User, Group  from django.contrib.contenttypes.models import ContentType -from django.contrib.contenttypes import generic +from django.contrib.contenttypes.fields import GenericForeignKey  from django.contrib.gis.db import models  from simple_history.models import HistoricalRecords as BaseHistoricalRecords -from ishtar_common.ooo_replace import ooo_replace  from ishtar_common.model_merging import merge_model_objects  from ishtar_common.utils import get_cache, disable_for_loaddata  from ishtar_common.data_importer import Importer, ImportFormater, \      IntegerFormater, FloatFormater, UnicodeFormater, DateFormater, \      TypeFormater, YearFormater, StrToBoolean, FileFormater -  logger = logging.getLogger(__name__)  def post_save_user(sender, **kwargs):      user = kwargs['instance'] -    try: -        q = IshtarUser.objects.filter(username=user.username) -        if not q.count(): -            ishtaruser = IshtarUser.create_from_user(user) -        else: -            ishtaruser = q.all()[0] -        administrator, created = PersonType.objects.get_or_create( -            txt_idx='administrator') -        if ishtaruser.is_superuser \ -           and not ishtaruser.has_right('administrator'): -            ishtaruser.person.person_types.add(administrator) -    except DatabaseError:  # manage when db is not synced -        pass +    if kwargs["created"]: +        try: +            IshtarUser.create_from_user(user) +        except DatabaseError:  # manage when db is not synced +            pass +    IshtarUser.set_superuser(user)  post_save.connect(post_save_user, sender=User) @@ -132,7 +125,7 @@ def check_model_access_control(request, model, available_perms=None):  class Imported(models.Model):      imports = models.ManyToManyField( -        'Import', blank=True, null=True, +        'Import', blank=True,          related_name="imported_%(app_label)s_%(class)s")      class Meta: @@ -158,6 +151,15 @@ class ValueGetter(object):                  values[prefix + field_name] = value          for extra_field in self.GET_VALUES_EXTRA:              values[prefix + extra_field] = getattr(self, extra_field) or '' +        for key in values.keys(): +            val = values[key] +            if val is None: +                val = '' +            else: +                val = unicode(val) +            if val.endswith('.None'): +                val = '' +            values[key] = val          values['KEYS'] = u'\n'.join(values.keys())          value_list = []          for key in values.keys(): @@ -187,7 +189,7 @@ class HistoricalRecords(BaseHistoricalRecords):              history_modifier = getattr(instance, 'history_modifier', None)              assert history_modifier          except (User.DoesNotExist, AssertionError): -            # on batch removing of users, user could have disapeared +            # on batch removing of users, user could have disappeared              return          manager = getattr(instance, self.manager_name)          attrs = {} @@ -197,7 +199,8 @@ class HistoricalRecords(BaseHistoricalRecords):              .filter(history_modifier_id=history_modifier.pk)\              .order_by('-history_date', '-history_id')          if not q_history.count(): -            manager.create(history_type=type, **attrs) +            manager.create(history_type=type, +                           history_date=datetime.datetime.now(), **attrs)              return          old_instance = q_history.all()[0]          # multiple saving by the same user in a very short time are generaly @@ -210,6 +213,8 @@ class HistoricalRecords(BaseHistoricalRecords):          if q.count():              return +        if 'history_date' not in attrs or not attrs['history_date']: +            attrs['history_date'] = datetime.datetime.now()          # record a new version only if data have been changed          for field in instance._meta.fields:              if getattr(old_instance, field.attname) != attrs[field.attname]: @@ -253,7 +258,7 @@ def is_unique(cls, field):      return func -class OwnPerms: +class OwnPerms(object):      """      Manage special permissions for object's owner      """ @@ -315,13 +320,13 @@ class OwnPerms:          """          Get Own items          """ -        if isinstance(user, User): -            user = IshtarUser.objects.get(user_ptr=user) -        if user.is_anonymous(): +        if hasattr(user, 'is_authenticated') and not user.is_authenticated():              returned = cls.objects.filter(pk__isnull=True)              if values:                  returned = []              return returned +        if isinstance(user, User): +            user = IshtarUser.objects.get(user_ptr=user)          items = []          if hasattr(cls, 'BASKET_MODEL'):              items = list(cls.BASKET_MODEL.objects.filter(user=user).all()) @@ -774,7 +779,7 @@ class ItemKey(models.Model):      key = models.CharField(_(u"Key"), max_length=100)      content_type = models.ForeignKey(ContentType)      object_id = models.PositiveIntegerField() -    content_object = generic.GenericForeignKey('content_type', 'object_id') +    content_object = GenericForeignKey('content_type', 'object_id')      importer = models.ForeignKey(          'Import', null=True, blank=True,          help_text=_(u"Specific key to an import")) @@ -869,6 +874,28 @@ class HistoryError(Exception):  PRIVATE_FIELDS = ('id', 'history_modifier', 'order') +class BulkUpdatedItem(object): +    @classmethod +    def bulk_recursion(cls, transaction_id, extra_args): +        """ +        Prevent infinite recursion. Should not happen but wrong manipulation +        in the database or messy imports can generate circular relations + +        :param transaction_id: current transaction ID (unix time) - if null +        a transaction ID is generated +        :param extra_args: arguments dealing with +        :return: (transaction ID, is a recursion) +        """ +        if not transaction_id: +            transaction_id = unicode(time.time()) +        args = ['cached_label_bulk_update', transaction_id] + extra_args +        key, val = get_cache(cls, args) +        if val: +            return transaction_id, True +        cache.set(key, 1, settings.CACHE_SMALLTIMEOUT) +        return transaction_id, False + +  class BaseHistorizedItem(Imported):      IS_BASKET = False      history_modifier = models.ForeignKey( @@ -1163,16 +1190,16 @@ class IshtarSiteProfile(models.Model, Cached):      description = models.TextField(_(u"Description"), null=True, blank=True)      base_color = models.CharField(          _(u"CSS color code for base module"), -        default='rgba(0, 0, 0, 0)', max_length=200) +        default=u'rgba(0, 0, 0, 0)', max_length=200)      files = models.BooleanField(_(u"Files module"), default=False)      files_color = models.CharField(          _(u"CSS color code for files module"), -        default='rgba(0, 32, 210, 0.1)', max_length=200) +        default=u'rgba(0, 32, 210, 0.1)', max_length=200)      context_record = models.BooleanField(_(u"Context records module"),                                           default=False)      context_record_color = models.CharField(          _(u"CSS color code for context record module"), -        default='rgba(210,200,0,0.2)', max_length=200) +        default=u'rgba(210,200,0,0.2)', max_length=200)      find = models.BooleanField(_(u"Finds module"), default=False,                                 help_text=_(u"Need context records module"))      find_index = models.CharField( @@ -1182,16 +1209,16 @@ class IshtarSiteProfile(models.Model, Cached):                      u"only if there is no find in the database"))      find_color = models.CharField(          _(u"CSS color code for find module"), -        default='rgba(210,0,0,0.15)', max_length=200) +        default=u'rgba(210,0,0,0.15)', max_length=200)      warehouse = models.BooleanField(          _(u"Warehouses module"), default=False,          help_text=_(u"Need finds module"))      warehouse_color = models.CharField( -        _(u"CSS code for warehouse module"), default='rgba(10,20,200,0.15)', +        _(u"CSS code for warehouse module"), default=u'rgba(10,20,200,0.15)',          max_length=200)      mapping = models.BooleanField(_(u"Mapping module"), default=False)      mapping_color = models.CharField( -        _(u"CSS code for mapping module"), default='rgba(72, 236, 0, 0.15)', +        _(u"CSS code for mapping module"), default=u'rgba(72, 236, 0, 0.15)',          max_length=200)      homepage = models.TextField(          _(u"Home page"), null=True, blank=True, @@ -1200,57 +1227,57 @@ class IshtarSiteProfile(models.Model, Cached):                      u"can be used to display a random image."))      file_external_id = models.TextField(          _(u"File external id"), -        default="{year}-{numeric_reference}", +        default=u"{year}-{numeric_reference}",          help_text=_(u"Formula to manage file external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      parcel_external_id = models.TextField(          _(u"Parcel external id"), -        default="{associated_file__external_id}{operation__code_patriarche}-" -                "{town__numero_insee}-{section}{parcel_number}", +        default=u"{associated_file__external_id}{operation__code_patriarche}-" +                u"{town__numero_insee}-{section}{parcel_number}",          help_text=_(u"Formula to manage parcel external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      context_record_external_id = models.TextField(          _(u"Context record external id"), -        default="{parcel__external_id}-{label}", +        default=u"{parcel__external_id}-{label}",          help_text=_(u"Formula to manage context record external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      base_find_external_id = models.TextField(          _(u"Base find external id"), -        default="{context_record__external_id}-{label}", +        default=u"{context_record__external_id}-{label}",          help_text=_(u"Formula to manage base find external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      find_external_id = models.TextField(          _(u"Find external id"), -        default="{get_first_base_find__context_record__external_id}-{label}", +        default=u"{get_first_base_find__context_record__external_id}-{label}",          help_text=_(u"Formula to manage find external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      container_external_id = models.TextField(          _(u"Container external id"), -        default="{responsible__external_id}-{index}", +        default=u"{responsible__external_id}-{index}",          help_text=_(u"Formula to manage container external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      warehouse_external_id = models.TextField(          _(u"Warehouse external id"), -        default="{name|slug}", +        default=u"{name|slug}",          help_text=_(u"Formula to manage warehouse external ID. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external "                      u"data can be destructive."))      person_raw_name = models.TextField(          _(u"Raw name for person"), -        default="{name|upper} {surname}", +        default=u"{name|upper} {surname}",          help_text=_(u"Formula to manage person raw_name. "                      u"Change this with care. With incorrect formula, the "                      u"application might be unusable and import of external " @@ -1584,7 +1611,50 @@ class DocumentTemplate(models.Model):              datetime.date.today().strftime('%Y-%m-%d') +\              u"." + self.template.name.split('.')[-1]          values = c_object.get_values() +        engine = SecretaryRenderer() +        result = engine.render(self.template, **values) +        output = open(output_name, 'wb') +        output.write(result) +        return output_name + +    def convert_from_v1(self): +        """ +        Convert the current template from v1 to v2. +        """ +        from old.ooo_replace import ooo_replace +        from archaeological_operations.models import AdministrativeAct + +        old_dir = settings.MEDIA_ROOT + "/upload/templates/v1/" +        if not os.path.exists(old_dir): +            os.makedirs(old_dir) +        shutil.copy(settings.MEDIA_ROOT + self.template.name, old_dir) + +        tempdir = tempfile.mkdtemp("-ishtardocs") +        output_name = tempdir + os.path.sep + self.template.name.split( +            os.sep)[-1] + +        objects = [] +        filters = [ +            {'operation__isnull': False}, +            {'associated_file__isnull': False}, +            {'treatment_file__isnull': False}, +            {'treatment__isnull': False}, +        ] +        for filtr in filters: +            q = AdministrativeAct.objects.filter(**filtr) +            if q.count(): +                objects.append(q.all()[0]) + +        if not objects: +            return +        values = {} +        for obj in objects: +            values.update(obj.get_values()) +        for key in values: +            values[key] = "{{ " + key + " }}" +          ooo_replace(self.template, output_name, values) +        shutil.move(output_name, settings.MEDIA_ROOT + self.template.name)          return output_name @@ -1704,10 +1774,8 @@ class Address(BaseHistorizedItem):  class Merge(models.Model):      merge_key = models.TextField(_("Merge key"), blank=True, null=True) -    merge_candidate = models.ManyToManyField("self", -                                             blank=True, null=True) -    merge_exclusion = models.ManyToManyField("self", -                                             blank=True, null=True) +    merge_candidate = models.ManyToManyField("self", blank=True) +    merge_exclusion = models.ManyToManyField("self", blank=True)      archived = models.NullBooleanField(default=False,                                         blank=True, null=True)      # 1 for one word similarity, 2 for two word similarity, etc. @@ -1846,13 +1914,13 @@ class ImporterType(models.Model):      description = models.CharField(_(u"Description"), blank=True, null=True,                                     max_length=500)      users = models.ManyToManyField('IshtarUser', verbose_name=_(u"Users"), -                                   blank=True, null=True) +                                   blank=True)      associated_models = models.ForeignKey(          ImporterModel, verbose_name=_(u"Associated model"),          related_name='+', blank=True, null=True)      created_models = models.ManyToManyField(          ImporterModel, verbose_name=_(u"Models that can accept new items"), -        blank=True, null=True, help_text=_(u"Leave blank for no restrictions"), +        blank=True, help_text=_(u"Leave blank for no restrictions"),          related_name='+')      is_template = models.BooleanField(_(u"Is template"), default=False)      unicity_keys = models.CharField(_(u"Unicity keys (separator \";\")"), @@ -2366,7 +2434,7 @@ class Import(models.Model):          _(u"Associated images (zip file)"), upload_to="upload/imports/",          blank=True, null=True, max_length=220)      encoding = models.CharField(_(u"Encoding"), choices=ENCODINGS, -                                default='utf-8', max_length=15) +                                default=u'utf-8', max_length=15)      skip_lines = models.IntegerField(_(u"Skip lines"), default=1)      error_file = models.FileField(_(u"Error file"),                                    upload_to="upload/imports/", @@ -2378,7 +2446,7 @@ class Import(models.Model):                                    upload_to="upload/imports/",                                    blank=True, null=True, max_length=255)      state = models.CharField(_(u"State"), max_length=2, choices=IMPORT_STATE, -                             default='C') +                             default=u'C')      conservative_import = models.BooleanField(          _(u"Conservative import"), default=False,          help_text='If set to true, do not overload existing values') @@ -2572,13 +2640,11 @@ class Organization(Address, Merge, OwnPerms, ValueGetter):          verbose_name = _(u"Organization")          verbose_name_plural = _(u"Organizations")          permissions = ( -            ("view_organization", ugettext(u"Can view all Organizations")), -            ("view_own_organization", ugettext(u"Can view own Organization")), -            ("add_own_organization", ugettext(u"Can add own Organization")), -            ("change_own_organization", -             ugettext(u"Can change own Organization")), -            ("delete_own_organization", -             ugettext(u"Can delete own Organization")), +            ("view_organization", u"Can view all Organizations"), +            ("view_own_organization", u"Can view own Organization"), +            ("add_own_organization", u"Can add own Organization"), +            ("change_own_organization", u"Can change own Organization"), +            ("delete_own_organization", u"Can delete own Organization"),          )      def simple_lbl(self): @@ -2614,7 +2680,7 @@ class Organization(Address, Merge, OwnPerms, ValueGetter):  class PersonType(GeneralType):      # rights = models.ManyToManyField(WizardStep, verbose_name=_(u"Rights"))      groups = models.ManyToManyField(Group, verbose_name=_(u"Groups"), -                                    blank=True, null=True) +                                    blank=True)      class Meta:          verbose_name = _(u"Person type") @@ -2689,11 +2755,11 @@ class Person(Address, Merge, OwnPerms, ValueGetter):          verbose_name = _(u"Person")          verbose_name_plural = _(u"Persons")          permissions = ( -            ("view_person", ugettext(u"Can view all Persons")), -            ("view_own_person", ugettext(u"Can view own Person")), -            ("add_own_person", ugettext(u"Can add own Person")), -            ("change_own_person", ugettext(u"Can change own Person")), -            ("delete_own_person", ugettext(u"Can delete own Person")), +            ("view_person", u"Can view all Persons"), +            ("view_own_person", u"Can view own Person"), +            ("add_own_person", u"Can add own Person"), +            ("change_own_person", u"Can change own Person"), +            ("delete_own_person", u"Can delete own Person"),          )      @property @@ -2781,21 +2847,21 @@ class Person(Address, Merge, OwnPerms, ValueGetter):                  txt_idx__in=right_name).count()) or \                  bool(self.person_types.filter(                       groups__permissions__codename__in=right_name).count()) or\ -                bool(self.ishtaruser.filter( -                     groups__permissions__codename__in=right_name +                bool(self.ishtaruser.user_ptr.groups.filter( +                     permissions__codename__in=right_name                       ).count()) or\ -                bool(self.ishtaruser.filter( -                     user_permissions__codename__in=right_name).count()) +                bool(self.ishtaruser.user_ptr.user_permissions.filter( +                     codename__in=right_name).count())          # or self.person_types.filter(wizard__url_name__in=right_name).count())          else:              res = bool(self.person_types.filter(txt_idx=right_name).count()) or \                  bool(self.person_types.filter(                       groups__permissions__codename=right_name).count()) or \ -                bool(self.ishtaruser.filter( -                     groups__permissions__codename__in=[right_name] -                     ).count()) or\ -                bool(self.ishtaruser.filter( -                     user_permissions__codename__in=[right_name]).count()) +                bool(self.ishtaruser.user_ptr.groups.filter( +                     permissions__codename__in=[right_name] +                     ).count()) or \ +                bool(self.ishtaruser.user_ptr.user_permissions.filter( +                     codename__in=[right_name]).count())          # or self.person_types.filter(wizard__url_name=right_name).count())          if session:              cache.set(cache_key, res, settings.CACHE_SMALLTIMEOUT) @@ -2862,7 +2928,7 @@ class Person(Address, Merge, OwnPerms, ValueGetter):                =user.ishtaruser) -class IshtarUser(User): +class IshtarUser(models.Model):      TABLE_COLS = ('username', 'person__name', 'person__surname',                    'person__email', 'person__person_types_list',                    'person__attached_to') @@ -2879,8 +2945,10 @@ class IshtarUser(User):      }      # fields -    person = models.ForeignKey(Person, verbose_name=_(u"Person"), unique=True, -                               related_name='ishtaruser') +    user_ptr = models.OneToOneField(User, primary_key=True, +                                    related_name='ishtaruser') +    person = models.OneToOneField(Person, verbose_name=_(u"Person"), +                                  related_name='ishtaruser')      advanced_shortcut_menu = models.BooleanField(          _(u"Advanced shortcut menu"), default=False) @@ -2889,6 +2957,20 @@ class IshtarUser(User):          verbose_name_plural = _(u"Ishtar users")      @classmethod +    def set_superuser(cls, user): +        q = cls.objects.filter(user_ptr=user) +        if not q.count(): +            return +        ishtaruser = q.all()[0] +        admin, created = PersonType.objects.get_or_create( +            txt_idx='administrator') +        person = ishtaruser.person +        if user.is_superuser: +            person.person_types.add(admin) +        elif admin in person.person_types.all(): +            person.person_types.remove(admin) + +    @classmethod      def create_from_user(cls, user):          default = user.username          surname = user.first_name or default @@ -2897,13 +2979,7 @@ class IshtarUser(User):          person = Person.objects.create(surname=surname,                                         name=name, email=email,                                         history_modifier=user) -        if user.is_superuser: -            person_type, created = PersonType.objects.get_or_create( -                txt_idx='administrator') -            person.person_types.add(person_type) -        password = user.password -        isht_user = IshtarUser.objects.create( -            user_ptr=user, username=default, person=person, password=password) +        isht_user = cls.objects.create(user_ptr=user, person=person)          return isht_user      def has_right(self, right_name, session=None): @@ -2914,20 +2990,17 @@ class IshtarUser(User):      def has_perm(self, perm, model=None, session=None, obj=None):          if not session: -            return super(IshtarUser, self).has_perm(perm, model) +            return self.user_ptr.has_perm(perm, model)          cache_key = 'usersession-{}-{}-{}-{}'.format(              session.session_key, perm, model.__name__ if model else 'no',              obj.pk if obj else 'no')          res = cache.get(cache_key)          if res in (True, False):              return res -        res = super(IshtarUser, self).has_perm(perm, model) +        res = self.user_ptr.has_perm(perm, model)          cache.set(cache_key, res, settings.CACHE_SMALLTIMEOUT)          return res -IshtarUser._meta.get_field('password').help_text = _( -    u"To modify the password use the form in Auth > User") -  class AuthorType(GeneralType):      order = models.IntegerField(_(u"Order"), default=1) @@ -2950,16 +3023,11 @@ class Author(models.Model):          verbose_name_plural = _(u"Authors")          ordering = ('author_type__order', 'person__name')          permissions = ( -            ("view_author", -             ugettext(u"Can view all Authors")), -            ("view_own_author", -             ugettext(u"Can view own Author")), -            ("add_own_author", -             ugettext(u"Can add own Author")), -            ("change_own_author", -             ugettext(u"Can change own Author")), -            ("delete_own_author", -             ugettext(u"Can delete own Author")), +            ("view_author", u"Can view all Authors"), +            ("view_own_author", u"Can view own Author"), +            ("add_own_author", u"Can add own Author"), +            ("change_own_author", u"Can change own Author"), +            ("delete_own_author", u"Can delete own Author"),          )      def __unicode__(self): @@ -3017,7 +3085,7 @@ class Source(OwnPerms, ImageModel, models.Model):      authors = models.ManyToManyField(Author, verbose_name=_(u"Authors"),                                       related_name="%(class)s_related")      associated_url = models.URLField( -        verify_exists=False, blank=True, null=True, +        blank=True, null=True,          verbose_name=_(u"Numerical ressource (web address)"))      receipt_date = models.DateField(blank=True, null=True,                                      verbose_name=_(u"Receipt date")) @@ -3156,7 +3224,7 @@ post_delete.connect(post_save_cache, sender=OperationType)  class SpatialReferenceSystem(GeneralType):      order = models.IntegerField(_(u"Order"), default=10)      auth_name = models.CharField( -        _(u"Authority name"), default='EPSG', max_length=256) +        _(u"Authority name"), default=u'EPSG', max_length=256)      srid = models.IntegerField(_(u"Authority SRID"))      class Meta: diff --git a/ishtar_common/old_migrations/0001_initial.py b/ishtar_common/old_migrations/0001_initial.py new file mode 100644 index 000000000..fc22881bc --- /dev/null +++ b/ishtar_common/old_migrations/0001_initial.py @@ -0,0 +1,408 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + +    def forwards(self, orm): +        # Adding model 'Wizard' +        db.create_table('ishtar_common_wizard', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('url_name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)), +        )) +        db.send_create_signal('ishtar_common', ['Wizard']) + +        # Adding model 'WizardStep' +        db.create_table('ishtar_common_wizardstep', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('order', self.gf('django.db.models.fields.IntegerField')()), +            ('wizard', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Wizard'])), +            ('url_name', self.gf('django.db.models.fields.CharField')(max_length=128)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=128)), +        )) +        db.send_create_signal('ishtar_common', ['WizardStep']) + +        # Adding model 'Department' +        db.create_table('ishtar_common_department', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=30)), +            ('number', self.gf('django.db.models.fields.CharField')(unique=True, max_length=3)), +        )) +        db.send_create_signal('ishtar_common', ['Department']) + +        # Adding model 'OrganizationType' +        db.create_table('ishtar_common_organizationtype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('ishtar_common', ['OrganizationType']) + +        # Adding model 'HistoricalOrganization' +        db.create_table('ishtar_common_historicalorganization', ( +            ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)), +            ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('organization_type_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)), +            ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), +            ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), +            ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)), +        )) +        db.send_create_signal('ishtar_common', ['HistoricalOrganization']) + +        # Adding model 'Organization' +        db.create_table('ishtar_common_organization', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('organization_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.OrganizationType'])), +        )) +        db.send_create_signal('ishtar_common', ['Organization']) + +        # Adding model 'PersonType' +        db.create_table('ishtar_common_persontype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('ishtar_common', ['PersonType']) + +        # Adding M2M table for field rights on 'PersonType' +        db.create_table('ishtar_common_persontype_rights', ( +            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), +            ('persontype', models.ForeignKey(orm['ishtar_common.persontype'], null=False)), +            ('wizardstep', models.ForeignKey(orm['ishtar_common.wizardstep'], null=False)) +        )) +        db.create_unique('ishtar_common_persontype_rights', ['persontype_id', 'wizardstep_id']) + +        # Adding model 'Person' +        db.create_table('ishtar_common_person', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])), +            ('address', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('address_complement', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('postal_code', self.gf('django.db.models.fields.CharField')(max_length=10, null=True, blank=True)), +            ('town', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('country', self.gf('django.db.models.fields.CharField')(max_length=30, null=True, blank=True)), +            ('phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('mobile_phone', self.gf('django.db.models.fields.CharField')(max_length=18, null=True, blank=True)), +            ('title', self.gf('django.db.models.fields.CharField')(max_length=2)), +            ('surname', self.gf('django.db.models.fields.CharField')(max_length=20)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), +            ('email', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)), +            ('person_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.PersonType'])), +            ('attached_to', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Organization'], null=True, blank=True)), +        )) +        db.send_create_signal('ishtar_common', ['Person']) + +        # Adding model 'IshtarUser' +        db.create_table('ishtar_common_ishtaruser', ( +            ('user_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True, primary_key=True)), +            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'], unique=True)), +        )) +        db.send_create_signal('ishtar_common', ['IshtarUser']) + +        # Adding model 'AuthorType' +        db.create_table('ishtar_common_authortype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('ishtar_common', ['AuthorType']) + +        # Adding model 'Author' +        db.create_table('ishtar_common_author', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('person', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])), +            ('author_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.AuthorType'])), +        )) +        db.send_create_signal('ishtar_common', ['Author']) + +        # Adding model 'SourceType' +        db.create_table('ishtar_common_sourcetype', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('label', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)), +            ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), +            ('available', self.gf('django.db.models.fields.BooleanField')(default=False)), +        )) +        db.send_create_signal('ishtar_common', ['SourceType']) + +        # Adding model 'Arrondissement' +        db.create_table('ishtar_common_arrondissement', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), +            ('department', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Department'])), +        )) +        db.send_create_signal('ishtar_common', ['Arrondissement']) + +        # Adding model 'Canton' +        db.create_table('ishtar_common_canton', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=30)), +            ('arrondissement', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Arrondissement'])), +        )) +        db.send_create_signal('ishtar_common', ['Canton']) + +        # Adding model 'Town' +        db.create_table('ishtar_common_town', ( +            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), +            ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), +            ('surface', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), +            ('center', self.gf('django.contrib.gis.db.models.fields.PointField')(srid=27572, null=True, blank=True)), +            ('numero_insee', self.gf('django.db.models.fields.CharField')(unique=True, max_length=6)), +            ('departement', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Department'], null=True, blank=True)), +            ('canton', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Canton'], null=True, blank=True)), +        )) +        db.send_create_signal('ishtar_common', ['Town']) + + +    def backwards(self, orm): +        # Deleting model 'Wizard' +        db.delete_table('ishtar_common_wizard') + +        # Deleting model 'WizardStep' +        db.delete_table('ishtar_common_wizardstep') + +        # Deleting model 'Department' +        db.delete_table('ishtar_common_department') + +        # Deleting model 'OrganizationType' +        db.delete_table('ishtar_common_organizationtype') + +        # Deleting model 'HistoricalOrganization' +        db.delete_table('ishtar_common_historicalorganization') + +        # Deleting model 'Organization' +        db.delete_table('ishtar_common_organization') + +        # Deleting model 'PersonType' +        db.delete_table('ishtar_common_persontype') + +        # Removing M2M table for field rights on 'PersonType' +        db.delete_table('ishtar_common_persontype_rights') + +        # Deleting model 'Person' +        db.delete_table('ishtar_common_person') + +        # Deleting model 'IshtarUser' +        db.delete_table('ishtar_common_ishtaruser') + +        # Deleting model 'AuthorType' +        db.delete_table('ishtar_common_authortype') + +        # Deleting model 'Author' +        db.delete_table('ishtar_common_author') + +        # Deleting model 'SourceType' +        db.delete_table('ishtar_common_sourcetype') + +        # Deleting model 'Arrondissement' +        db.delete_table('ishtar_common_arrondissement') + +        # Deleting model 'Canton' +        db.delete_table('ishtar_common_canton') + +        # Deleting model 'Town' +        db.delete_table('ishtar_common_town') + + +    models = { +        'auth.group': { +            'Meta': {'object_name': 'Group'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), +            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) +        }, +        'auth.permission': { +            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, +            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) +        }, +        'auth.user': { +            'Meta': {'object_name': 'User'}, +            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), +            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), +            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), +            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), +            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), +            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'contenttypes.contenttype': { +            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, +            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) +        }, +        'ishtar_common.arrondissement': { +            'Meta': {'object_name': 'Arrondissement'}, +            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.author': { +            'Meta': {'object_name': 'Author'}, +            'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}) +        }, +        'ishtar_common.authortype': { +            'Meta': {'object_name': 'AuthorType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.canton': { +            'Meta': {'object_name': 'Canton'}, +            'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) +        }, +        'ishtar_common.department': { +            'Meta': {'ordering': "['number']", 'object_name': 'Department'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) +        }, +        'ishtar_common.historicalorganization': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOrganization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), +            'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), +            'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), +            'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.ishtaruser': { +            'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, +            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']", 'unique': 'True'}), +            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) +        }, +        'ishtar_common.organization': { +            'Meta': {'object_name': 'Organization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.organizationtype': { +            'Meta': {'object_name': 'OrganizationType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.person': { +            'Meta': {'object_name': 'Person'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}), +            'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), +            'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), +            'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}), +            'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}), +            'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), +            'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}), +            'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.persontype': { +            'Meta': {'object_name': 'PersonType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.sourcetype': { +            'Meta': {'object_name': 'SourceType'}, +            'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), +            'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) +        }, +        'ishtar_common.town': { +            'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, +            'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), +            'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), +            'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), +            'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), +            'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.wizard': { +            'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) +        }, +        'ishtar_common.wizardstep': { +            'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'}, +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'order': ('django.db.models.fields.IntegerField', [], {}), +            'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), +            'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"}) +        } +    } + +    complete_apps = ['ishtar_common']
\ No newline at end of file diff --git a/ishtar_common/migrations/0002_auto__chg_field_person_surname.py b/ishtar_common/old_migrations/0002_auto__chg_field_person_surname.py index 105144aac..105144aac 100644 --- a/ishtar_common/migrations/0002_auto__chg_field_person_surname.py +++ b/ishtar_common/old_migrations/0002_auto__chg_field_person_surname.py diff --git a/ishtar_common/migrations/0003_auto__del_field_person_person_type.py b/ishtar_common/old_migrations/0003_auto__del_field_person_person_type.py index 369568ecc..369568ecc 100644 --- a/ishtar_common/migrations/0003_auto__del_field_person_person_type.py +++ b/ishtar_common/old_migrations/0003_auto__del_field_person_person_type.py diff --git a/ishtar_common/migrations/0004_auto.py b/ishtar_common/old_migrations/0004_auto.py index 074080757..074080757 100644 --- a/ishtar_common/migrations/0004_auto.py +++ b/ishtar_common/old_migrations/0004_auto.py diff --git a/ishtar_common/migrations/0005_auto__add_documenttemplate.py b/ishtar_common/old_migrations/0005_auto__add_documenttemplate.py index 383ee5a32..383ee5a32 100644 --- a/ishtar_common/migrations/0005_auto__add_documenttemplate.py +++ b/ishtar_common/old_migrations/0005_auto__add_documenttemplate.py diff --git a/ishtar_common/migrations/0006_auto__chg_field_organization_name__chg_field_historicalorganization_na.py b/ishtar_common/old_migrations/0006_auto__chg_field_organization_name__chg_field_historicalorganization_na.py index f852608a3..f852608a3 100644 --- a/ishtar_common/migrations/0006_auto__chg_field_organization_name__chg_field_historicalorganization_na.py +++ b/ishtar_common/old_migrations/0006_auto__chg_field_organization_name__chg_field_historicalorganization_na.py diff --git a/ishtar_common/migrations/0007_auto__add_field_organization_history_creator__add_field_historicalorga.py b/ishtar_common/old_migrations/0007_auto__add_field_organization_history_creator__add_field_historicalorga.py index 5423b758e..5423b758e 100644 --- a/ishtar_common/migrations/0007_auto__add_field_organization_history_creator__add_field_historicalorga.py +++ b/ishtar_common/old_migrations/0007_auto__add_field_organization_history_creator__add_field_historicalorga.py diff --git a/ishtar_common/migrations/0008_init_history_creator.py b/ishtar_common/old_migrations/0008_init_history_creator.py index c28292e61..c28292e61 100644 --- a/ishtar_common/migrations/0008_init_history_creator.py +++ b/ishtar_common/old_migrations/0008_init_history_creator.py diff --git a/ishtar_common/migrations/0009_auto__add_field_organization_email__add_field_historicalorganization_e.py b/ishtar_common/old_migrations/0009_auto__add_field_organization_email__add_field_historicalorganization_e.py index 1ef247b56..1ef247b56 100644 --- a/ishtar_common/migrations/0009_auto__add_field_organization_email__add_field_historicalorganization_e.py +++ b/ishtar_common/old_migrations/0009_auto__add_field_organization_email__add_field_historicalorganization_e.py diff --git a/ishtar_common/migrations/0010_auto__del_wizardstep__del_wizard__add_globalvar__chg_field_person_atta.py b/ishtar_common/old_migrations/0010_auto__del_wizardstep__del_wizard__add_globalvar__chg_field_person_atta.py index 4bba74da9..4bba74da9 100644 --- a/ishtar_common/migrations/0010_auto__del_wizardstep__del_wizard__add_globalvar__chg_field_person_atta.py +++ b/ishtar_common/old_migrations/0010_auto__del_wizardstep__del_wizard__add_globalvar__chg_field_person_atta.py diff --git a/ishtar_common/migrations/0011_auto__chg_field_person_surname__chg_field_person_name.py b/ishtar_common/old_migrations/0011_auto__chg_field_person_surname__chg_field_person_name.py index a21e00efb..a21e00efb 100644 --- a/ishtar_common/migrations/0011_auto__chg_field_person_surname__chg_field_person_name.py +++ b/ishtar_common/old_migrations/0011_auto__chg_field_person_surname__chg_field_person_name.py diff --git a/ishtar_common/migrations/0012_auto__add_field_person_raw_name__chg_field_person_name.py b/ishtar_common/old_migrations/0012_auto__add_field_person_raw_name__chg_field_person_name.py index 015956610..015956610 100644 --- a/ishtar_common/migrations/0012_auto__add_field_person_raw_name__chg_field_person_name.py +++ b/ishtar_common/old_migrations/0012_auto__add_field_person_raw_name__chg_field_person_name.py diff --git a/ishtar_common/migrations/0013_auto__add_field_organization_merge_key__add_field_historicalorganizati.py b/ishtar_common/old_migrations/0013_auto__add_field_organization_merge_key__add_field_historicalorganizati.py index b0934572d..b0934572d 100644 --- a/ishtar_common/migrations/0013_auto__add_field_organization_merge_key__add_field_historicalorganizati.py +++ b/ishtar_common/old_migrations/0013_auto__add_field_organization_merge_key__add_field_historicalorganizati.py diff --git a/ishtar_common/migrations/0014_auto__chg_field_organization_history_creator__chg_field_organization_h.py b/ishtar_common/old_migrations/0014_auto__chg_field_organization_history_creator__chg_field_organization_h.py index 86783b8fd..86783b8fd 100644 --- a/ishtar_common/migrations/0014_auto__chg_field_organization_history_creator__chg_field_organization_h.py +++ b/ishtar_common/old_migrations/0014_auto__chg_field_organization_history_creator__chg_field_organization_h.py diff --git a/ishtar_common/migrations/0015_auto__chg_field_organization_town__chg_field_historicalorganization_to.py b/ishtar_common/old_migrations/0015_auto__chg_field_organization_town__chg_field_historicalorganization_to.py index d5d1c4742..d5d1c4742 100644 --- a/ishtar_common/migrations/0015_auto__chg_field_organization_town__chg_field_historicalorganization_to.py +++ b/ishtar_common/old_migrations/0015_auto__chg_field_organization_town__chg_field_historicalorganization_to.py diff --git a/ishtar_common/migrations/0016_auto__add_import.py b/ishtar_common/old_migrations/0016_auto__add_import.py index f7d87ff13..f7d87ff13 100644 --- a/ishtar_common/migrations/0016_auto__add_import.py +++ b/ishtar_common/old_migrations/0016_auto__add_import.py diff --git a/ishtar_common/migrations/0017_auto__add_supporttype__add_format.py b/ishtar_common/old_migrations/0017_auto__add_supporttype__add_format.py index 7ce790321..7ce790321 100644 --- a/ishtar_common/migrations/0017_auto__add_supporttype__add_format.py +++ b/ishtar_common/old_migrations/0017_auto__add_supporttype__add_format.py diff --git a/ishtar_common/migrations/0018_auto__add_itemkey.py b/ishtar_common/old_migrations/0018_auto__add_itemkey.py index 4de340549..4de340549 100644 --- a/ishtar_common/migrations/0018_auto__add_itemkey.py +++ b/ishtar_common/old_migrations/0018_auto__add_itemkey.py diff --git a/ishtar_common/migrations/0019_auto__add_field_itemkey_importer.py b/ishtar_common/old_migrations/0019_auto__add_field_itemkey_importer.py index 9206279d1..9206279d1 100644 --- a/ishtar_common/migrations/0019_auto__add_field_itemkey_importer.py +++ b/ishtar_common/old_migrations/0019_auto__add_field_itemkey_importer.py diff --git a/ishtar_common/migrations/0020_auto__chg_field_person_title.py b/ishtar_common/old_migrations/0020_auto__chg_field_person_title.py index 8d4674ace..8d4674ace 100644 --- a/ishtar_common/migrations/0020_auto__chg_field_person_title.py +++ b/ishtar_common/old_migrations/0020_auto__chg_field_person_title.py diff --git a/ishtar_common/migrations/0021_auto__add_importerdefault__add_importertype__add_importtarget__add_for.py b/ishtar_common/old_migrations/0021_auto__add_importerdefault__add_importertype__add_importtarget__add_for.py index 21f6e5f78..21f6e5f78 100644 --- a/ishtar_common/migrations/0021_auto__add_importerdefault__add_importertype__add_importtarget__add_for.py +++ b/ishtar_common/old_migrations/0021_auto__add_importerdefault__add_importertype__add_importtarget__add_for.py diff --git a/ishtar_common/migrations/0022_auto__add_field_import_importer_type.py b/ishtar_common/old_migrations/0022_auto__add_field_import_importer_type.py index d5091b542..d5091b542 100644 --- a/ishtar_common/migrations/0022_auto__add_field_import_importer_type.py +++ b/ishtar_common/old_migrations/0022_auto__add_field_import_importer_type.py diff --git a/ishtar_common/migrations/0023_auto__add_importerdefaultvalues__del_field_importerdefault_value.py b/ishtar_common/old_migrations/0023_auto__add_importerdefaultvalues__del_field_importerdefault_value.py index 74c5e0a1c..74c5e0a1c 100644 --- a/ishtar_common/migrations/0023_auto__add_importerdefaultvalues__del_field_importerdefault_value.py +++ b/ishtar_common/old_migrations/0023_auto__add_importerdefaultvalues__del_field_importerdefault_value.py diff --git a/ishtar_common/migrations/0024_auto__add_importerduplicatefield__chg_field_importerdefault_target__ad.py b/ishtar_common/old_migrations/0024_auto__add_importerduplicatefield__chg_field_importerdefault_target__ad.py index d5d3293f0..d5d3293f0 100644 --- a/ishtar_common/migrations/0024_auto__add_importerduplicatefield__chg_field_importerdefault_target__ad.py +++ b/ishtar_common/old_migrations/0024_auto__add_importerduplicatefield__chg_field_importerdefault_target__ad.py diff --git a/ishtar_common/migrations/0025_auto__add_unique_formatertype_formater_type_many_split_options.py b/ishtar_common/old_migrations/0025_auto__add_unique_formatertype_formater_type_many_split_options.py index 73c88ce1a..73c88ce1a 100644 --- a/ishtar_common/migrations/0025_auto__add_unique_formatertype_formater_type_many_split_options.py +++ b/ishtar_common/old_migrations/0025_auto__add_unique_formatertype_formater_type_many_split_options.py diff --git a/ishtar_common/migrations/0026_auto__add_targetkey__add_unique_targetkey_target_value__add_field_impo.py b/ishtar_common/old_migrations/0026_auto__add_targetkey__add_unique_targetkey_target_value__add_field_impo.py index b4752a48e..b4752a48e 100644 --- a/ishtar_common/migrations/0026_auto__add_targetkey__add_unique_targetkey_target_value__add_field_impo.py +++ b/ishtar_common/old_migrations/0026_auto__add_targetkey__add_unique_targetkey_target_value__add_field_impo.py diff --git a/ishtar_common/migrations/0027_auto__chg_field_targetkey_target.py b/ishtar_common/old_migrations/0027_auto__chg_field_targetkey_target.py index d6ea7e10a..d6ea7e10a 100644 --- a/ishtar_common/migrations/0027_auto__chg_field_targetkey_target.py +++ b/ishtar_common/old_migrations/0027_auto__chg_field_targetkey_target.py diff --git a/ishtar_common/migrations/0028_auto__chg_field_targetkey_key__chg_field_targetkey_value.py b/ishtar_common/old_migrations/0028_auto__chg_field_targetkey_key__chg_field_targetkey_value.py index b99480a2b..b99480a2b 100644 --- a/ishtar_common/migrations/0028_auto__chg_field_targetkey_key__chg_field_targetkey_value.py +++ b/ishtar_common/old_migrations/0028_auto__chg_field_targetkey_key__chg_field_targetkey_value.py diff --git a/ishtar_common/migrations/0029_auto.py b/ishtar_common/old_migrations/0029_auto.py index 9bcf818b5..9bcf818b5 100644 --- a/ishtar_common/migrations/0029_auto.py +++ b/ishtar_common/old_migrations/0029_auto.py diff --git a/ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py b/ishtar_common/old_migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py index cd5d06576..cd5d06576 100644 --- a/ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py +++ b/ishtar_common/old_migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py diff --git a/ishtar_common/migrations/0031_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py b/ishtar_common/old_migrations/0031_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py index 7fddc0fca..7fddc0fca 100644 --- a/ishtar_common/migrations/0031_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py +++ b/ishtar_common/old_migrations/0031_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py diff --git a/ishtar_common/migrations/0033_auto__add_field_targetkey_associated_import__add_field_targetkey_assoc.py b/ishtar_common/old_migrations/0033_auto__add_field_targetkey_associated_import__add_field_targetkey_assoc.py index 2a6c8fc15..2a6c8fc15 100644 --- a/ishtar_common/migrations/0033_auto__add_field_targetkey_associated_import__add_field_targetkey_assoc.py +++ b/ishtar_common/old_migrations/0033_auto__add_field_targetkey_associated_import__add_field_targetkey_assoc.py diff --git a/ishtar_common/migrations/0034_auto__add_field_import_encoding.py b/ishtar_common/old_migrations/0034_auto__add_field_import_encoding.py index 2774b3c15..2774b3c15 100644 --- a/ishtar_common/migrations/0034_auto__add_field_import_encoding.py +++ b/ishtar_common/old_migrations/0034_auto__add_field_import_encoding.py diff --git a/ishtar_common/migrations/0035_auto__add_field_importtarget_force_new__add_field_importerduplicatefie.py b/ishtar_common/old_migrations/0035_auto__add_field_importtarget_force_new__add_field_importerduplicatefie.py index 2a396ee62..2a396ee62 100644 --- a/ishtar_common/migrations/0035_auto__add_field_importtarget_force_new__add_field_importerduplicatefie.py +++ b/ishtar_common/old_migrations/0035_auto__add_field_importtarget_force_new__add_field_importerduplicatefie.py diff --git a/ishtar_common/migrations/0036_auto__add_field_import_imported_images.py b/ishtar_common/old_migrations/0036_auto__add_field_import_imported_images.py index d0741abca..d0741abca 100644 --- a/ishtar_common/migrations/0036_auto__add_field_import_imported_images.py +++ b/ishtar_common/old_migrations/0036_auto__add_field_import_imported_images.py diff --git a/ishtar_common/migrations/0037_auto__add_field_importertype_slug.py b/ishtar_common/old_migrations/0037_auto__add_field_importertype_slug.py index c7bf06c5d..c7bf06c5d 100644 --- a/ishtar_common/migrations/0037_auto__add_field_importertype_slug.py +++ b/ishtar_common/old_migrations/0037_auto__add_field_importertype_slug.py diff --git a/ishtar_common/migrations/0038_auto__add_field_importtarget_comment.py b/ishtar_common/old_migrations/0038_auto__add_field_importtarget_comment.py index a2cbe1579..a2cbe1579 100644 --- a/ishtar_common/migrations/0038_auto__add_field_importtarget_comment.py +++ b/ishtar_common/old_migrations/0038_auto__add_field_importtarget_comment.py diff --git a/ishtar_common/migrations/0039_auto__add_field_import_match_file.py b/ishtar_common/old_migrations/0039_auto__add_field_import_match_file.py index 6df3e81a8..6df3e81a8 100644 --- a/ishtar_common/migrations/0039_auto__add_field_import_match_file.py +++ b/ishtar_common/old_migrations/0039_auto__add_field_import_match_file.py diff --git a/ishtar_common/migrations/0040_auto__chg_field_person_title.py b/ishtar_common/old_migrations/0040_auto__chg_field_person_title.py index 2623f9eae..2623f9eae 100644 --- a/ishtar_common/migrations/0040_auto__chg_field_person_title.py +++ b/ishtar_common/old_migrations/0040_auto__chg_field_person_title.py diff --git a/ishtar_common/migrations/0041_auto__add_field_importertype_unicity_keys__add_field_importtarget_conc.py b/ishtar_common/old_migrations/0041_auto__add_field_importertype_unicity_keys__add_field_importtarget_conc.py index 990f35efc..990f35efc 100644 --- a/ishtar_common/migrations/0041_auto__add_field_importertype_unicity_keys__add_field_importtarget_conc.py +++ b/ishtar_common/old_migrations/0041_auto__add_field_importertype_unicity_keys__add_field_importtarget_conc.py diff --git a/ishtar_common/migrations/0042_auto__add_field_importtarget_concat_str__add_unique_importercolumn_col.py b/ishtar_common/old_migrations/0042_auto__add_field_importtarget_concat_str__add_unique_importercolumn_col.py index 7f8bac846..7f8bac846 100644 --- a/ishtar_common/migrations/0042_auto__add_field_importtarget_concat_str__add_unique_importercolumn_col.py +++ b/ishtar_common/old_migrations/0042_auto__add_field_importtarget_concat_str__add_unique_importercolumn_col.py diff --git a/ishtar_common/migrations/0043_auto__add_field_importerduplicatefield_concat__add_field_importerdupli.py b/ishtar_common/old_migrations/0043_auto__add_field_importerduplicatefield_concat__add_field_importerdupli.py index efde90aca..efde90aca 100644 --- a/ishtar_common/migrations/0043_auto__add_field_importerduplicatefield_concat__add_field_importerdupli.py +++ b/ishtar_common/old_migrations/0043_auto__add_field_importerduplicatefield_concat__add_field_importerdupli.py diff --git a/ishtar_common/migrations/0044_auto__add_operationtype.py b/ishtar_common/old_migrations/0044_auto__add_operationtype.py index f623809de..f623809de 100644 --- a/ishtar_common/migrations/0044_auto__add_operationtype.py +++ b/ishtar_common/old_migrations/0044_auto__add_operationtype.py diff --git a/ishtar_common/migrations/0045_auto__chg_field_person_merge_key__chg_field_historicalorganization_mer.py b/ishtar_common/old_migrations/0045_auto__chg_field_person_merge_key__chg_field_historicalorganization_mer.py index 39114eba5..39114eba5 100644 --- a/ishtar_common/migrations/0045_auto__chg_field_person_merge_key__chg_field_historicalorganization_mer.py +++ b/ishtar_common/old_migrations/0045_auto__chg_field_person_merge_key__chg_field_historicalorganization_mer.py diff --git a/ishtar_common/migrations/0046_auto__add_field_person_exclude_from_merge__add_field_historicalorganiz.py b/ishtar_common/old_migrations/0046_auto__add_field_person_exclude_from_merge__add_field_historicalorganiz.py index e0dbc9222..e0dbc9222 100644 --- a/ishtar_common/migrations/0046_auto__add_field_person_exclude_from_merge__add_field_historicalorganiz.py +++ b/ishtar_common/old_migrations/0046_auto__add_field_person_exclude_from_merge__add_field_historicalorganiz.py diff --git a/ishtar_common/migrations/0047_auto__chg_field_person_exclude_from_merge__chg_field_historicalorganiz.py b/ishtar_common/old_migrations/0047_auto__chg_field_person_exclude_from_merge__chg_field_historicalorganiz.py index 4bc7b8a48..4bc7b8a48 100644 --- a/ishtar_common/migrations/0047_auto__chg_field_person_exclude_from_merge__chg_field_historicalorganiz.py +++ b/ishtar_common/old_migrations/0047_auto__chg_field_person_exclude_from_merge__chg_field_historicalorganiz.py diff --git a/ishtar_common/migrations/0048_auto__add_ishtarsiteprofile.py b/ishtar_common/old_migrations/0048_auto__add_ishtarsiteprofile.py index 5a2c21bf1..5a2c21bf1 100644 --- a/ishtar_common/migrations/0048_auto__add_ishtarsiteprofile.py +++ b/ishtar_common/old_migrations/0048_auto__add_ishtarsiteprofile.py diff --git a/ishtar_common/migrations/0049_auto__add_field_person_alt_address__add_field_person_alt_address_compl.py b/ishtar_common/old_migrations/0049_auto__add_field_person_alt_address__add_field_person_alt_address_compl.py index d64e3a964..d64e3a964 100644 --- a/ishtar_common/migrations/0049_auto__add_field_person_alt_address__add_field_person_alt_address_compl.py +++ b/ishtar_common/old_migrations/0049_auto__add_field_person_alt_address__add_field_person_alt_address_compl.py diff --git a/ishtar_common/migrations/0050_auto__chg_field_person_phone_desc3__chg_field_person_phone_desc2__chg_.py b/ishtar_common/old_migrations/0050_auto__chg_field_person_phone_desc3__chg_field_person_phone_desc2__chg_.py index b68b3b9bb..b68b3b9bb 100644 --- a/ishtar_common/migrations/0050_auto__chg_field_person_phone_desc3__chg_field_person_phone_desc2__chg_.py +++ b/ishtar_common/old_migrations/0050_auto__chg_field_person_phone_desc3__chg_field_person_phone_desc2__chg_.py diff --git a/ishtar_common/migrations/0051_auto__add_field_ishtarsiteprofile_homepage.py b/ishtar_common/old_migrations/0051_auto__add_field_ishtarsiteprofile_homepage.py index 7f8c65857..7f8c65857 100644 --- a/ishtar_common/migrations/0051_auto__add_field_ishtarsiteprofile_homepage.py +++ b/ishtar_common/old_migrations/0051_auto__add_field_ishtarsiteprofile_homepage.py diff --git a/ishtar_common/migrations/0052_auto__add_field_ishtarsiteprofile_file_external_id__add_field_ishtarsi.py b/ishtar_common/old_migrations/0052_auto__add_field_ishtarsiteprofile_file_external_id__add_field_ishtarsi.py index 7b902a432..7b902a432 100644 --- a/ishtar_common/migrations/0052_auto__add_field_ishtarsiteprofile_file_external_id__add_field_ishtarsi.py +++ b/ishtar_common/old_migrations/0052_auto__add_field_ishtarsiteprofile_file_external_id__add_field_ishtarsi.py diff --git a/ishtar_common/migrations/0053_auto__add_field_ishtarsiteprofile_currency.py b/ishtar_common/old_migrations/0053_auto__add_field_ishtarsiteprofile_currency.py index 04d293b04..04d293b04 100644 --- a/ishtar_common/migrations/0053_auto__add_field_ishtarsiteprofile_currency.py +++ b/ishtar_common/old_migrations/0053_auto__add_field_ishtarsiteprofile_currency.py diff --git a/ishtar_common/migrations/0054_auto__add_field_ishtarsiteprofile_person_raw_name.py b/ishtar_common/old_migrations/0054_auto__add_field_ishtarsiteprofile_person_raw_name.py index 06e380189..06e380189 100644 --- a/ishtar_common/migrations/0054_auto__add_field_ishtarsiteprofile_person_raw_name.py +++ b/ishtar_common/old_migrations/0054_auto__add_field_ishtarsiteprofile_person_raw_name.py diff --git a/ishtar_common/migrations/0055_auto.py b/ishtar_common/old_migrations/0055_auto.py index db41eb868..db41eb868 100644 --- a/ishtar_common/migrations/0055_auto.py +++ b/ishtar_common/old_migrations/0055_auto.py diff --git a/ishtar_common/migrations/0056_auto__add_titletype__add_field_person_pretitle.py b/ishtar_common/old_migrations/0056_auto__add_titletype__add_field_person_pretitle.py index 6db62c107..6db62c107 100644 --- a/ishtar_common/migrations/0056_auto__add_titletype__add_field_person_pretitle.py +++ b/ishtar_common/old_migrations/0056_auto__add_titletype__add_field_person_pretitle.py diff --git a/ishtar_common/migrations/0057_rename_pretitle_old_title.py b/ishtar_common/old_migrations/0057_rename_pretitle_old_title.py index 8a13b6c88..8a13b6c88 100644 --- a/ishtar_common/migrations/0057_rename_pretitle_old_title.py +++ b/ishtar_common/old_migrations/0057_rename_pretitle_old_title.py diff --git a/ishtar_common/migrations/0058_generate_title.py b/ishtar_common/old_migrations/0058_generate_title.py index d30850cab..d30850cab 100644 --- a/ishtar_common/migrations/0058_generate_title.py +++ b/ishtar_common/old_migrations/0058_generate_title.py diff --git a/ishtar_common/migrations/0059_rename_exc_from_merge_to_archived.py b/ishtar_common/old_migrations/0059_rename_exc_from_merge_to_archived.py index c329b76e2..c329b76e2 100644 --- a/ishtar_common/migrations/0059_rename_exc_from_merge_to_archived.py +++ b/ishtar_common/old_migrations/0059_rename_exc_from_merge_to_archived.py diff --git a/ishtar_common/migrations/0060_auto__add_historicalperson.py b/ishtar_common/old_migrations/0060_auto__add_historicalperson.py index a1db55c37..a1db55c37 100644 --- a/ishtar_common/migrations/0060_auto__add_historicalperson.py +++ b/ishtar_common/old_migrations/0060_auto__add_historicalperson.py diff --git a/ishtar_common/migrations/0061_auto__add_field_historicalperson_salutation__add_field_person_salutati.py b/ishtar_common/old_migrations/0061_auto__add_field_historicalperson_salutation__add_field_person_salutati.py index eb3b34a26..eb3b34a26 100644 --- a/ishtar_common/migrations/0061_auto__add_field_historicalperson_salutation__add_field_person_salutati.py +++ b/ishtar_common/old_migrations/0061_auto__add_field_historicalperson_salutation__add_field_person_salutati.py diff --git a/ishtar_common/migrations/0062_remove_ishtar_local_prefix.py b/ishtar_common/old_migrations/0062_remove_ishtar_local_prefix.py index b1406a111..b1406a111 100644 --- a/ishtar_common/migrations/0062_remove_ishtar_local_prefix.py +++ b/ishtar_common/old_migrations/0062_remove_ishtar_local_prefix.py diff --git a/ishtar_common/migrations/0063_auto__add_field_ishtaruser_advanced_shortcut_menu.py b/ishtar_common/old_migrations/0063_auto__add_field_ishtaruser_advanced_shortcut_menu.py index 19a076913..19a076913 100644 --- a/ishtar_common/migrations/0063_auto__add_field_ishtaruser_advanced_shortcut_menu.py +++ b/ishtar_common/old_migrations/0063_auto__add_field_ishtaruser_advanced_shortcut_menu.py diff --git a/ishtar_common/migrations/0064_auto__add_field_importercolumn_label.py b/ishtar_common/old_migrations/0064_auto__add_field_importercolumn_label.py index 2f2b6efcc..2f2b6efcc 100644 --- a/ishtar_common/migrations/0064_auto__add_field_importercolumn_label.py +++ b/ishtar_common/old_migrations/0064_auto__add_field_importercolumn_label.py diff --git a/ishtar_common/migrations/0065_auto__add_spatialreferencesystem__add_field_ishtarsiteprofile_mapping.py b/ishtar_common/old_migrations/0065_auto__add_spatialreferencesystem__add_field_ishtarsiteprofile_mapping.py index 2c1dc8a49..2c1dc8a49 100644 --- a/ishtar_common/migrations/0065_auto__add_spatialreferencesystem__add_field_ishtarsiteprofile_mapping.py +++ b/ishtar_common/old_migrations/0065_auto__add_spatialreferencesystem__add_field_ishtarsiteprofile_mapping.py diff --git a/ishtar_common/migrations/0066_auto__add_field_ishtarsiteprofile_base_color__add_field_ishtarsiteprof.py b/ishtar_common/old_migrations/0066_auto__add_field_ishtarsiteprofile_base_color__add_field_ishtarsiteprof.py index 16baf8881..16baf8881 100644 --- a/ishtar_common/migrations/0066_auto__add_field_ishtarsiteprofile_base_color__add_field_ishtarsiteprof.py +++ b/ishtar_common/old_migrations/0066_auto__add_field_ishtarsiteprofile_base_color__add_field_ishtarsiteprof.py diff --git a/ishtar_common/migrations/0067_auto__add_field_ishtarsiteprofile_container_external_id__add_field_ish.py b/ishtar_common/old_migrations/0067_auto__add_field_ishtarsiteprofile_container_external_id__add_field_ish.py index 2bff66138..2bff66138 100644 --- a/ishtar_common/migrations/0067_auto__add_field_ishtarsiteprofile_container_external_id__add_field_ish.py +++ b/ishtar_common/old_migrations/0067_auto__add_field_ishtarsiteprofile_container_external_id__add_field_ish.py diff --git a/ishtar_common/migrations/0068_auto__add_field_spatialreferencesystem_auth_name.py b/ishtar_common/old_migrations/0068_auto__add_field_spatialreferencesystem_auth_name.py index a7f83884d..a7f83884d 100644 --- a/ishtar_common/migrations/0068_auto__add_field_spatialreferencesystem_auth_name.py +++ b/ishtar_common/old_migrations/0068_auto__add_field_spatialreferencesystem_auth_name.py diff --git a/ishtar_common/migrations/0069_auto__chg_field_import_error_file__chg_field_import_match_file__chg_fi.py b/ishtar_common/old_migrations/0069_auto__chg_field_import_error_file__chg_field_import_match_file__chg_fi.py index 1fbccf642..1fbccf642 100644 --- a/ishtar_common/migrations/0069_auto__chg_field_import_error_file__chg_field_import_match_file__chg_fi.py +++ b/ishtar_common/old_migrations/0069_auto__chg_field_import_error_file__chg_field_import_match_file__chg_fi.py diff --git a/ishtar_common/migrations/0070_auto__add_importermodel__add_field_importertype_new_associated_models.py b/ishtar_common/old_migrations/0070_auto__add_importermodel__add_field_importertype_new_associated_models.py index b78e71bbf..b78e71bbf 100644 --- a/ishtar_common/migrations/0070_auto__add_importermodel__add_field_importertype_new_associated_models.py +++ b/ishtar_common/old_migrations/0070_auto__add_importermodel__add_field_importertype_new_associated_models.py diff --git a/ishtar_common/migrations/0071_migrate_importermodels.py b/ishtar_common/old_migrations/0071_migrate_importermodels.py index cc9b6f449..cc9b6f449 100644 --- a/ishtar_common/migrations/0071_migrate_importermodels.py +++ b/ishtar_common/old_migrations/0071_migrate_importermodels.py diff --git a/ishtar_common/migrations/0072_auto__del_field_importertype_new_associated_models__chg_field_importer.py b/ishtar_common/old_migrations/0072_auto__del_field_importertype_new_associated_models__chg_field_importer.py index 9d1c9f55c..9d1c9f55c 100644 --- a/ishtar_common/migrations/0072_auto__del_field_importertype_new_associated_models__chg_field_importer.py +++ b/ishtar_common/old_migrations/0072_auto__del_field_importertype_new_associated_models__chg_field_importer.py diff --git a/ishtar_common/migrations/0073_auto__add_field_importercolumn_export_field_name.py b/ishtar_common/old_migrations/0073_auto__add_field_importercolumn_export_field_name.py index a2b5ed719..a2b5ed719 100644 --- a/ishtar_common/migrations/0073_auto__add_field_importercolumn_export_field_name.py +++ b/ishtar_common/old_migrations/0073_auto__add_field_importercolumn_export_field_name.py diff --git a/ishtar_common/migrations/0074_auto__add_field_import_name.py b/ishtar_common/old_migrations/0074_auto__add_field_import_name.py index 8374ce83f..8374ce83f 100644 --- a/ishtar_common/migrations/0074_auto__add_field_import_name.py +++ b/ishtar_common/old_migrations/0074_auto__add_field_import_name.py diff --git a/ishtar_common/migrations/0075_auto__add_field_authortype_order.py b/ishtar_common/old_migrations/0075_auto__add_field_authortype_order.py index e768e57de..e768e57de 100644 --- a/ishtar_common/migrations/0075_auto__add_field_authortype_order.py +++ b/ishtar_common/old_migrations/0075_auto__add_field_authortype_order.py diff --git a/ishtar_common/migrations/0076_auto__add_field_ishtarsiteprofile_find_index.py b/ishtar_common/old_migrations/0076_auto__add_field_ishtarsiteprofile_find_index.py index 84bf5f971..84bf5f971 100644 --- a/ishtar_common/migrations/0076_auto__add_field_ishtarsiteprofile_find_index.py +++ b/ishtar_common/old_migrations/0076_auto__add_field_ishtarsiteprofile_find_index.py diff --git a/ishtar_common/old_migrations/__init__.py b/ishtar_common/old_migrations/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ishtar_common/old_migrations/__init__.py diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index b142c70c7..75e0e3740 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -1,4 +1,4 @@ -{% load i18n %}{% load url from future %}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +{% load i18n %}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{LANGUAGE_CODE}}" lang="{{LANGUAGE_CODE}}"> diff --git a/ishtar_common/templates/blocks/JQueryAdvancedTown.html b/ishtar_common/templates/blocks/JQueryAdvancedTown.html index 5d6d93f30..b74bb6b68 100644 --- a/ishtar_common/templates/blocks/JQueryAdvancedTown.html +++ b/ishtar_common/templates/blocks/JQueryAdvancedTown.html @@ -1,4 +1,4 @@ -{% load i18n %}{% load url from future %}</td></tr> +{% load i18n %}</td></tr>  <tr>    <td>{% trans "State" context "Region" %}</td>    <td> diff --git a/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html index 5cea8b5a7..cd7bf88f8 100644 --- a/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/advanced_shortcut_menu.html @@ -1,5 +1,4 @@  {% load i18n %} -{% load url from future%}  {% if menu %}  <form method="post" action="{% url 'update-current-item' %}">  <fieldset id='shortcut-menu'> diff --git a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html index c03cb3806..67f91dfea 100644 --- a/ishtar_common/templates/ishtar/blocks/shortcut_menu.html +++ b/ishtar_common/templates/ishtar/blocks/shortcut_menu.html @@ -1,5 +1,4 @@  {% load i18n %} -{% load url from future%}  {% if current_menu %}  <form method="post" action="{% url 'update-current-item' %}">  <fieldset id="shortcut-menu"> diff --git a/ishtar_common/templates/ishtar/blocks/window_nav.html b/ishtar_common/templates/ishtar/blocks/window_nav.html index 3c52063f4..f212ebff6 100644 --- a/ishtar_common/templates/ishtar/blocks/window_nav.html +++ b/ishtar_common/templates/ishtar/blocks/window_nav.html @@ -1,4 +1,3 @@ -{% load url from future %}  {% load i18n %}  {% if previous or next %}    <div class='tool-right'> diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html index 6a5a67a63..ed61d1265 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main.html @@ -1,6 +1,5 @@  {% extends "base.html" %}  {% load i18n %} -{% load url from future %}  {% block extra_head %}  {{form.media}}  <script language="javascript" type="text/javascript" src="{{STATIC_URL}}js/jqplot/jquery.jqplot.min.js?ver={{VERSION}}"></script> diff --git a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html index 2650282ca..5ebb05af4 100644 --- a/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html +++ b/ishtar_common/templates/ishtar/dashboards/dashboard_main_detail.html @@ -1,5 +1,4 @@  {% load i18n date_formating humanize %} -{% load url from future %}  <div class='dashboard' id="{{unique_id}}-tab">    <div>      <h4>{% trans "Numbers" %}</h4> diff --git a/ishtar_common/templates/ishtar/import_delete.html b/ishtar_common/templates/ishtar/import_delete.html index 4b48ebc8c..ef05a884c 100644 --- a/ishtar_common/templates/ishtar/import_delete.html +++ b/ishtar_common/templates/ishtar/import_delete.html @@ -1,6 +1,5 @@  {% extends "base.html" %}  {% load i18n inline_formset verbose_names %} -{% load url from future %}  {% block content %}  <h2>{{page_name}}</h2>  <div class='form'> diff --git a/ishtar_common/templates/ishtar/import_list.html b/ishtar_common/templates/ishtar/import_list.html index 5dba51b6f..d5747fe88 100644 --- a/ishtar_common/templates/ishtar/import_list.html +++ b/ishtar_common/templates/ishtar/import_list.html @@ -1,6 +1,5 @@  {% extends "base.html" %}  {% load i18n inline_formset %} -{% load url from future %}  {% block content %}  <h2>{{page_name}}</h2>  <div class='form'> diff --git a/ishtar_common/templates/ishtar/manage_basket.html b/ishtar_common/templates/ishtar/manage_basket.html index a6065a7c2..3292318ea 100644 --- a/ishtar_common/templates/ishtar/manage_basket.html +++ b/ishtar_common/templates/ishtar/manage_basket.html @@ -1,6 +1,5 @@  {% extends "base.html" %}  {% load i18n inline_formset %} -{% load url from future %}  {% block content %}  <h2>{{page_name}}{% trans ":"%} {{basket}}</h2>  <form enctype="multipart/form-data" action="." method="post">{% csrf_token %} diff --git a/ishtar_common/templates/ishtar/merge.html b/ishtar_common/templates/ishtar/merge.html index 0e15da62a..de46e95c6 100644 --- a/ishtar_common/templates/ishtar/merge.html +++ b/ishtar_common/templates/ishtar/merge.html @@ -1,5 +1,4 @@  {% extends "base.html" %} -{% load url from future %}  {% load i18n inline_formset %}  {% block content %}  <h2>{% trans "Merge" %}</h2> diff --git a/ishtar_common/templates/ishtar/merge_organization.html b/ishtar_common/templates/ishtar/merge_organization.html index 87eab7d53..10730e8c5 100644 --- a/ishtar_common/templates/ishtar/merge_organization.html +++ b/ishtar_common/templates/ishtar/merge_organization.html @@ -1,5 +1,4 @@  {% extends "ishtar/merge.html" %} -{% load url from future %}  {% block merge_field_row %}        {% if form.non_field_errors %}<tr><td colspan='4'></td><td colspan='3' class='errorlist'>{% for error in form.non_field_errors %}{{error}} {% endfor%}</tr>{% endif %}        <tr> diff --git a/ishtar_common/templates/ishtar/merge_person.html b/ishtar_common/templates/ishtar/merge_person.html index 4e76c804b..0d03112c5 100644 --- a/ishtar_common/templates/ishtar/merge_person.html +++ b/ishtar_common/templates/ishtar/merge_person.html @@ -1,5 +1,4 @@  {% extends "ishtar/merge.html" %} -{% load url from future %}  {% block merge_field_row %}        {% if form.non_field_errors %}<tr><td colspan='4'></td><td colspan='3' class='errorlist'>{% for error in form.non_field_errors %}{{error}} {% endfor%}</tr>{% endif %}        <tr> diff --git a/ishtar_common/templates/ishtar/organization_form.html b/ishtar_common/templates/ishtar/organization_form.html index 21d5ffa9e..828023908 100644 --- a/ishtar_common/templates/ishtar/organization_form.html +++ b/ishtar_common/templates/ishtar/organization_form.html @@ -1,4 +1,4 @@ -{% load i18n %}{% load url from future %} +{% load i18n %}  <div id='orga-form'>  <form id='dyn-form-organization' method='post'>  {% csrf_token %} diff --git a/ishtar_common/templates/ishtar/organization_person_form.html b/ishtar_common/templates/ishtar/organization_person_form.html index 46f2cdc15..e258441b3 100644 --- a/ishtar_common/templates/ishtar/organization_person_form.html +++ b/ishtar_common/templates/ishtar/organization_person_form.html @@ -1,4 +1,4 @@ -{% load i18n %}{% load url from future %} +{% load i18n %}  <div id='orga-person-form'>  <form id='dyn-form-person' method='post'>  {% csrf_token %} diff --git a/ishtar_common/templates/ishtar/person_form.html b/ishtar_common/templates/ishtar/person_form.html index 555aa1a5f..10a49cd52 100644 --- a/ishtar_common/templates/ishtar/person_form.html +++ b/ishtar_common/templates/ishtar/person_form.html @@ -1,4 +1,4 @@ -{% load i18n %}{% load url from future %} +{% load i18n %}  <div id='person-form'>  <form id='dyn-form-person' method='post'>  {% csrf_token %} diff --git a/ishtar_common/templates/ishtar/sheet_organization.html b/ishtar_common/templates/ishtar/sheet_organization.html index 66048095b..525b69325 100644 --- a/ishtar_common/templates/ishtar/sheet_organization.html +++ b/ishtar_common/templates/ishtar/sheet_organization.html @@ -28,7 +28,7 @@      <td class='string'>{{person.name|default:""}}</td>      <td class='string'>{{person.surname|default:""}}</td>      <td>{% for type in person.person_types.all %}{% if forloop.counter0 %}, {% endif %}{{type.label}}{% endfor %}</td> -    <td class='link'><a class='display_details' href="#" onclick='load_window("{%url show-person person.pk ''%}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td> +    <td class='link'><a class='display_details' href="#" onclick='load_window("{% url "show-person" person.pk "" %}")'><i class="fa fa-info-circle" aria-hidden="true"></i></a></td>    </tr>    {% empty %}    <tr><td colspan="8" class='no_items'>{% trans "No person in this organization" %}</td></tr> diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html index 244ca1be3..24477ce2c 100644 --- a/ishtar_common/templates/ishtar/sheet_source.html +++ b/ishtar_common/templates/ishtar/sheet_source.html @@ -19,8 +19,8 @@  {% field_li "Source type" item.source_type %}  {% field_li "Format type" item.format_type %}  {% field_li "Scale" item.scale %} -    {% trans "Web link" as weblink_label %} -    {% field_li_url weblink_label item.associated_url %} +{% trans "Web link" as weblink_label %} +{% field_li_url weblink_label item.associated_url %}  {% field_li "Item number" item.item_number %}  {% field_li "Ref." item.reference %}  {% field_li "Internal ref." item.internal_reference %} diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html index 204feeebe..19076b0de 100644 --- a/ishtar_common/templates/ishtar/wizard/default_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html @@ -1,6 +1,5 @@  {% extends "base.html" %}  {% load i18n range table_form %} -{% load url from future %}  {% block extra_head %}  {{form.media}}  {% endblock %} diff --git a/ishtar_common/templates/ishtar/wizard/validation_bar.html b/ishtar_common/templates/ishtar/wizard/validation_bar.html index a1590858f..b99b9e689 100644 --- a/ishtar_common/templates/ishtar/wizard/validation_bar.html +++ b/ishtar_common/templates/ishtar/wizard/validation_bar.html @@ -1,5 +1,4 @@  {% load i18n %} -{% load url from future %}  <div id='validation-bar'>      <input type="submit" id="submit_form" name='validate' value="{% trans 'Validate' %}"/>      {% if last_step_is_available and next_steps %} diff --git a/ishtar_common/templates/registration/activation_complete.html b/ishtar_common/templates/registration/activation_complete.html index b243d22f2..7db8c186e 100644 --- a/ishtar_common/templates/registration/activation_complete.html +++ b/ishtar_common/templates/registration/activation_complete.html @@ -1,5 +1,4 @@  {% extends "base.html" %} -{% load url from future %}  {% load i18n %}  {% block content %} diff --git a/ishtar_common/templates/registration/login.html b/ishtar_common/templates/registration/login.html index ada4f6aa9..e8122f150 100644 --- a/ishtar_common/templates/registration/login.html +++ b/ishtar_common/templates/registration/login.html @@ -13,7 +13,7 @@  </form>  </div>  <div class='info'> -<p>{% trans "Forgot password?" %} <a href="{% url auth_password_reset %}">{% trans "Reset it" %}</a></p> -<p>{% trans "Not member?" %} <a href="{% url registration_register %}">{% trans "Register" %}</a></p> +<p>{% trans "Forgot password?" %} <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a></p> +<p>{% trans "Not member?" %} <a href="{% url 'registration_register' %}">{% trans "Register" %}</a></p>  </div>  {% endblock %} diff --git a/ishtar_common/templates/welcome.html b/ishtar_common/templates/welcome.html index 508f7be02..4b9f3b5c5 100644 --- a/ishtar_common/templates/welcome.html +++ b/ishtar_common/templates/welcome.html @@ -1,5 +1,4 @@  {% load i18n %} -{% load url from future %}  <h2>{% trans "Welcome in Ishtar, open source software for management and inventory of archaeological data" %}</h2>  {{random_image}} diff --git a/ishtar_common/templatetags/link_to_window.py b/ishtar_common/templatetags/link_to_window.py index 14e4bd6c7..f157b6255 100644 --- a/ishtar_common/templatetags/link_to_window.py +++ b/ishtar_common/templatetags/link_to_window.py @@ -60,12 +60,16 @@ def add_links(items, extra_attr=''):                          takes_context=True)  def modify_toolbar(context, item, action):      request = context.get('request') -    items_by_idx = request.session['MENU'].items_by_idx.keys() +    menu = context.get('MENU', None) +    print("TODO: link_to_window - check") +    if not menu: +        return {} +    items_by_idx = menu.items_by_idx.keys()      if action not in items_by_idx:          return {} -    menu = request.session['MENU'].items_by_idx[action] +    action = menu.items_by_idx[action]      user = request.user      if not hasattr(user, 'ishtaruser') or \ -            not menu.is_available(user.ishtaruser, item): +            not action.is_available(user.ishtaruser, item):          return {}      return {'item': item} diff --git a/ishtar_common/templatetags/window_field.py b/ishtar_common/templatetags/window_field.py index 5180955d8..022986493 100644 --- a/ishtar_common/templatetags/window_field.py +++ b/ishtar_common/templatetags/window_field.py @@ -25,10 +25,8 @@ def field_li(caption, data, pre_data='', post_data=''):  def field_url(caption, link, link_name='', li=False):      if link:          link = link.strip() -    if not link: -        return u'' -    if not link.startswith('http://') and not link.startswith('https://'): -        link = 'http://' + link +        if not link.startswith('http://') and not link.startswith('https://'): +            link = 'http://' + link      return {'caption': caption, 'link': link, "link_name": link_name, 'li': li} diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 536d6d4a8..464960b3a 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -27,59 +27,37 @@ from django.contrib.contenttypes.models import ContentType  from django.core.cache import cache  from django.core.exceptions import ValidationError  from django.core.files.base import File as DjangoFile -from django.core.files.uploadedfile import SimpleUploadedFile  from django.core.management import call_command  from django.core.urlresolvers import reverse -from django.db import connection, transaction  from django.template.defaultfilters import slugify  from django.test import TestCase as BaseTestCase  from django.test.client import Client -from django.test.simple import DjangoTestSuiteRunner +from django.test.runner import DiscoverRunner  from ishtar_common import models -from ishtar_common import forms_common +from ishtar_common import views  from ishtar_common.utils import post_save_point -from archaeological_context_records.models import CRBulkView -from archaeological_finds.models import BFBulkView, FBulkView, FirstBaseFindView - -""" -from django.conf import settings -import tempfile, datetime -from zipfile import ZipFile, ZIP_DEFLATED - -from oook_replace.oook_replace import oook_replace - -class OOOGenerationTest(TestCase): -    def testGeneration(self): -        context = {'test_var':u"Testé", 'test_var2':u"", -                   "test_date":datetime.date(2015, 1, 1)} -        tmp = tempfile.TemporaryFile() -        oook_replace("../ishtar_common/tests/test-file.odt", tmp, context) -        inzip = ZipFile(tmp, 'r', ZIP_DEFLATED) -        value = inzip.read('content.xml') -        self.assertTrue(u"Testé" in value or "Testé" in value) -        self.assertTrue("testé 2" not in value and "testé 2" not in value) -        self.assertTrue("2015" in value) -        lg, ct = settings.LANGUAGE_CODE.split('-') -        if lg == 'fr': -            self.assertTrue('janvier' in value) -        if lg == 'en': -            self.assertTrue('january' in value) -""" -  def create_superuser():      username = 'username4277'      password = 'dcbqj756456!@%' +    q = User.objects.filter(username=username) +    if q.count(): +        return username, password, q.all()[0]      user = User.objects.create_superuser(username, "nomail@nomail.com",                                           password) +    user.set_password(password) +    user.save()      return username, password, user  def create_user():      username = 'username678' -    password = 'dcbqj756456!@%' +    password = 'dcbqj756aaa456!@%' +    q = User.objects.filter(username=username) +    if q.count(): +        return username, password, q.all()[0]      user = User.objects.create_user(username, email="nomail2@nomail.com")      user.set_password(password)      user.save() @@ -87,14 +65,7 @@ def create_user():  class TestCase(BaseTestCase): -    def _pre_setup(self): -        super(TestCase, self)._pre_setup() -        if settings.USE_SPATIALITE_FOR_TESTS: -            return -        c = connection.cursor() -        for view in [CRBulkView, FirstBaseFindView, BFBulkView, FBulkView]: -            c.execute(view.CREATE_SQL) -            transaction.commit_unless_managed() +    pass  class CommandsTestCase(TestCase): @@ -117,7 +88,7 @@ class WizardTestFormData(object):      """      Test set to simulate wizard steps      """ -    def __init__(self, name, form_datas, ignored=[], pre_tests=[], +    def __init__(self, name, form_datas={}, ignored=[], pre_tests=[],                   extra_tests=[]):          """          :param name: explicit name of the test @@ -144,6 +115,8 @@ class WizardTestFormData(object):          :param value: value          :return: None          """ +        if form_name not in self.form_datas: +            self.form_datas[form_name] = {}          self.form_datas[form_name][field_name] = value      def append(self, form_name, value): @@ -154,6 +127,8 @@ class WizardTestFormData(object):          :param value: value          :return: None          """ +        if form_name not in self.form_datas: +            self.form_datas[form_name] = {}          self.form_datas[form_name].append(value)      def inits(self, test_object): @@ -167,7 +142,6 @@ class WizardTestFormData(object):              if suffix in form_name:                  continue              self.form_datas[form_name + suffix] = self.form_datas.pop(form_name) -          for pre in self.pre_tests:              pre(test_object) @@ -179,15 +153,15 @@ class WizardTestFormData(object):              test(test_object, final_step_response) -class ManagedModelTestRunner(DjangoTestSuiteRunner): +class ManagedModelTestRunner(DiscoverRunner):      """      Test runner that automatically makes all unmanaged models in your Django      project managed for the duration of the test run, so that one doesn't need      to execute the SQL manually to create them.      """      def setup_test_environment(self, *args, **kwargs): -        from django.db.models.loading import get_models -        self.unmanaged_models = [m for m in get_models() +        from django.apps import apps +        self.unmanaged_models = [m for m in apps.get_models()                                   if not m._meta.managed]          for m in self.unmanaged_models:              m._meta.managed = True @@ -268,8 +242,8 @@ class WizardTest(object):                  next_form_is_checked = len(self.steps) > idx + 1 and \                      self.steps[idx + 1][0] not in ignored                  try: -                    response = self.client.post(url, data, -                                                follow=not next_form_is_checked) +                    response = self.client.post( +                        url, data, follow=not next_form_is_checked)                  except ValidationError as e:                      msg = u"Errors: {} on {}. On \"ManagementForm data is " \                            u"missing or...\" error verify the wizard_name or " \ @@ -332,8 +306,15 @@ class AccessControlTest(TestCase):          user, created = User.objects.get_or_create(username='myusername')          user.is_superuser = True          user.save() -        ishtar_user = models.IshtarUser.objects.get(username=user.username) +        ishtar_user = models.IshtarUser.objects.get( +            user_ptr__username='myusername')          self.assertIn(admin, ishtar_user.person.person_types.all()) +        user = ishtar_user.user_ptr +        user.is_superuser = False +        user.save() +        ishtar_user = models.IshtarUser.objects.get( +            user_ptr__username='myusername') +        self.assertNotIn(admin, ishtar_user.person.person_types.all())  class AdminGenTypeTest(TestCase): @@ -356,11 +337,14 @@ class AdminGenTypeTest(TestCase):      module_name = 'ishtar_common'      def setUp(self): -        password = 'mypassword' -        my_admin = User.objects.create_superuser( -            'myuser', 'myemail@test.com', password) +        self.password = 'mypassword' +        self.username = "myuser" +        user = User.objects.create_superuser( +            self.username, 'myemail@test.com', self.password) +        user.set_password(self.password) +        user.save()          self.client = Client() -        self.client.login(username=my_admin.username, password=password) +        self.client.login(username=self.username, password=self.password)      def test_listing_and_detail(self):          for model in self.models: @@ -736,7 +720,8 @@ class ShortMenuTest(TestCase):      def test_treatment_file(self):          c = Client()          c.login(username=self.username, password=self.password) -        from archaeological_finds.models import TreatmentFile, TreatmentFileType +        from archaeological_finds.models import TreatmentFile, \ +            TreatmentFileType          tf = TreatmentFile.objects.create(              type=TreatmentFileType.objects.create(),              year=2050 @@ -992,11 +977,12 @@ class IshtarSiteProfileTest(TestCase):  class IshtarBasicTest(TestCase):      def setUp(self): -        password = 'mypassword' -        my_admin = User.objects.create_superuser( -            'myuser', 'myemail@test.com', password) +        self.password = 'mypassword' +        self.my_admin = User.objects.create_superuser( +            'myuser', 'myemail@test.com', self.password)          self.client = Client() -        self.client.login(username=my_admin.username, password=password) +        self.client.login(username=self.my_admin.username, +                          password=self.password)      def test_status(self):          response = self.client.get(reverse('status')) @@ -1009,6 +995,34 @@ class IshtarBasicTest(TestCase):          person.save()          self.assertEqual(person.raw_name, "WEASLEY George") +    def test_show(self): +        person = models.Person.objects.create(name="Weasley", surname="Bill") +        orga_type = models.OrganizationType.objects.create( +            txt_idx='test', label='testy') +        company = models.Organization.objects.create( +            history_modifier=self.my_admin, name='Franquin Comp.', +            organization_type=orga_type) +        c = Client() + +        response = c.get(reverse('show-person', kwargs={'pk': person.pk})) +        self.assertEqual(response.status_code, 200) +        # empty content when not allowed +        self.assertEqual(response.content, "") +        response = c.get(reverse('show-organization', +                                 kwargs={'pk': company.pk})) +        self.assertEqual(response.status_code, 200) +        # empty content when not allowed +        self.assertEqual(response.content, "") + +        c.login(username=self.my_admin.username, password=self.password) +        response = c.get(reverse('show-person', kwargs={'pk': person.pk})) +        self.assertEqual(response.status_code, 200) +        self.assertIn('class="sheet"', response.content) +        response = c.get(reverse('show-organization', +                                 kwargs={'pk': company.pk})) +        self.assertEqual(response.status_code, 200) +        self.assertIn('class="sheet"', response.content) +  class GeomaticTest(TestCase):      def test_post_save_point(self): @@ -1035,3 +1049,44 @@ class GeomaticTest(TestCase):          post_save_point(None, instance=obj)          self.assertIsNotNone(obj.point_2d)          self.assertIsNotNone(obj.point) + + +class AccountWizardTest(WizardTest, TestCase): +    fixtures = [settings.ROOT_PATH + +                '../fixtures/initial_data-auth-fr.json', +                settings.ROOT_PATH + +                '../ishtar_common/fixtures/initial_data-fr.json',] +    url_name = 'account_management' +    wizard_name = 'account_wizard' +    steps = views.account_wizard_steps +    form_datas = [ +        WizardTestFormData( +            "Add an account", +            form_datas={ +                'account': { +                    'username': "My username", +                    'email': "test@example.com", +                    'hidden_password': "my_pass", +                    'hidden_password_confirm': "my_pass", +                } +            }, +        ), +    ] + +    def pre_wizard(self): +        self.person = models.Person.objects.create( +            name='Boule', surname=' ', +        ) +        self.form_datas[0].set('selec', 'pk', self.person.pk) +        self.form_datas[0].set('account', 'pk', self.person.pk) + +        self.account_number = models.IshtarUser.objects.count() +        super(AccountWizardTest, self).pre_wizard() + +    def post_wizard(self): +        person = models.Person.objects.get(pk=self.person.pk) +        user = person.ishtaruser.user_ptr +        self.assertEqual(user.username, "My username") +        self.assertEqual(user.email, "test@example.com") +        self.assertEqual(models.IshtarUser.objects.count(), +                         self.account_number + 1) diff --git a/ishtar_common/tests/old.odt b/ishtar_common/tests/old.odt Binary files differnew file mode 100644 index 000000000..4d13ac834 --- /dev/null +++ b/ishtar_common/tests/old.odt diff --git a/ishtar_common/urls.py b/ishtar_common/urls.py index 5abec4215..163fedeb9 100644 --- a/ishtar_common/urls.py +++ b/ishtar_common/urls.py @@ -18,9 +18,9 @@  # See the file COPYING for details.  from django.conf import settings -from django.conf.urls.defaults import patterns, include, url +from django.conf.urls import patterns, include, url  from django.conf.urls.static import static -from django.views.generic.simple import direct_to_template +from django.views.generic import TemplateView  from menus import menu @@ -33,8 +33,8 @@ from ishtar_common.wizards import check_rights  urlpatterns = patterns(      '',      url(r'^status/$', views.status, name='status'), -    url(r'^robots\.txt$', direct_to_template, -        {'template': 'robots.txt', 'mimetype': 'text/plain'}), +    url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', +                                               content_type='text/plain')),      # internationalization      url(r'^i18n/', include('django.conf.urls.i18n')),      # General diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index f1e2e4b96..19ff16394 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -20,6 +20,7 @@  from functools import wraps  import hashlib  import random +import datetime  from django import forms  from django.conf import settings @@ -31,6 +32,24 @@ from django.utils.translation import ugettext_lazy as _, ugettext  from django.template.defaultfilters import slugify +class BColors: +    """ +    Bash colors. Don't forget to finish your colored string with ENDC. +    """ +    HEADER = '\033[95m' +    OKBLUE = '\033[94m' +    OKGREEN = '\033[92m' +    WARNING = '\033[93m' +    FAIL = '\033[91m' +    ENDC = '\033[0m' +    BOLD = '\033[1m' +    UNDERLINE = '\033[4m' + + +def get_current_year(): +    return datetime.datetime.now().year + +  def get_cache(cls, extra_args=[]):      cache_key = u"{}-{}-{}".format(          settings.PROJECT_SLUG, cls._meta.app_label, cls.__name__) diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 5786391cc..2feb49bc0 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -23,7 +23,11 @@ from copy import copy  import csv  import cStringIO as StringIO  import datetime + +import reportlab +reportlab.Version = "2.2"  # stupid hack for an old library...  import ho.pisa as pisa +  import json  import logging  from markdown import markdown @@ -186,10 +190,13 @@ organization_deletion_wizard = wizards.OrganizationDeletionWizard.as_view(      label=_(u"Organization deletion"),      url_name='organization_deletion',) +account_wizard_steps = [ +    ('selec-account_management', forms.PersonUserFormSelection), +    ('account-account_management', forms.AccountForm), +    ('final-account_management', forms.FinalAccountForm)] +  account_management_wizard = wizards.AccountWizard.as_view( -    [('selec-account_management', forms.PersonUserFormSelection), -     ('account-account_management', forms.AccountForm), -     ('final-account_management', forms.FinalAccountForm)], +    account_wizard_steps,      label=_(u"Account management"),      url_name='account_management',) @@ -214,44 +221,44 @@ def get_autocomplete_generic(model, extra={'available': True}):              else unicode(x)          data = json.dumps([{'id': obj.pk, 'value': get_label(obj)}                             for obj in objects]) -        return HttpResponse(data, mimetype='text/plain') +        return HttpResponse(data, content_type='text/plain')      return func  def hide_shortcut_menu(request):      request.session['SHORTCUT_SHOW'] = 'off' -    return HttpResponse('OK', mimetype='text/plain') +    return HttpResponse('OK', content_type='text/plain')  def show_shortcut_menu(request):      request.session['SHORTCUT_SHOW'] = 'on' -    return HttpResponse('OK', mimetype='text/plain') +    return HttpResponse('OK', content_type='text/plain')  def activate_all_search(request):      request.session['SHORTCUT_SEARCH'] = 'all' -    return HttpResponse('OK', mimetype='text/plain') +    return HttpResponse('OK', content_type='text/plain')  def activate_own_search(request):      request.session['SHORTCUT_SEARCH'] = 'own' -    return HttpResponse('OK', mimetype='text/plain') +    return HttpResponse('OK', content_type='text/plain')  def activate_advanced_shortcut_menu(request):      if not hasattr(request.user, 'ishtaruser'): -        return HttpResponse('KO', mimetype='text/plain') +        return HttpResponse('KO', content_type='text/plain')      request.user.ishtaruser.advanced_shortcut_menu = True      request.user.ishtaruser.save() -    return HttpResponse('OK', mimetype='text/plain') +    return HttpResponse('OK', content_type='text/plain')  def activate_simple_shortcut_menu(request):      if not hasattr(request.user, 'ishtaruser'): -        return HttpResponse('KO', mimetype='text/plain') +        return HttpResponse('KO', content_type='text/plain')      request.user.ishtaruser.advanced_shortcut_menu = False      request.user.ishtaruser.save() -    return HttpResponse('OK', mimetype='text/plain') +    return HttpResponse('OK', content_type='text/plain')  def shortcut_menu(request): @@ -462,7 +469,7 @@ def autocomplete_person(request, person_types=None, attached_to=None,          own_items = request.user.has_perm('ishtar_common.view_own_person',                                            models.Person)      if not all_items and not own_items or not request.GET.get('term'): -        return HttpResponse('[]', mimetype='text/plain') +        return HttpResponse('[]', content_type='text/plain')      q = request.GET.get('term')      limit = request.GET.get('limit', 20)      try: @@ -493,12 +500,12 @@ def autocomplete_person(request, person_types=None, attached_to=None,      persons = models.Person.objects.filter(query)[:limit]      data = json.dumps([{'id': person.pk, 'value': unicode(person)}                         for person in persons if person]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def autocomplete_department(request):      if not request.GET.get('term'): -        return HttpResponse('[]', mimetype='text/plain') +        return HttpResponse('[]', content_type='text/plain')      q = request.GET.get('term')      q = unicodedata.normalize("NFKD", q).encode('ascii', 'ignore')      query = Q() @@ -509,12 +516,12 @@ def autocomplete_department(request):      departments = models.Department.objects.filter(query)[:limit]      data = json.dumps([{'id': department.pk, 'value': unicode(department)}                         for department in departments]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def autocomplete_town(request):      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      q = unicodedata.normalize("NFKD", q).encode('ascii', 'ignore')      query = Q() @@ -527,12 +534,12 @@ def autocomplete_town(request):      towns = models.Town.objects.filter(query)[:limit]      data = json.dumps([{'id': town.pk, 'value': unicode(town)}                         for town in towns]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def autocomplete_advanced_town(request, department_id=None, state_id=None):      if not request.GET.get('term'): -        return HttpResponse(mimetype='text/plain') +        return HttpResponse(content_type='text/plain')      q = request.GET.get('term')      q = unicodedata.normalize("NFKD", q).encode('ascii', 'ignore')      query = Q() @@ -556,7 +563,7 @@ def autocomplete_advanced_town(request, department_id=None, state_id=None):              val += " (%s)" % town.numero_insee          result.append({'id': town.pk, 'value': val})      data = json.dumps(result) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def department_by_state(request, state_id=''): @@ -567,7 +574,7 @@ def department_by_state(request, state_id=''):          data = json.dumps([{'id': department.pk, 'number': department.number,                              'value': unicode(department)}                             for department in departments]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def format_val(val): @@ -585,6 +592,23 @@ HIERARCHIC_FIELDS = ['periods', 'period', 'unit', 'material_types',                       'material_type', 'conservatory_state'] +def _get_values(request, val): +    if hasattr(val, 'all'):  # manage related objects +        vals = list(val.all()) +    else: +        vals = [val] +    new_vals = [] +    for v in vals: +        if callable(v): +            v = v() +        if hasattr(v, 'url'): +            v = request.is_secure() and \ +                'https' or 'http' + '://' + \ +                           request.get_host() + v.url +        new_vals.append(v) +    return new_vals + +  def get_item(model, func_name, default_name, extra_request_keys=[],               base_request=None, bool_fields=[], reversed_bool_fields=[],               dated_fields=[], associated_models=[], relative_session_names=[], @@ -607,7 +631,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],          allowed, own = models.check_model_access_control(request, model,                                                           available_perms)          if not allowed: -            return HttpResponse(EMPTY, mimetype='text/plain') +            return HttpResponse(EMPTY, content_type='text/plain')          if force_own:              own = True @@ -683,7 +707,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],          try:              old = 'old' in request_items and int(request_items['old'])          except ValueError: -            return HttpResponse('[]', mimetype='text/plain') +            return HttpResponse('[]', content_type='text/plain')          # manage relations types          if 'relation_types' not in my_relation_types_prefix: @@ -730,7 +754,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],                      try:                          dct = {"pk": request.session[default_name]}                          pinned_search = unicode(model._meta.verbose_name)\ -                            + u" - " +  unicode( +                            + u" - " + unicode(                                  model.objects.get(pk=dct["pk"]))                      except model.DoesNotExist:                          pass @@ -856,7 +880,11 @@ def get_item(model, func_name, default_name, extra_request_keys=[],                  query |= Q(**altor_dct)          if own: -            query = query & model.get_query_owns(request.user) +            q = models.IshtarUser.objects.filter(user_ptr=request.user) +            if q.count(): +                query = query & model.get_query_owns(q.all()[0]) +            else: +                return HttpResponse(EMPTY, content_type='text/plain')          for and_req in and_reqs:              query = query & and_req @@ -1007,23 +1035,11 @@ def get_item(model, func_name, default_name, extra_request_keys=[],                                  val = list(val.all())                                  for v in val:                                      v = getattr(v, ky) -                                    if callable(v): -                                        v = v() -                                    if hasattr(v, 'url'): -                                        v = request.is_secure() and \ -                                            'https' or 'http' + '://' + \ -                                            request.get_host() + v.url -                                    new_vals.append(v) +                                    new_vals += _get_values(request, v)                              elif val:                                  try:                                      val = getattr(val, ky) -                                    if callable(val): -                                        val = val() -                                    if hasattr(val, 'url'): -                                        val = request.is_secure() and \ -                                            'https' or 'http' + '://' + \ -                                            request.get_host() + val.url -                                    new_vals.append(val) +                                    new_vals += _get_values(request, val)                                  except AttributeError:                                      # must be a query key such as "contains"                                      pass @@ -1111,9 +1127,9 @@ def get_item(model, func_name, default_name, extra_request_keys=[],                      "page": page_nb,                      "total": (items_nb / row_nb + 1) if row_nb else items_nb,                  }) -            return HttpResponse(data, mimetype='text/plain') +            return HttpResponse(data, content_type='text/plain')          elif data_type == "csv": -            response = HttpResponse(mimetype='text/csv') +            response = HttpResponse(content_type='text/csv')              n = datetime.datetime.now()              filename = u'%s_%s.csv' % (default_name,                                         n.strftime('%Y%m%d-%H%M%S')) @@ -1154,14 +1170,15 @@ def get_item(model, func_name, default_name, extra_request_keys=[],                      val = data[1:][idx + delta].encode(                          ENCODING, errors='replace')                      if col_name and "|" in col_name[0]: -                        for delta_idx in range(len(col_name[0].split('|')) - 1): +                        for delta_idx in range( +                                len(col_name[0].split('|')) - 1):                              delta += 1                              val += data[1:][idx + delta].encode(                                  ENCODING, errors='replace')                      row.append(val)                  writer.writerow(row)              return response -        return HttpResponse('{}', mimetype='text/plain') +        return HttpResponse('{}', content_type='text/plain')      return func @@ -1173,7 +1190,7 @@ def get_by_importer(request, slug, data_type='json', full=False,          res = ''          if data_type == "json":              res = '{}' -        return HttpResponse(res, mimetype='text/plain') +        return HttpResponse(res, content_type='text/plain')      imp = q.all()[0].get_importer_class()      cols, col_names = [], []      for formater in imp.LINE_FORMAT: @@ -1231,7 +1248,7 @@ def show_item(model, name, extra_dct=None):                      item = item.get_previous(date=date)                      assert item is not None                  except (ValueError, AssertionError): -                    return HttpResponse(None, mimetype='text/plain') +                    return HttpResponse(None, content_type='text/plain')                  dct['previous'] = item._previous                  dct['next'] = item._next              else: @@ -1286,7 +1303,7 @@ def show_item(model, name, extra_dct=None):              except xhtml2odt.ODTExportError:                  return HttpResponse(content, content_type="application/xhtml")              response = HttpResponse( -                mimetype='application/vnd.oasis.opendocument.text') +                content_type='application/vnd.oasis.opendocument.text')              response['Content-Disposition'] = 'attachment; filename=%s.odt' % \                                                filename              response.write(odtfile) @@ -1301,7 +1318,7 @@ def show_item(model, name, extra_dct=None):              pdf = pisa.pisaDocument(StringIO.StringIO(html), result,                                      encoding='utf-8')              response = HttpResponse(result.getvalue(), -                                    mimetype='application/pdf') +                                    content_type='application/pdf')              response['Content-Disposition'] = 'attachment; filename=%s.pdf' % \                                                filename              if not pdf.err: @@ -1321,8 +1338,8 @@ def revert_item(model):              date = datetime.datetime.strptime(date, '%Y-%m-%dT%H:%M:%S.%f')              item.rollback(date)          except (ObjectDoesNotExist, ValueError, HistoryError): -            return HttpResponse(None, mimetype='text/plain') -        return HttpResponse("True", mimetype='text/plain') +            return HttpResponse(None, content_type='text/plain') +        return HttpResponse("True", content_type='text/plain')      return func @@ -1333,9 +1350,9 @@ def autocomplete_organization(request, orga_type=None):                                    models.Organization)         and not request.user.ishtaruser.has_right(              'person_search', session=request.session)): -        return HttpResponse('[]', mimetype='text/plain') +        return HttpResponse('[]', content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse('[]', mimetype='text/plain') +        return HttpResponse('[]', content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -1352,16 +1369,16 @@ def autocomplete_organization(request, orga_type=None):      organizations = models.Organization.objects.filter(query)[:limit]      data = json.dumps([{'id': org.pk, 'value': unicode(org)}                         for org in organizations]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def autocomplete_author(request):      if not request.user.has_perm('ishtar_common.view_author', models.Author)\         and not request.user.has_perm('ishtar_common.view_own_author',                                       models.Author): -        return HttpResponse('[]', mimetype='text/plain') +        return HttpResponse('[]', content_type='text/plain')      if not request.GET.get('term'): -        return HttpResponse('[]', mimetype='text/plain') +        return HttpResponse('[]', content_type='text/plain')      q = request.GET.get('term')      query = Q()      for q in q.split(' '): @@ -1374,7 +1391,7 @@ def autocomplete_author(request):      authors = models.Author.objects.filter(query)[:limit]      data = json.dumps([{'id': author.pk, 'value': unicode(author)}                         for author in authors]) -    return HttpResponse(data, mimetype='text/plain') +    return HttpResponse(data, content_type='text/plain')  def new_item(model, frm, many=False): diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 42a93ddaa..0a80bb895 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -34,7 +34,7 @@ from django.utils.encoding import smart_unicode  from django.utils.functional import lazy  from django.utils.html import escape  from django.utils.safestring import mark_safe -from django.utils.simplejson import JSONEncoder +from json import JSONEncoder  from django.utils.translation import ugettext_lazy as _  from ishtar_common import models diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 3f90f8c48..128833ad4 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2010-2016  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2017  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -22,14 +22,15 @@ import logging  # from functools import wraps  from django.conf import settings -from django.contrib.formtools.wizard.views import NamedUrlWizardView, \ -    normalize_name, get_storage, StepsHelper +from formtools.wizard.views import NamedUrlWizardView, normalize_name, \ +    get_storage, StepsHelper +  from django.contrib.sites.models import Site  from django.core.exceptions import ObjectDoesNotExist  from django.core.files.images import ImageFile  from django.core.files.storage import default_storage  from django.core.mail import send_mail -from django.db.models.fields.files import FileField +from django.db.models.fields.files import FileField, ImageFieldFile  from django.db.models.fields.related import ManyToManyField  from django.db.models.fields import NOT_PROVIDED @@ -127,8 +128,7 @@ class Wizard(NamedUrlWizardView):      label = ''      translated_keys = []      modification = None  # True when the wizard modify an item -    storage_name = \ -        'django.contrib.formtools.wizard.storage.session.SessionStorage' +    storage_name = 'formtools.wizard.storage.session.SessionStorage'      wizard_done_template = 'ishtar/wizard/wizard_done.html'      wizard_done_window = ''      wizard_confirm = 'ishtar/wizard/confirm_wizard.html' @@ -357,7 +357,7 @@ class Wizard(NamedUrlWizardView):                  if form_datas:                      form_datas.append(("", "", "spacer"))                  items = hasattr(base_form, 'fields') and \ -                    base_form.fields.keyOrder or cleaned_data.keys() +                    base_form.fields.keys() or cleaned_data.keys()                  for key in items:                      lbl = None                      if key.startswith('hidden_'): @@ -368,7 +368,7 @@ class Wizard(NamedUrlWizardView):                          if hasattr(base_form, 'associated_labels') \                             and key in base_form.associated_labels:                              lbl = base_form.associated_labels[key] -                    if not lbl: +                    if not lbl or key not in cleaned_data:                          continue                      value = cleaned_data[key]                      if value is None or value == '': @@ -715,19 +715,22 @@ class Wizard(NamedUrlWizardView):                          # check if there is no missing fields                          # should be managed normally in forms but... -                        if hasattr(model._meta, 'get_fields'):  # django 1.8 -                            fields = model._meta.get_field() -                        else: -                            fields = model._meta.fields +                        fields = model._meta.get_fields() -                        has_problemetic_null = [ -                            (field.name, field.default == NOT_PROVIDED) -                            for field in fields + +                        has_problemetic_null = False +                        for field in fields:                              if (field.name not in value -                                or not value[field.name]) -                            and not field.null and not field.blank -                            and (not field.default -                                 or field.default == NOT_PROVIDED)] +                                or not value[field.name]) \ +                                and (hasattr(field, 'null') +                                     and not field.null) \ +                                and (hasattr(field, 'blank') +                                     and not field.blank) \ +                                and (hasattr(field, 'default') +                                     and (not field.default +                                          or field.default == NOT_PROVIDED)): +                                    has_problemetic_null = True +                                    break                          if has_problemetic_null:                              continue @@ -739,7 +742,9 @@ class Wizard(NamedUrlWizardView):                          value.save()  # force post_save                  # check that an item is not add multiple times (forged forms)                  if value not in related_model.all() and\ -                        hasattr(related_model, 'add'): +                        (not hasattr(related_model, 'through') or +                         not isinstance(value, related_model.through)): +                    # many to many and the value have been already managed                      related_model.add(value)                      # necessary to manage interaction between models like                      # material_index management for baseitems @@ -872,7 +877,7 @@ class Wizard(NamedUrlWizardView):              frm = form.forms[0]          if frm:              # autofocus on first field -            first_field = frm.fields[frm.fields.keyOrder[0]] +            first_field = frm.fields[frm.fields.keys()[0]]              attrs = first_field.widget.attrs              attrs.update({'autofocus': "autofocus"})              first_field.widget.attrs = attrs @@ -1108,7 +1113,13 @@ class Wizard(NamedUrlWizardView):                      continue                  if hasattr(value, 'pk'):                      value = value.pk -                if value in (True, False) or \ +                if isinstance(value, ImageFieldFile) \ +                        or isinstance(value, FileField): +                    try: +                        initial[base_field] = value.path +                    except ValueError: +                        pass +                elif value in (True, False) or \                     isinstance(value, FileField) or \                     isinstance(value, ImageFile):                      initial[base_field] = value @@ -1160,8 +1171,7 @@ class SearchWizard(NamedUrlWizardView):      model = None      label = ''      modification = None  # True when the wizard modify an item -    storage_name = \ -        'django.contrib.formtools.wizard.storage.session.SessionStorage' +    storage_name = 'formtools.wizard.storage.session.SessionStorage'      def get_wizard_name(self):          """ @@ -1373,17 +1383,24 @@ class AccountWizard(Wizard):              if key.startswith('hidden_password'):                  dct['password'] = dct.pop(key)          try: -            account = models.IshtarUser.objects.get(person=person) +            account = models.IshtarUser.objects.get(person=person).user_ptr              account.username = dct['username']              account.email = dct['email']          except ObjectDoesNotExist:              now = datetime.datetime.now() -            account = models.IshtarUser( -                person=person, username=dct['username'], email=dct['email'], +            account = models.User.objects.create( +                username=dct['username'], email=dct['email'],                  first_name=person.surname or '***',                  last_name=person.name or '***',                  is_staff=False, is_active=True, is_superuser=False, -                last_login=now, date_joined=now) +                last_login=now, date_joined=now +            ) +            ishtaruser = account.ishtaruser +            old_person_pk = ishtaruser.person.pk +            ishtaruser.person = person +            ishtaruser.save() +            models.Person.objects.get(pk=old_person_pk).delete() +          if dct['password']:              account.set_password(dct['password'])          account.save() diff --git a/old/__init__.py b/old/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/old/__init__.py diff --git a/ishtar_common/ooo_replace.py b/old/ooo_replace.py index 18c4e1878..cff5c2acc 100644 --- a/ishtar_common/ooo_replace.py +++ b/old/ooo_replace.py @@ -21,7 +21,7 @@ import locale  import re  from zipfile import ZipFile, ZIP_DEFLATED  from cStringIO import StringIO -from xml.etree.cElementTree import ElementTree, fromstring +from xml.etree.cElementTree import ElementTree, fromstring, register_namespace  from django.conf import settings  from ooo_translation import ooo_translation @@ -38,7 +38,36 @@ def translate_context(context, locale):          new_context[new_key] = context[k]      return new_context -OOO_NS = "{urn:oasis:names:tc:opendocument:xmlns:text:1.0}" +OOO_MAIN_NS = "{urn:oasis:names:tc:opendocument:xmlns:text:1.0}" + +OOO_NS = { +    "office": "urn:oasis:names:tc:opendocument:xmlns:office:1.0", +    "style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0", +    "text": "urn:oasis:names:tc:opendocument:xmlns:text:1.0", +    "table": "urn:oasis:names:tc:opendocument:xmlns:table:1.0", +    "draw": "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0", +    "fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", +    "xlink": "http://www.w3.org/1999/xlink", +    "dc": "http://purl.org/dc/elements/1.1/", +    "meta": "urn:oasis:names:tc:opendocument:xmlns:meta:1.0", +    "number": "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0", +    "svg": "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0", +    "chart": "urn:oasis:names:tc:opendocument:xmlns:chart:1.0", +    "dr3d": "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0", +    "math": "http://www.w3.org/1998/Math/MathML", +    "form": "urn:oasis:names:tc:opendocument:xmlns:form:1.0", +    "script": "urn:oasis:names:tc:opendocument:xmlns:script:1.0", +    "ooo": "http://openoffice.org/2004/office", +    "ooow": "http://openoffice.org/2004/writer", +    "oooc": "http://openoffice.org/2004/calc", +    "dom": "http://www.w3.org/2001/xml-events", +    "rpt": "http://openoffice.org/2005/report", +    "of": "urn:oasis:names:tc:opendocument:xmlns:of:1.2", +    "xhtml": "http://www.w3.org/1999/xhtml", +    "grddl": "http://www.w3.org/2003/g/data-view#", +    "tableooo": "http://openoffice.org/2009/table", +    "css3t": "http://www.w3.org/TR/css3-text/", +}  def _set_value_from_formula(value, context, default_value): @@ -159,8 +188,8 @@ def _ooo_replace(content, context, missing_keys, default_value=''):      # regular ooo parsing      for xp in ('variable-set', 'variable-get'): -        for p in content.findall(".//" + OOO_NS + xp): -            name = p.get(OOO_NS + "name") +        for p in content.findall(".//" + OOO_MAIN_NS + xp): +            name = p.get(OOO_MAIN_NS + "name")              if name in context:                  value = context[name]                  p.text = _format_value(value, default_value) @@ -168,11 +197,11 @@ def _ooo_replace(content, context, missing_keys, default_value=''):                  if default_value is not None:                      p.text = default_value                  missing_keys.add(name) -    for p in content.findall(".//" + OOO_NS + "conditional-text"): -        condition = p.get(OOO_NS + "condition") +    for p in content.findall(".//" + OOO_MAIN_NS + "conditional-text"): +        condition = p.get(OOO_MAIN_NS + "condition")          res = 'true' if _parse_condition(condition, context, default_value) \                else 'false' -        value = p.get(OOO_NS + 'string-value-if-' + res) +        value = p.get(OOO_MAIN_NS + 'string-value-if-' + res)          value = _format_value(value, default_value)          if value.strip() in context:              value = context[value.strip()] @@ -192,6 +221,8 @@ def ooo_replace(infile, outfile, context, default_value=''):      values = {}      missing_keys = set() +    for k in OOO_NS: +        register_namespace(k, OOO_NS[k])      for xml_file in ('content.xml', 'styles.xml'):          content = ElementTree(fromstring(inzip.read(xml_file)))          values[xml_file] = _ooo_replace(content, context, missing_keys, diff --git a/ishtar_common/ooo_translation.py b/old/ooo_translation.py index 5a3d4cb84..5a3d4cb84 100644 --- a/ishtar_common/ooo_translation.py +++ b/old/ooo_translation.py diff --git a/requirements.txt b/requirements.txt index eae7f38a2..9182eff82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,25 @@ -psycopg2==2.4.5 -django-registration==0.8 -django==1.4 -south>=0.7.3,<0.7.99 -Pillow>=1.1.6 +psycopg2==2.5.4 +django-registration==2.0 +django==1.8 +Pillow==3.4.2  pisa==3.0.33 -reportlab==2.5 -dbf==0.88.16 -python-memcached==1.48 -unicodecsv==0.9.0 +reportlab==3.1.8 +dbf==0.96.003 +python-memcached==1.57 +unicodecsv==0.14.1  pytidylib==0.2.1 -lxml>=3.3.1 +lxml==3.4.0  html5lib==0.999  django-extra-views==0.2.4  beautifulsoup4==4.3.2 -markdown==2.1.1 +markdown==2.5.1 + +django-formtools==1.0 + +secretary==0.2.14 + +-e git+https://github.com/treyhunner/django-simple-history.git@1.8.2#egg=django-simple-history + +django-extensions==1.3.10 diff --git a/simple_history b/simple_history deleted file mode 120000 index 2f560733b..000000000 --- a/simple_history +++ /dev/null @@ -1 +0,0 @@ -django-simple-history/simple_history/
\ No newline at end of file diff --git a/version.py b/version.py index 96dee143e..ec164ee24 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,5 @@ -VERSION = (0, 99, 24) +# 1.99.4 +VERSION = (1, 99, 4)  def get_version():  | 
