summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_context_records/data_importer.py4
-rw-r--r--archaeological_context_records/migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py579
-rw-r--r--archaeological_files/data_importer.py98
-rw-r--r--archaeological_files/ishtar_menu.py6
-rw-r--r--archaeological_files/locale/fr/LC_MESSAGES/django.po237
-rw-r--r--archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py442
-rw-r--r--archaeological_files/models.py58
-rw-r--r--archaeological_files/templates/ishtar/sheet_file.html13
-rw-r--r--archaeological_files/urls.py3
-rw-r--r--archaeological_files/views.py30
-rw-r--r--archaeological_files/wizards.py10
-rw-r--r--archaeological_files_pdl/forms.py208
-rw-r--r--archaeological_files_pdl/locale/fr/LC_MESSAGES/django.po139
-rw-r--r--archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js2
-rw-r--r--archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js2
-rw-r--r--archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js65
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html15
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html106
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html66
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html15
-rw-r--r--archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html80
-rw-r--r--archaeological_files_pdl/urls.py8
-rw-r--r--archaeological_files_pdl/views.py79
-rw-r--r--archaeological_files_pdl/wizards.py53
-rw-r--r--archaeological_finds/data_importer.py2
-rw-r--r--archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py824
-rw-r--r--archaeological_operations/data_importer.py6
-rw-r--r--archaeological_operations/forms.py7
-rw-r--r--archaeological_operations/ishtar_menu.py10
-rw-r--r--archaeological_operations/management/commands/ishtar_imports.py (renamed from archaeological_operations/management/commands/import_operations.py)19
-rw-r--r--archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py559
-rw-r--r--archaeological_operations/models.py16
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html2
-rw-r--r--archaeological_operations/urls.py8
-rw-r--r--archaeological_operations/views.py36
-rw-r--r--archaeological_operations/wizards.py24
-rw-r--r--archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py206
-rw-r--r--example_project/settings.py11
-rwxr-xr-xinstall/install.sh4
-rw-r--r--ishtar_common/data_importer.py143
-rw-r--r--ishtar_common/fixtures/initial_dpts-fr.json1127
-rw-r--r--ishtar_common/forms.py2
-rw-r--r--ishtar_common/forms_common.py48
-rw-r--r--ishtar_common/ishtar_menu.py7
-rw-r--r--ishtar_common/locale/fr/LC_MESSAGES/django.po528
-rw-r--r--ishtar_common/management/commands/update_towns.py22
-rw-r--r--ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py371
-rw-r--r--ishtar_common/models.py40
-rw-r--r--ishtar_common/ooo_replace.py35
-rw-r--r--ishtar_common/ooo_translation.py37
-rw-r--r--ishtar_common/static/media/style.css62
-rw-r--r--ishtar_common/tasks.py35
-rw-r--r--ishtar_common/templates/base.html1
-rw-r--r--ishtar_common/templates/blocks/JQueryAdvancedTown.html99
-rw-r--r--ishtar_common/templates/blocks/JQueryAdvancedTown.js1
-rw-r--r--ishtar_common/templates/blocks/JQueryPersonOrganization.js50
-rw-r--r--ishtar_common/templates/blocks/PersonOrganization.html9
-rw-r--r--ishtar_common/templates/blocks/extra_head.html2
-rw-r--r--ishtar_common/templates/ishtar/organization_form.html30
-rw-r--r--ishtar_common/templates/ishtar/organization_person_form.html131
-rw-r--r--ishtar_common/templates/ishtar/person_form.html113
-rw-r--r--ishtar_common/templates/ishtar/wizard/confirm_wizard.html2
-rw-r--r--ishtar_common/templates/ishtar/wizard/default_wizard.html8
-rw-r--r--ishtar_common/templates/ishtar/wizard/parcels_wizard.html6
-rw-r--r--ishtar_common/templates/ishtar/wizard/towns_wizard.html5
-rw-r--r--ishtar_common/templates/ishtar/wizard/validation_bar.html7
-rw-r--r--ishtar_common/urls.py23
-rw-r--r--ishtar_common/views.py139
-rw-r--r--ishtar_common/widgets.py204
-rw-r--r--ishtar_common/wizards.py14
-rw-r--r--ishtar_pdl/__init__.py1
-rw-r--r--ishtar_pdl/models.py1
-rw-r--r--ishtar_pdl/static/pdl/JQueryCorporation.js14
-rw-r--r--ishtar_pdl/static/pdl/styles.css14
-rw-r--r--ishtar_pdl/templates/blocks/extra_head.html1
75 files changed, 6853 insertions, 531 deletions
diff --git a/archaeological_context_records/data_importer.py b/archaeological_context_records/data_importer.py
index 0bf6f83a1..8c5df2ddf 100644
--- a/archaeological_context_records/data_importer.py
+++ b/archaeological_context_records/data_importer.py
@@ -43,9 +43,9 @@ class ContextRecordsImporterBibracte(Importer):
# interprétation
ImportFormater('interpretation', UnicodeFormater(1000), required=False,),
# date ouverture
- ImportFormater('opening_date', DateFormater('%Y/%m/%d'), required=False,),
+ ImportFormater('opening_date', DateFormater(['%Y/%m/%d']), required=False,),
# date fermeture
- ImportFormater('closing_date', DateFormater('%Y/%m/%d'), required=False,),
+ ImportFormater('closing_date', DateFormater(['%Y/%m/%d']), required=False,),
# lien vers parcelle
ImportFormater('parcel__external_id', UnicodeFormater(12),
required=False,),
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/migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py
new file mode 100644
index 000000000..dec4559be
--- /dev/null
+++ b/archaeological_context_records/migrations/0011_auto__chg_field_datingtype_txt_idx__chg_field_datingquality_txt_idx__c.py
@@ -0,0 +1,579 @@
+# -*- 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 'DatingType.txt_idx'
+ db.alter_column('archaeological_context_records_datingtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'DatingQuality.txt_idx'
+ db.alter_column('archaeological_context_records_datingquality', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'RelationType.txt_idx'
+ db.alter_column('archaeological_context_records_relationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'IdentificationType.txt_idx'
+ db.alter_column('archaeological_context_records_identificationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'Unit.txt_idx'
+ db.alter_column('archaeological_context_records_unit', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'ActivityType.txt_idx'
+ db.alter_column('archaeological_context_records_activitytype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ def backwards(self, orm):
+
+ # Changing field 'DatingType.txt_idx'
+ db.alter_column('archaeological_context_records_datingtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'DatingQuality.txt_idx'
+ db.alter_column('archaeological_context_records_datingquality', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'RelationType.txt_idx'
+ db.alter_column('archaeological_context_records_relationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'IdentificationType.txt_idx'
+ db.alter_column('archaeological_context_records_identificationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'Unit.txt_idx'
+ db.alter_column('archaeological_context_records_unit', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'ActivityType.txt_idx'
+ db.alter_column('archaeological_context_records_activitytype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=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': {'object_name': 'ContextRecord'},
+ 'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", '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'}),
+ 'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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_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'}),
+ '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'location': ('django.db.models.fields.CharField', [], {'max_length': '200', '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']"}),
+ '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.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'},
+ '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'}),
+ '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'}),
+ 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
+ 'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ 'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'reference': ('django.db.models.fields.CharField', [], {'max_length': '25', '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'}),
+ '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']"}),
+ '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.historicalcontextrecord': {
+ 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalContextRecord'},
+ 'activity_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', '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'}),
+ 'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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_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'}),
+ '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'}),
+ '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'}),
+ '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': {'ordering': "('order',)", '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',)", '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'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
+ },
+ 'archaeological_context_records.unit': {
+ 'Meta': {'ordering': "('order',)", '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'}),
+ 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', '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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'", '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.CharField', [], {'max_length': '100', '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.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'}),
+ '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'}),
+ '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'}),
+ 'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_operations.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'", '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'total_surface': ('django.db.models.fields.IntegerField', [], {'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': '2015'})
+ },
+ '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'},
+ 'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.ArchaeologicalSite']", 'symmetrical': 'False'}),
+ '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_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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'}),
+ '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'}),
+ 'negative_result': ('django.db.models.fields.NullBooleanField', [], {'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['archaeological_operations.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', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}),
+ 'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}),
+ 'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'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'}),
+ 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}),
+ 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_operations.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'})
+ },
+ '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']"}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '12', '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'}),
+ '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': {'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'})
+ },
+ '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', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"})
+ },
+ 'ishtar_common.authortype': {
+ 'Meta': {'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'}),
+ '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': {'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'},
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}),
+ 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', '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.importertype': {
+ 'Meta': {'object_name': 'ImporterType'},
+ 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ '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'}),
+ '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']},
+ '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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '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'}),
+ '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']"}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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'}),
+ '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'}),
+ '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'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2', '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': {'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.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'})
+ }
+ }
+
+ complete_apps = ['archaeological_context_records'] \ No newline at end of file
diff --git a/archaeological_files/data_importer.py b/archaeological_files/data_importer.py
index ae0cf340c..2b715cb42 100644
--- a/archaeological_files/data_importer.py
+++ b/archaeological_files/data_importer.py
@@ -41,7 +41,36 @@ class ImportClosingFormater(ImportFormater):
obj.end_date = open_date + datetime.timedelta(30)
obj.save()
-class FileImporterSraPdL(Importer):
+class ImportMayorFormater(ImportFormater):
+ def post_process(self, obj, context, value, owner=None):
+ value = self.formater.format(value)
+ if type(self.field_name) in (list, tuple):
+ return #not managed
+ associated_obj = get_object_from_path(obj, self.field_name)
+ if not value or not obj.main_town or not associated_obj:
+ return
+ if slugify(value).endswith('le-maire'):
+ value += u" de " + obj.main_town.name
+ value = value[:300]
+ setattr(associated_obj, self.field_name.split('__')[-1], value)
+ associated_obj.save()
+
+class FilePostProcessing(object):
+ # erroneaous date to be easily identified on post-processing
+ DEFAULT_YEAR = 1756
+ EXTRA_DEFAULTS = {tuple():{'year':DEFAULT_YEAR}}
+
+ def post_processing(self, item, data):
+ if item.year == self.DEFAULT_YEAR:
+ if item.creation_date:
+ item.year = item.creation_date.year
+ elif item.reception_date:
+ item.year = item.reception_date.year
+ item.save()
+ return item
+
+class FileImporterSraPdL(FilePostProcessing, Importer):
+ DESC = u"Exports dossiers SRA PdL : importeur Filemaker dossiers"
LINE_FORMAT = []
OBJECT_CLS = models.File
DEFAULTS = {('responsible_town_planning_service', 'attached_to'):{
@@ -52,42 +81,43 @@ class FileImporterSraPdL(Importer):
txt_idx="general_contractor")},
tuple():{
'file_type': models.FileType.objects.get(
- txt_idx='undefined'),
+ txt_idx='preventive'),
},
('in_charge',):{'attached_to':None}, # initialized in __init__
}
+ STR_CUT = {tuple():{'comment':2000}}
def _init_line_format(self):
tf = TownFormater()
tf.town_dct_init()
self.line_format = [
None, # A, 1
- ImportFormater(['address', 'postal_code', ['towns', 'parcels__town']], # B, 2
+ ImportFormater(['address', 'postal_code', ['main_town', 'parcels__town']], # B, 2
[UnicodeFormater(500, clean=True),
UnicodeFormater(5, re_filter=RE_CD_POSTAL_FILTER),
tf],
regexp=RE_ADD_CD_POSTAL_TOWN,
regexp_formater_args=[[0], [1], [2, 1]], required=False,
- comment="Dossier - adresse"),
- ImportFormater('general_contractor__raw_name', # C, 3 TODO - extraire nom_prenom_titre
+ comment=u"Dossier - adresse"),
+ ImportMayorFormater('general_contractor__raw_name', # C, 3 TODO - extraire nom_prenom_titre
UnicodeFormater(200),
comment=u"Aménageur - nom brut",
- duplicate_fields=['general_contractor__attached_to__name'],
+ post_processing=True,
required=False),
- ImportFormater(['general_contractor__attached_to__address', # D, 4
- 'general_contractor__attached_to__postal_code',
- 'general_contractor__attached_to__town'],
+ ImportFormater(['general_contractor__address', # D, 4
+ 'general_contractor__postal_code',
+ 'general_contractor__town'],
[UnicodeFormater(500, clean=True),
UnicodeFormater(5, re_filter=RE_CD_POSTAL_FILTER),
TownFormater(town_full_dct=tf._town_full_dct,
town_dct=tf._town_dct)],
regexp=RE_ADD_CD_POSTAL_TOWN,
regexp_formater_args=[[0], [1], [2, 1]], required=False,
- comment="Aménageur - adresse"),
+ comment=u"Aménageur - adresse"),
ImportFormater("general_contractor__title", # E, 5
StrChoiceFormater(Person.TYPE, cli=True),
required=False,
- comment="Aménageur - titre"),
+ comment=u"Aménageur - titre"),
None, # F, 6
None, # G, 7
None, # H, 8
@@ -96,19 +126,18 @@ class FileImporterSraPdL(Importer):
required=False),
ImportParcelFormater('', required=False, post_processing=True), # J, 10
None, # K, 11
- ImportFormater([['towns', 'parcels__town']], # L, 12
+ ImportFormater([['main_town', 'parcels__town']], # L, 12
tf,
required=False,
- comment="Commune (si non définie avant)"),
- ImportFormater([['towns', 'parcels__town']], # M, 13
+ comment=u"Commune (si non définie avant)"),
+ ImportFormater([['main_town', 'parcels__town']], # M, 13
tf,
required=False,
- comment="Commune (si non définie avant)"),
+ comment=u"Commune (si non définie avant)"),
ImportFormater('saisine_type', # N, 14
- StrChoiceFormater(models.SaisineType.get_types(),
- model=models.SaisineType, cli=True),
+ TypeFormater(models.SaisineType),
required=False,
- comment="Type de saisine"),
+ comment=u"Type de saisine"),
None, # O, 15
ImportFormater('comment', # P, 16
UnicodeFormater(2000),
@@ -117,9 +146,9 @@ class FileImporterSraPdL(Importer):
None, # Q, 17
ImportFormater([
'responsible_town_planning_service__raw_name', # R, 18 service instructeur
- 'responsible_town_planning_service__attached_to__address',
- 'responsible_town_planning_service__attached_to__postal_code',
- 'responsible_town_planning_service__attached_to__town',],
+ 'responsible_town_planning_service__address',
+ 'responsible_town_planning_service__postal_code',
+ 'responsible_town_planning_service__town',],
[UnicodeFormater(300, clean=True),
UnicodeFormater(300, clean=True),
UnicodeFormater(5, re_filter=RE_CD_POSTAL_FILTER),
@@ -127,14 +156,14 @@ class FileImporterSraPdL(Importer):
town_dct=tf._town_dct)],
regexp=RE_NAME_ADD_CD_POSTAL_TOWN,
regexp_formater_args=[[0], [1], [2], [3, 2]],
- comment="Aménageur - adresse",
+ comment=u"Aménageur - adresse",
required=False),
ImportFormater('comment', # S, 19
UnicodeFormater(2000),
comment=u"Commentaire",
concat=True, required=False),
ImportYearFormater('reception_date', # T, 20
- DateFormater(),
+ DateFormater(['%d/%m/%Y', '%d/%m/%Y']),
comment=u"Date de création",
required=False,
duplicate_fields=['creation_date']),
@@ -153,7 +182,7 @@ class FileImporterSraPdL(Importer):
None, # AG, 33
None, # AH, 34
ImportFormater('creation_date', # AI, 35
- DateFormater(),
+ DateFormater(['%d/%m/%Y', '%d/%m/%y']),
force_value=True,
comment=u"Date de création",
required=False,),
@@ -182,7 +211,7 @@ class FileImporterSraPdL(Importer):
ImportFormater('permit_reference', # AW, 49
UnicodeFormater(300, clean=True),
regexp=RE_PERMIT_REFERENCE,
- comment="Réf. du permis de construire",
+ comment=u"Réf. du permis de construire",
required=False),
None, # AX, 50
None, # AY, 51
@@ -191,10 +220,10 @@ class FileImporterSraPdL(Importer):
None, # BB, 54
None, # BC, 55
None, # BD, 56
- ImportFormater([['towns', 'parcels__town']], # BE, 57
+ ImportFormater([['main_town', 'parcels__town']], # BE, 57
TownINSEEFormater(),
required=False,
- comment="Commune (si non définie avant)"),
+ comment=u"Commune (si non définie avant)"),
ImportFormater('comment', # BF, 58
UnicodeFormater(2000),
comment=u"Commentaire",
@@ -212,15 +241,11 @@ class FileImporterSraPdL(Importer):
None, # BQ, 69
None, # BR, 70
None, # BS, 71
- ImportFormater(
- 'responsible_town_planning_service__attached_to__name', # BT, 72 service instructeur
- UnicodeFormater(300, clean=True),
- regexp=RE_ORGA,
- comment="Service instructeur - nom",
- required=False),
+ None, # BT, 72
None, # BU, 73
ImportClosingFormater('', StrToBoolean(cli=True),
- post_processing=True, required=False), # BV, 74, end date
+ post_processing=True, required=False,
+ comment=u'Dossier clos'), # BV, 74, end date
ImportClosingFormater('in_charge__raw_name', # BW, 75 responsable
UnicodeFormater(200),
comment=u"Responsable - nom brut",
@@ -241,10 +266,9 @@ class FileImporterSraPdL(Importer):
None, # CE, 83
None, # CF, 84
ImportFormater('permit_type',
- StrChoiceFormater(models.PermitType.get_types(),
- model=models.PermitType, cli=True),
+ TypeFormater(models.PermitType),
required=False,
- comment="Type de permis"), # CG, 85
+ comment=u"Type de permis"), # CG, 85
None, # CH, 85
]
diff --git a/archaeological_files/ishtar_menu.py b/archaeological_files/ishtar_menu.py
index fc0401115..df4946330 100644
--- a/archaeological_files/ishtar_menu.py
+++ b/archaeological_files/ishtar_menu.py
@@ -46,9 +46,13 @@ MENU_SECTIONS = [
access_controls=['delete_file', 'delete_own_file']),
SectionItem('admin_act_files', _(u"Administrative act"),
childs=[
+ MenuItem('file_administrativeactfile_search',
+ _(u"Search"),
+ model=AdministrativeAct,
+ access_controls=['change_file', 'change_own_file']),
MenuItem('file_administrativeactfile',
_(u"Add"),
- model=Operation,
+ model=AdministrativeAct,
access_controls=['change_file', 'change_own_file']),
MenuItem('file_administrativeactfile_modification',
_(u"Modification"),
diff --git a/archaeological_files/locale/fr/LC_MESSAGES/django.po b/archaeological_files/locale/fr/LC_MESSAGES/django.po
index c358ca579..c9c502d6e 100644
--- a/archaeological_files/locale/fr/LC_MESSAGES/django.po
+++ b/archaeological_files/locale/fr/LC_MESSAGES/django.po
@@ -1,15 +1,15 @@
# Ishtar po translation.
-# Copyright (C) 2010-2015
+# Copyright (C) 2010-2014
# This file is distributed under the same license as the Ishtar package.
-# Étienne Loks <etienne.loks at peacefrogs net>, 2010-2015.
+# Étienne Loks <etienne.loks at peacefrogs net>, 2010-2014.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: alpha\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-01-24 23:33+0100\n"
-"PO-Revision-Date: 2015-01-24\n"
+"POT-Creation-Date: 2014-12-31 12:06+0100\n"
+"PO-Revision-Date: 2010-12-09\n"
"Last-Translator: Étienne Loks <etienne.loks at peacefrogs net>\n"
"Language-Team: \n"
"Language: \n"
@@ -24,8 +24,8 @@ msgid "Choice for \"%s\" is not available. Which one is relevant?\n"
msgstr "Le choix pour \"%s\" n'est pas disponible. Lequel est pertinent ?\n"
#: forms.py:55 forms.py:188 forms.py:228 forms.py:339 forms.py:379
-#: models.py:70 templates/ishtar/sheet_file.html:98
-#: templates/ishtar/sheet_file.html:126
+#: models.py:70 templates/ishtar/sheet_file.html:105
+#: templates/ishtar/sheet_file.html:133
msgid "Year"
msgstr "Année"
@@ -65,7 +65,7 @@ msgstr "Aménageur"
msgid "Organization of general contractor"
msgstr "Organisation de l'aménageur"
-#: forms.py:80 forms.py:383 templates/ishtar/sheet_file.html:102
+#: forms.py:80 forms.py:383 templates/ishtar/sheet_file.html:109
msgid "In charge"
msgstr "Responsable"
@@ -85,11 +85,11 @@ msgstr "Recherche de dossiers archéologiques"
msgid "You should select a file."
msgstr "Vous devez sélectionner un dossier archéologique."
-#: forms.py:125 forms.py:197 models.py:98
+#: forms.py:125 forms.py:197 models.py:100
msgid "Creation date"
msgstr "Date de création"
-#: forms.py:126 forms.py:269 models.py:100
+#: forms.py:126 forms.py:269 models.py:102
msgid "Reception date"
msgstr "Date de réception"
@@ -113,7 +113,7 @@ msgstr "Date après"
msgid "Date before"
msgstr "Date avant"
-#: forms.py:178 templates/ishtar/sheet_file.html:24
+#: forms.py:178 templates/ishtar/sheet_file.html:31
msgid "General"
msgstr "Général"
@@ -125,23 +125,23 @@ msgstr "Responsable"
msgid "Name"
msgstr "Nom"
-#: forms.py:200 models.py:102
+#: forms.py:200 models.py:104
msgid "Related file"
msgstr "Dossier en relation avec"
-#: forms.py:204 forms.py:310 models.py:118 templates/ishtar/sheet_file.html:85
+#: forms.py:204 forms.py:310 models.py:122 templates/ishtar/sheet_file.html:92
msgid "Comment"
msgstr "Commentaire"
-#: forms.py:208 models.py:109
+#: forms.py:208 models.py:113
msgid "Total surface (m²)"
msgstr "Surface totale des terrains (m²)"
-#: forms.py:211 models.py:113
+#: forms.py:211 models.py:119
msgid "Main address"
msgstr "Adresse des terrains"
-#: forms.py:212 models.py:114
+#: forms.py:212
msgid "Main address - complement"
msgstr "Adresse des terrains - complément"
@@ -162,24 +162,24 @@ msgstr "Responsable au service instructeur"
msgid "Permit type"
msgstr "Type de permis"
-#: forms.py:263 models.py:112
+#: forms.py:263 models.py:116
msgid "Total developed surface (m²)"
msgstr "Surface totale aménagée (m²)"
-#: forms.py:280 templates/ishtar/sheet_file.html:75
+#: forms.py:280 templates/ishtar/sheet_file.html:82
#: templates/ishtar/dashboards/dashboard_file.html:42
msgid "Research archaeology"
msgstr "Archéologie programmée"
-#: forms.py:288 models.py:121 templates/ishtar/sheet_file.html:76
+#: forms.py:288 models.py:125 templates/ishtar/sheet_file.html:83
msgid "Departments"
msgstr "Départements"
-#: forms.py:298 models.py:133
+#: forms.py:298 models.py:137
msgid "Scientist in charge"
msgstr "Responsable scientifique"
-#: forms.py:300 models.py:126 templates/ishtar/sheet_file.html:78
+#: forms.py:300 models.py:130 templates/ishtar/sheet_file.html:85
msgid "Requested operation type"
msgstr "Type d'opération demandée"
@@ -187,21 +187,21 @@ msgstr "Type d'opération demandée"
msgid "Lead organization"
msgstr "Organisation porteuse du projet"
-#: forms.py:319 models.py:137 templates/ishtar/sheet_file.html:83
+#: forms.py:319 models.py:141 templates/ishtar/sheet_file.html:90
msgid "Classified area"
msgstr "Au sein d'un site classé"
-#: forms.py:321 models.py:139 templates/ishtar/sheet_file.html:84
+#: forms.py:321 models.py:143 templates/ishtar/sheet_file.html:91
msgid "Protected area"
msgstr "Au sein d'un secteur sauvegardé"
#: forms.py:332
msgid "Would you like to close this archaeological file?"
-msgstr "Voulez-vous clore ce dossier archéologique ?"
+msgstr "Voulez vous clore ce dossier archéologique ?"
#: forms.py:336
msgid "Would you like to delete this archaelogical file ?"
-msgstr "Voulez-vous supprimer ce dossier archéologique ?"
+msgstr "Voulez vous supprimer ce dossier archéologique ?"
#: forms.py:340
msgid "Index"
@@ -219,7 +219,7 @@ msgstr "Date de signature après"
msgid "Signature date before"
msgstr "Date de signature avant"
-#: ishtar_menu.py:30 models.py:154 templates/ishtar/sheet_file.html:6
+#: ishtar_menu.py:30 models.py:158 templates/ishtar/sheet_file.html:6
msgid "Archaeological file"
msgstr "Dossier"
@@ -237,7 +237,7 @@ msgstr "Modification"
#: ishtar_menu.py:41
msgid "Closing"
-msgstr "Clôture"
+msgstr "Clotûre"
#: ishtar_menu.py:44 ishtar_menu.py:58
msgid "Deletion"
@@ -263,7 +263,7 @@ msgstr "Tableau de bord"
msgid "General informations"
msgstr "Informations générales"
-#: ishtar_menu.py:73 models.py:155
+#: ishtar_menu.py:73 models.py:159
#: templates/ishtar/dashboards/dashboard_file.html:8
msgid "Archaeological files"
msgstr "Dossiers archéologiques"
@@ -282,7 +282,7 @@ msgstr "Types de permis"
#: models.py:60
msgid "Delay (in days)"
-msgstr "Délai (en jours)"
+msgstr "Delai (en jours)"
#: models.py:74
msgid "Internal reference"
@@ -290,113 +290,125 @@ msgstr "Référence interne"
#: models.py:95
msgid "Closing date"
-msgstr "Date de clôture"
+msgstr "Date de clotûre"
#: models.py:96
+msgid "Town"
+msgstr "Commune"
+
+#: models.py:98
msgid "Towns"
msgstr "Communes"
-#: models.py:107
+#: models.py:109
msgid "Ref. number"
msgstr "Réf. numérique"
-#: models.py:116
+#: models.py:111
+msgid "Instruction deadline"
+msgstr "Date limite d'instruction"
+
+#: models.py:117
+msgid "Locality"
+msgstr "Lieu-dit"
+
+#: models.py:120
msgid "Main address - postal code"
msgstr "Adresse des terrains - code postal"
-#: models.py:128 templates/ishtar/sheet_file.html:79
+#: models.py:132 templates/ishtar/sheet_file.html:86
msgid "Organization"
msgstr "Organisation"
-#: models.py:134
+#: models.py:138
msgid "Research archaeology comment"
msgstr "Commentaire archéologie programmée"
-#: models.py:148
+#: models.py:152
msgid "Cached name"
msgstr "Nom en cache"
-#: models.py:150
+#: models.py:154
msgid "Imported line"
msgstr "Ligne importée"
-#: models.py:157
+#: models.py:161
msgid "Can view all Archaelogical file"
-msgstr "Peut voir tous les dossiers archéologiques"
+msgstr "Peut voir tous les dossier archéologique"
-#: models.py:158
+#: models.py:162
msgid "Can view own Archaelogical file"
msgstr "Peut voir son propre Dossier"
-#: models.py:159
+#: models.py:163
msgid "Can add own Archaelogical file"
msgstr "Peut ajouter son propre Dossier"
-#: models.py:160
+#: models.py:164
msgid "Can change own Archaelogical file"
msgstr "Peut changer son propre Dossier"
-#: models.py:161
+#: models.py:165
msgid "Can delete own Archaelogical file"
msgstr "Peut supprimer son propre Dossier"
-#: models.py:162
+#: models.py:166
msgid "Can close File"
msgstr "Peut fermer un dossier"
-#: models.py:168
+#: models.py:172
msgid "FILE"
msgstr "DOSSIER"
-#: models.py:270
+#: models.py:274
msgid "Intercommunal"
msgstr "Intercommunal"
-#: models.py:334
+#: models.py:340
msgid "File"
msgstr "Dossier"
-#: models.py:335
+#: models.py:341
msgid "Department"
msgstr "Département"
-#: views.py:121
+#: views.py:130
msgid "File search"
msgstr "Recherche de dossier archéologique"
-#: views.py:131
+#: views.py:140
msgid "New file"
msgstr "Nouveau dossier archéologique"
-#: views.py:150
+#: views.py:159
msgid "File modification"
msgstr "Modification de dossier archéologique"
-#: views.py:172
+#: views.py:181
msgid "File closing"
-msgstr "Clôture de dossier"
+msgstr "Clotûre de dossier"
-#: views.py:179
+#: views.py:188
msgid "File deletion"
msgstr "Suppression de dossier archéologique"
-#: views.py:187
+#: views.py:196
msgid "File: new administrative act"
msgstr "Dossier : nouvel acte administratif"
-#: views.py:197
+#: views.py:206
msgid "File: administrative act modification"
msgstr "Dossier : modification d'acte administratif"
-#: views.py:206
+#: views.py:215
msgid "File: administrative act deletion"
msgstr "Dossier : suppression acte administratif"
-#: wizards.py:139 templates/ishtar/sheet_file.html:96
+#: wizards.py:145 templates/ishtar/sheet_file.html:103
msgid "Associated operations"
msgstr "Opérations associées"
-#: wizards.py:165 wizards.py:175
+#: wizards.py:171 wizards.py:181
msgid "Archaelogical file"
msgstr "Dossier"
@@ -418,7 +430,7 @@ msgstr "Version précédente"
#: templates/ishtar/sheet_file.html:17
msgid "Are you sure to rollback to this version?"
-msgstr "Êtes-vous sûr de vouloir revenir à cette version ?"
+msgstr "Êtes vous sûr de vouloir revenir à cette version ?"
#: templates/ishtar/sheet_file.html:18
msgid "Next version"
@@ -436,186 +448,190 @@ msgstr "Fichier OpenOffice.org"
msgid "PDF file"
msgstr "Fichier PDF"
-#: templates/ishtar/sheet_file.html:23
+#: templates/ishtar/sheet_file.html:24
msgid "Modify"
msgstr "Modifier"
-#: templates/ishtar/sheet_file.html:25
+#: templates/ishtar/sheet_file.html:27
+msgid "Add an associated archaeological operation"
+msgstr "Ajouter une opération archéologique associée à ce dossier"
+
+#: templates/ishtar/sheet_file.html:32
msgid "Year:"
msgstr "Année :"
-#: templates/ishtar/sheet_file.html:26
+#: templates/ishtar/sheet_file.html:33
msgid "Numerical reference:"
msgstr "Référence numérique :"
-#: templates/ishtar/sheet_file.html:27
+#: templates/ishtar/sheet_file.html:34
msgid "Other reference:"
msgstr "Autre référence :"
-#: templates/ishtar/sheet_file.html:29
+#: templates/ishtar/sheet_file.html:36
msgid "Name:"
msgstr "Nom :"
-#: templates/ishtar/sheet_file.html:31
+#: templates/ishtar/sheet_file.html:38
msgid "Edition date:"
msgstr "Date d'édition :"
-#: templates/ishtar/sheet_file.html:32
+#: templates/ishtar/sheet_file.html:39
msgid "Reception date:"
msgstr "Date de réception :"
-#: templates/ishtar/sheet_file.html:33
+#: templates/ishtar/sheet_file.html:40
msgid "Creation date:"
msgstr "Date de création :"
-#: templates/ishtar/sheet_file.html:34
+#: templates/ishtar/sheet_file.html:41
msgid "Created by:"
msgstr "Créé par :"
-#: templates/ishtar/sheet_file.html:41
+#: templates/ishtar/sheet_file.html:48
msgid "In charge:"
msgstr "Responsable :"
-#: templates/ishtar/sheet_file.html:42
+#: templates/ishtar/sheet_file.html:49
msgid "State:"
msgstr "État :"
-#: templates/ishtar/sheet_file.html:42
+#: templates/ishtar/sheet_file.html:49
msgid "Active file"
msgstr "Dossier actif"
-#: templates/ishtar/sheet_file.html:43
+#: templates/ishtar/sheet_file.html:50
msgid "Closed file"
msgstr "Dossier fermé"
-#: templates/ishtar/sheet_file.html:44
+#: templates/ishtar/sheet_file.html:51
msgid "Closing date:"
-msgstr "Date de clôture :"
+msgstr "Date de clotûre :"
-#: templates/ishtar/sheet_file.html:44
+#: templates/ishtar/sheet_file.html:51
msgid "by"
msgstr "par"
-#: templates/ishtar/sheet_file.html:47
+#: templates/ishtar/sheet_file.html:54
msgid "Type:"
msgstr "Type :"
-#: templates/ishtar/sheet_file.html:49
+#: templates/ishtar/sheet_file.html:56
msgid "Related file:"
msgstr "Dossier en relation avec :"
-#: templates/ishtar/sheet_file.html:50
+#: templates/ishtar/sheet_file.html:57
msgid "Comment:"
msgstr "Commentaire :"
-#: templates/ishtar/sheet_file.html:52
+#: templates/ishtar/sheet_file.html:59
msgid "Localisation"
msgstr "Localisation"
-#: templates/ishtar/sheet_file.html:53
+#: templates/ishtar/sheet_file.html:60
msgid "Towns:"
msgstr "Communes :"
-#: templates/ishtar/sheet_file.html:55
+#: templates/ishtar/sheet_file.html:62
msgid "Main address:"
msgstr "Adresse principale :"
-#: templates/ishtar/sheet_file.html:56
+#: templates/ishtar/sheet_file.html:63
msgid "Complement:"
msgstr "Complément :"
-#: templates/ishtar/sheet_file.html:57
+#: templates/ishtar/sheet_file.html:64
msgid "Postal code:"
msgstr "Code postal :"
-#: templates/ishtar/sheet_file.html:59
+#: templates/ishtar/sheet_file.html:66
msgid "Surface:"
msgstr "Surface :"
-#: templates/ishtar/sheet_file.html:64
+#: templates/ishtar/sheet_file.html:71
msgid "Preventive archaelogical file"
msgstr "Dossier d'archéologie préventive"
-#: templates/ishtar/sheet_file.html:65
+#: templates/ishtar/sheet_file.html:72
msgid "Developed surface:"
msgstr "Surface aménagée :"
-#: templates/ishtar/sheet_file.html:66
+#: templates/ishtar/sheet_file.html:73
msgid "Saisine type:"
msgstr "Type de saisine :"
-#: templates/ishtar/sheet_file.html:67
+#: templates/ishtar/sheet_file.html:74
msgid "Town planning service:"
msgstr "Service instructeur :"
-#: templates/ishtar/sheet_file.html:68
+#: templates/ishtar/sheet_file.html:75
msgid "Permit type:"
msgstr "Type de permis :"
-#: templates/ishtar/sheet_file.html:69
+#: templates/ishtar/sheet_file.html:76
msgid "Permit reference:"
msgstr "Référence du permis :"
-#: templates/ishtar/sheet_file.html:70
+#: templates/ishtar/sheet_file.html:77
msgid "General contractor organisation:"
-msgstr "Aménageur (organisation) :"
+msgstr "Aménageur (organiation) :"
-#: templates/ishtar/sheet_file.html:71
+#: templates/ishtar/sheet_file.html:78
msgid "General contractor:"
msgstr "Aménageur :"
-#: templates/ishtar/sheet_file.html:76 templates/ishtar/sheet_file.html:77
-#: templates/ishtar/sheet_file.html:78 templates/ishtar/sheet_file.html:79
-#: templates/ishtar/sheet_file.html:85
+#: templates/ishtar/sheet_file.html:83 templates/ishtar/sheet_file.html:84
+#: templates/ishtar/sheet_file.html:85 templates/ishtar/sheet_file.html:86
+#: templates/ishtar/sheet_file.html:92
#: templates/ishtar/dashboards/dashboard_file.html:14
msgid ":"
msgstr " :"
-#: templates/ishtar/sheet_file.html:77
+#: templates/ishtar/sheet_file.html:84
msgid "Head scientist"
msgstr "Responsable scientifique"
-#: templates/ishtar/sheet_file.html:89
+#: templates/ishtar/sheet_file.html:96
msgid "Associated parcels"
msgstr "Opérations associées"
-#: templates/ishtar/sheet_file.html:92
+#: templates/ishtar/sheet_file.html:99
msgid "Administrativ acts"
-msgstr "Actes administratifs"
+msgstr "Actes administratif"
-#: templates/ishtar/sheet_file.html:99 templates/ishtar/sheet_file.html:127
+#: templates/ishtar/sheet_file.html:106 templates/ishtar/sheet_file.html:134
msgid "Ref."
msgstr "Ref."
-#: templates/ishtar/sheet_file.html:101 templates/ishtar/sheet_file.html:128
+#: templates/ishtar/sheet_file.html:108 templates/ishtar/sheet_file.html:135
msgid "Type"
msgstr "Type"
-#: templates/ishtar/sheet_file.html:103
+#: templates/ishtar/sheet_file.html:110
msgid "Start date"
msgstr "Date de début"
-#: templates/ishtar/sheet_file.html:104
+#: templates/ishtar/sheet_file.html:111
msgid "Excavation end date"
msgstr "Date de fin de chantier"
-#: templates/ishtar/sheet_file.html:116
+#: templates/ishtar/sheet_file.html:123
msgid "Details"
msgstr "Détails"
-#: templates/ishtar/sheet_file.html:119
+#: templates/ishtar/sheet_file.html:126
msgid "No operation associated to this archaelogical file"
msgstr "Pas d'opération associée à ce dossier archéologique"
-#: templates/ishtar/sheet_file.html:124
+#: templates/ishtar/sheet_file.html:131
msgid "Admninistrative acts linked to associated operations"
-msgstr "Actes administratifs associés à ces opérations"
+msgstr "Actes administratifs associé à ces opérations"
-#: templates/ishtar/sheet_file.html:129
+#: templates/ishtar/sheet_file.html:136
msgid "Date"
msgstr "Date"
-#: templates/ishtar/sheet_file.html:139
+#: templates/ishtar/sheet_file.html:146
msgid "No administrative act linked to operations"
msgstr "Pas d'acte administratif associé à ces opérations"
@@ -697,9 +713,6 @@ msgstr "Principales communes en surface (ha)"
#~ msgid "Creation date before"
#~ msgstr "Date de création avant"
-#~ msgid "Town"
-#~ msgstr "Commune"
-
#~ msgid "Section"
#~ msgstr "Section"
diff --git a/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py b/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py
new file mode 100644
index 000000000..f68da341d
--- /dev/null
+++ b/archaeological_files/migrations/0021_auto__chg_field_saisinetype_txt_idx__chg_field_filetype_txt_idx__del_f.py
@@ -0,0 +1,442 @@
+# -*- 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):
+
+ for file in orm['archaeological_files.File'].objects.all():
+ if file.towns.count() == 1:
+ file.main_town = file.towns.all()[0]
+ file.save()
+
+ for file in orm['archaeological_files.File'].objects.all():
+ address_comp = file.address_complement.strip()
+ if not address_comp:
+ continue
+ address = file.address.strip()
+ if address:
+ address += """
+"""
+ address += address_comp
+ file.address = address
+ file.save()
+
+ # Changing field 'SaisineType.txt_idx'
+ db.alter_column('archaeological_files_saisinetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'FileType.txt_idx'
+ db.alter_column('archaeological_files_filetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+ # Deleting field 'File.address_complement'
+ db.delete_column('archaeological_files_file', 'address_complement')
+
+ # Adding field 'File.raw_general_contractor'
+ db.add_column('archaeological_files_file', 'raw_general_contractor',
+ self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'File.raw_town_planning_service'
+ db.add_column('archaeological_files_file', 'raw_town_planning_service',
+ self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'File.main_town'
+ db.add_column('archaeological_files_file', 'main_town',
+ self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='file_main', null=True, to=orm['ishtar_common.Town']),
+ keep_default=False)
+
+ # Adding field 'File.instruction_deadline'
+ db.add_column('archaeological_files_file', 'instruction_deadline',
+ self.gf('django.db.models.fields.DateField')(null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'File.locality'
+ db.add_column('archaeological_files_file', 'locality',
+ self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),
+ keep_default=False)
+
+ # Deleting field 'HistoricalFile.address_complement'
+ db.delete_column('archaeological_files_historicalfile', 'address_complement')
+
+ # Adding field 'HistoricalFile.raw_general_contractor'
+ db.add_column('archaeological_files_historicalfile', 'raw_general_contractor',
+ self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'HistoricalFile.raw_town_planning_service'
+ db.add_column('archaeological_files_historicalfile', 'raw_town_planning_service',
+ self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'HistoricalFile.main_town_id'
+ db.add_column('archaeological_files_historicalfile', 'main_town_id',
+ self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'HistoricalFile.instruction_deadline'
+ db.add_column('archaeological_files_historicalfile', 'instruction_deadline',
+ self.gf('django.db.models.fields.DateField')(null=True, blank=True),
+ keep_default=False)
+
+ # Adding field 'HistoricalFile.locality'
+ db.add_column('archaeological_files_historicalfile', 'locality',
+ self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),
+ keep_default=False)
+
+
+ # Changing field 'PermitType.txt_idx'
+ db.alter_column('archaeological_files_permittype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ def backwards(self, orm):
+
+ # Changing field 'SaisineType.txt_idx'
+ db.alter_column('archaeological_files_saisinetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'FileType.txt_idx'
+ db.alter_column('archaeological_files_filetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+ # Adding field 'File.address_complement'
+ db.add_column('archaeological_files_file', 'address_complement',
+ self.gf('django.db.models.fields.TextField')(null=True, blank=True),
+ keep_default=False)
+
+ # Deleting field 'File.raw_general_contractor'
+ db.delete_column('archaeological_files_file', 'raw_general_contractor')
+
+ # Deleting field 'File.raw_town_planning_service'
+ db.delete_column('archaeological_files_file', 'raw_town_planning_service')
+
+ # Deleting field 'File.main_town'
+ db.delete_column('archaeological_files_file', 'main_town_id')
+
+ # Deleting field 'File.instruction_deadline'
+ db.delete_column('archaeological_files_file', 'instruction_deadline')
+
+ # Deleting field 'File.locality'
+ db.delete_column('archaeological_files_file', 'locality')
+
+ # Adding field 'HistoricalFile.address_complement'
+ db.add_column('archaeological_files_historicalfile', 'address_complement',
+ self.gf('django.db.models.fields.TextField')(null=True, blank=True),
+ keep_default=False)
+
+ # Deleting field 'HistoricalFile.raw_general_contractor'
+ db.delete_column('archaeological_files_historicalfile', 'raw_general_contractor')
+
+ # Deleting field 'HistoricalFile.raw_town_planning_service'
+ db.delete_column('archaeological_files_historicalfile', 'raw_town_planning_service')
+
+ # Deleting field 'HistoricalFile.main_town_id'
+ db.delete_column('archaeological_files_historicalfile', 'main_town_id')
+
+ # Deleting field 'HistoricalFile.instruction_deadline'
+ db.delete_column('archaeological_files_historicalfile', 'instruction_deadline')
+
+ # Deleting field 'HistoricalFile.locality'
+ db.delete_column('archaeological_files_historicalfile', 'locality')
+
+
+ # Changing field 'PermitType.txt_idx'
+ db.alter_column('archaeological_files_permittype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ models = {
+ 'archaeological_files.file': {
+ 'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'},
+ 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', '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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'", '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.CharField', [], {'max_length': '100', '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.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'}),
+ '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'}),
+ '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'}),
+ 'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_operations.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'", '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'total_surface': ('django.db.models.fields.IntegerField', [], {'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': '2015'})
+ },
+ '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': {'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.historicalfile': {
+ 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFile'},
+ 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', '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'}),
+ '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_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'}),
+ 'imported_line': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ '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_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ '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.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'numeric_reference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'organization_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ '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'}),
+ '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'}),
+ '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'}),
+ 'requested_operation_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'research_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'responsible_town_planning_service_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'}),
+ 'scientist_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'}),
+ 'year': ('django.db.models.fields.IntegerField', [], {'default': '2015'})
+ },
+ '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.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'})
+ },
+ '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'}),
+ 'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'})
+ },
+ 'ishtar_common.import': {
+ 'Meta': {'object_name': 'Import'},
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}),
+ 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', '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.importertype': {
+ 'Meta': {'object_name': 'ImporterType'},
+ 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ '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'}),
+ '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']},
+ '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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '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'}),
+ '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']"}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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'}),
+ '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'}),
+ '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'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2', '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.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.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'})
+ }
+ }
+
+ complete_apps = ['archaeological_files']
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index a1b42f722..2b0b299ec 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -46,7 +46,7 @@ class FileType(GeneralType):
try:
preventive = FileType.objects.get(txt_idx=key).pk
return file_type_id == preventive
- except ObjectDoesNotExist:
+ except FileType.DoesNotExist:
return False
class PermitType(GeneralType):
@@ -57,7 +57,7 @@ class PermitType(GeneralType):
if settings.COUNTRY == 'fr':
class SaisineType(GeneralType, ValueGetter):
- delay = models.IntegerField(_(u"Delay (in days)"))
+ delay = models.IntegerField(_(u"Delay (in days)"), default=30)
class Meta:
verbose_name = u"Type Saisine"
verbose_name_plural = u"Types Saisine"
@@ -83,16 +83,23 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
related_name='general_contractor',
verbose_name=_(u"General contractor"), blank=True, null=True,
on_delete=models.SET_NULL,) # aménageur
+ raw_general_contractor = models.CharField(_(u"General contractor (raw)"),
+ max_length=200, blank=True, null=True)
responsible_town_planning_service = models.ForeignKey(Person,
related_name='responsible_town_planning_service',
blank=True, null=True,
verbose_name=_(u"Responsible for town planning service"),
on_delete=models.SET_NULL,) # service instructeur
+ raw_town_planning_service = models.CharField(
+ _(u"Town planning service (raw)"), max_length=200,
+ blank=True, null=True)
permit_type = models.ForeignKey(PermitType, verbose_name=_(u"Permit type"),
blank=True, null=True)
permit_reference = models.CharField(_(u"Permit reference"),
max_length=60, blank=True, null=True)
end_date = models.DateField(_(u"Closing date"), null=True, blank=True)
+ main_town = models.ForeignKey(Town, verbose_name=_(u"Town"), null=True,
+ blank=True, related_name='file_main')
towns = models.ManyToManyField(Town, verbose_name=_(u"Towns"),
related_name='file')
creation_date = models.DateField(_(u"Creation date"),
@@ -106,13 +113,15 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
verbose_name= u"Type de saisine")
reference_number = models.IntegerField(_(u"Ref. number"),
blank=True, null=True)
+ instruction_deadline = models.DateField(_(u'Instruction deadline'),
+ blank=True, null=True)
total_surface = models.IntegerField(_(u"Total surface (m²)"),
blank=True, null=True)
total_developed_surface = models.IntegerField(
_(u"Total developed surface (m²)"), blank=True, null=True)
+ locality = models.CharField(_(u"Locality"),
+ max_length=100, null=True, blank=True)
address = models.TextField(_(u"Main address"), null=True, blank=True)
- address_complement = models.TextField(_(u"Main address - complement"),
- null=True, blank=True)
postal_code = models.CharField(_(u"Main address - postal code"),
max_length=10, null=True, blank=True)
comment = models.TextField(_(u"Comment"), null=True, blank=True)
@@ -253,7 +262,7 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
@property
def reference(self):
- return u"-".join((unicode(self.year),
+ return settings.FILE_PREFIX+u"-".join((unicode(self.year),
unicode(self.numeric_reference or '0')))
def _generate_cached_label(self):
@@ -268,7 +277,9 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
def get_town_label(self):
lbl = unicode(_('Intercommunal'))
- if self.towns.count() == 1:
+ if self.main_town:
+ lbl = self.main_town.name
+ elif self.towns.count() == 1:
lbl = self.towns.all()[0].name
return lbl
@@ -315,8 +326,43 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
acts.append(act)
return acts
+ def update_raw_town_planning_service(self):
+ if (self.raw_town_planning_service and not \
+ self.responsible_town_planning_service) or \
+ not self.responsible_town_planning_service:
+ return False
+ current_lbl = ""
+ if self.raw_town_planning_service:
+ current_lbl = self.raw_town_planning_service[:]
+ lbl = unicode(self.responsible_town_planning_service)
+ if not lbl:
+ return False
+ self.raw_town_planning_service = lbl[:200]
+ return current_lbl != self.raw_town_planning_service
+
+ def update_raw_general_contractor(self):
+ if (self.raw_general_contractor and not \
+ self.general_contractor) or \
+ not self.general_contractor:
+ return False
+ current_lbl = ""
+ if self.raw_general_contractor:
+ current_lbl = self.raw_general_contractor[:]
+ lbl = unicode(self.general_contractor)
+ if not lbl:
+ return False
+ self.raw_general_contractor = lbl[:200]
+ return current_lbl != self.raw_general_contractor
+
+
def save(self, *args, **kwargs):
returned = super(File, self).save(*args, **kwargs)
+ if self.main_town and not self.main_town in list(self.towns.all()):
+ self.towns.add(self.main_town)
+ updated = self.update_raw_town_planning_service()
+ updated += self.update_raw_general_contractor()
+ if updated:
+ self.save()
self.update_delay_date()
self.update_short_menu_class()
return returned
diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html
index 11a90df9e..2d7b6262d 100644
--- a/archaeological_files/templates/ishtar/sheet_file.html
+++ b/archaeological_files/templates/ishtar/sheet_file.html
@@ -20,7 +20,14 @@
</div>
{% endif %}
<div class='tool'>{%trans "Export as:"%} <a href='{% url show-file item.pk "odt" %}'>{%trans "OpenOffice.org file"%}</a>, <a href='{% url show-file item.pk "pdf" %}'>{%trans "PDF file"%}</a></div>
+<hr/>
<div class='tool modify'><a href='{% url file_modify item.pk %}'>{% trans "Modify" %}</a></div>
+
+{% if can_add_operation %}
+<div class='tool modify'><a href='{% url operation_add item.pk %}'>{%trans "Add an associated archaeological operation"%}</a></div>
+
+{%endif%}
+
<h3>{% trans "General"%}</h3>
<p><label>{%trans "Year:"%}</label> <span class='value strong'>{{ item.year }}</span></p>
{% if item.numeric_reference %}<p><label>{%trans "Numerical reference:"%}</label> <span class='value strong'>{{ item.numeric_reference }}</span></p>{% endif %}
@@ -95,7 +102,6 @@
<table>
<caption>{%trans "Associated operations"%}</caption>
<tr>
- <th>{% trans "Year" %}</th>
<th>{% trans "Ref." %}</th>
<th>Code Patriarche</th>
<th>{% trans "Type" %}</th>
@@ -106,9 +112,8 @@
</tr>
{% for operation in item.operations.all %}
<tr>
- <td>{{operation.year}}</td>
- <td>{{operation.operation_code}}</td>
- <td>{{operation.code_patriarche|default:""}}</td>
+ <td>{{operation.year_index}}</td>
+ <td>{{operation.full_code_patriarche|default:""}}</td>
<td class='string'>{{operation.operation_type}}</td>
<td class='string'>{{operation.in_charge|default:""}}</td>
<td>{{operation.start_date|default:""}}</td>
diff --git a/archaeological_files/urls.py b/archaeological_files/urls.py
index 694cb1791..f7f5cc7d5 100644
--- a/archaeological_files/urls.py
+++ b/archaeological_files/urls.py
@@ -23,6 +23,9 @@ import views
# forms:
urlpatterns = patterns('',
+ url(r'file_administrativeactfile_search/(?P<step>.+)?$',
+ views.file_administrativeactfile_search_wizard,
+ name='file_administrativeactfile_search'),
url(r'file_administrativeactfile/(?P<step>.+)?$',
views.file_administrativeactfile_wizard,
name='file_administrativeactfile'),
diff --git a/archaeological_files/views.py b/archaeological_files/views.py
index ba640a785..942ee6ae3 100644
--- a/archaeological_files/views.py
+++ b/archaeological_files/views.py
@@ -28,6 +28,7 @@ from django.utils.translation import ugettext_lazy as _
from ishtar_common.views import get_item, show_item, revert_item
from ishtar_common.models import Person
+from archaeological_operations.models import Operation
import models
from ishtar_common.wizards import SearchWizard
@@ -85,9 +86,17 @@ get_file = get_item(models.File, 'get_file', 'file',
'general_contractor__attached_to':'general_contractor__attached_to__pk',
'history_creator':'history_creator__ishtaruser__person__pk',
},)
-show_file = show_item(models.File, 'file')
revert_file = revert_item(models.File)
+def extra_file_dct(request, item):
+ dct = {}
+ if (request.user.has_perm('ishtar_common.add_operation', Operation)
+ or request.user.ishtaruser.has_right('add_operation')):
+ dct['can_add_operation'] = True
+ return dct
+
+show_file = show_item(models.File, 'file', extra_dct=extra_file_dct)
+
get_administrativeactfile = get_item(AdministrativeAct,
'get_administrativeactfile', 'administrativeactfile',
associated_models = [(models.File, 'associated_file'),
@@ -179,6 +188,12 @@ file_deletion_wizard = FileDeletionWizard.as_view([
label=_(u"File deletion"),
url_name='file_deletion',)
+file_administrativeactfile_search_wizard = SearchWizard.as_view([
+ ('selec-file_administrativeactfile_search',
+ AdministrativeActFileFormSelection)],
+ label=_(u"File: search administrative act"),
+ url_name='file_administrativeactfile_search',)
+
file_administrativeactfile_wizard = FileAdministrativeActWizard.as_view([
('selec-file_administrativeactfile', FileFormSelection),
('administrativeact-file_administrativeactfile',
@@ -206,3 +221,16 @@ file_administrativeactfile_deletion_wizard = \
label=_(u"File: administrative act deletion"),
url_name='file_administrativeactfile_deletion',)
+def reset_wizards(request):
+ for wizard_class, url_name in (
+ (FileWizard, 'file_creation'),
+ (FileModificationWizard, 'file_modification'),
+ (FileClosingWizard, 'file_modification'),
+ (FileDeletionWizard, 'file_deletion'),
+ (FileAdministrativeActWizard, 'file_administrativeactfile'),
+ (FileEditAdministrativeActWizard,
+ 'file_administrativeactfile_modification_wizard'),
+ (AdministrativeActDeletionWizard,
+ 'file_administrativeactfile_deletion_wizard'),
+ ):
+ wizard_class.session_reset(request, url_name)
diff --git a/archaeological_files/wizards.py b/archaeological_files/wizards.py
index 4ad947641..3ccd6e3d9 100644
--- a/archaeological_files/wizards.py
+++ b/archaeological_files/wizards.py
@@ -38,8 +38,10 @@ class FileWizard(OperationWizard):
model = models.File
object_parcel_type = 'associated_file'
parcel_step_key = 'parcels-'
+ town_step_keys = ['towns-']
wizard_done_window = reverse_lazy('show-file')
+ '''
def get_form(self, step=None, data=None, files=None):
"""
Manage towns
@@ -53,8 +55,10 @@ class FileWizard(OperationWizard):
# step = self.determine_step(request, storage)
step = self.steps.current
form = self.get_form_list()[step]
- town_form_key = 'towns-' + self.url_name
- if step.startswith('parcels-') and hasattr(form, 'management_form') \
+ town_form_key = self.town_step_key
+ town_form_key += self.url_name
+ if step.startswith(self.parcel_step_key) \
+ and hasattr(form, 'management_form') \
and self.session_has_key(town_form_key):
towns = []
qdict = self.request.session[self.storage.prefix]['step_data']\
@@ -68,7 +72,9 @@ class FileWizard(OperationWizard):
pass
data['TOWNS'] = sorted(towns, key=lambda x:x[1])
form = super(FileWizard, self).get_form(step, data, files)
+ """
return form
+ '''
def get_extra_model(self, dct, form_list):
dct = super(FileWizard, self).get_extra_model(dct, form_list)
diff --git a/archaeological_files_pdl/forms.py b/archaeological_files_pdl/forms.py
index 87221f24c..53d473b96 100644
--- a/archaeological_files_pdl/forms.py
+++ b/archaeological_files_pdl/forms.py
@@ -21,20 +21,22 @@ import datetime
from django import forms
from django.core import validators
+from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
-from ishtar_common.models import Person
+from ishtar_common.models import Person, PersonType, valid_id
from archaeological_files import models
-from ishtar_common.forms import get_now
+from ishtar_common.forms import get_now, reverse_lazy
+from ishtar_common.forms_common import get_advanced_town_field
+from archaeological_files.forms import GENERAL_CONTRACTOR, \
+ RESPONSIBLE_PLANNING_SERVICE
from ishtar_common import widgets
class FileFormGeneral(forms.Form):
form_label = _("General")
- associated_models = {'in_charge':Person,
- 'related_file':models.File,
- 'file_type':models.FileType}
+ associated_models = {'file_type':models.FileType}
file_type = forms.ChoiceField(label=_("File type"), choices=[])
year = forms.IntegerField(label=_("Year"),
initial=lambda:datetime.datetime.now().year,
@@ -43,9 +45,203 @@ class FileFormGeneral(forms.Form):
creation_date = forms.DateField(label=_(u"Creation date"),
initial=get_now, widget=widgets.JQueryDate)
reception_date = forms.DateField(label=_(u"Reception date"),
- initial=get_now, widget=widgets.JQueryDate)
+ widget=widgets.JQueryDate)
def __init__(self, *args, **kwargs):
super(FileFormGeneral, self).__init__(*args, **kwargs)
self.fields['file_type'].choices = models.FileType.get_types()
self.fields['file_type'].help_text = models.FileType.get_help()
+
+class FileFormPreventiveType(forms.Form):
+ form_label = u"Saisine"
+ associated_models = {'saisine_type':models.SaisineType,
+ 'permit_type':models.PermitType}
+ permit_type = forms.ChoiceField(label=_(u"Permit type"), required=False,
+ choices=[])
+ saisine_type = forms.ChoiceField(label=_(u"Saisine type"),
+ choices=[])
+ def __init__(self, *args, **kwargs):
+ super(FileFormPreventiveType, self).__init__(*args, **kwargs)
+ self.fields['saisine_type'].choices = models.SaisineType.get_types()
+ self.fields['saisine_type'].help_text = models.SaisineType.get_help()
+ self.fields['permit_type'].choices = models.PermitType.get_types(
+ default='NP')
+ self.fields['permit_type'].help_text = models.PermitType.get_help()
+
+class FileFormPlanning(forms.Form):
+ form_label = _(u"Planning")
+ associated_models = {'main_town':models.Town}
+ name = forms.CharField(label=_(u"Planning name"), required=False,
+ max_length=100)
+ main_town = get_advanced_town_field(required=True)
+ locality = forms.CharField(label=_(u"Locality"), max_length=100,
+ required=False)
+ address = forms.CharField(label=_(u"Address (number/street)"),
+ widget=forms.Textarea(
+ attrs={"placeholder":_(u"Number/street")}),
+ required=False,
+ )
+ postal_code = forms.CharField(label=_(u"Postal code"), max_length=10,
+ required=False)
+ total_surface = forms.IntegerField(required=False,
+ widget=widgets.AreaWidget,
+ label=_(u"Total surface (m²)"),
+ validators=[validators.MinValueValidator(0),
+ validators.MaxValueValidator(999999999)])
+ total_developed_surface = forms.IntegerField(widget=widgets.AreaWidget,
+ label=_(u"Total developed surface (m²)"),
+ required=False, validators=[validators.MinValueValidator(0),
+ validators.MaxValueValidator(999999999)])
+
+class FileFormResearchAddress(forms.Form):
+ form_label = _(u"Address")
+ associated_models = {'main_town':models.Town}
+ main_town = get_advanced_town_field(required=True)
+ locality = forms.CharField(label=_(u"Locality"), max_length=100,
+ required=False)
+ address = forms.CharField(label=_(u"Address (number/street)"),
+ widget=forms.Textarea(
+ attrs={"placeholder":_(u"Number/street")}),
+ required=False,
+ )
+ postal_code = forms.CharField(label=_(u"Postal code"), max_length=10,
+ required=False)
+
+class PersonOrgaForm(forms.Form):
+ PERSON_FIELD = 'TO BE DEFINED'
+ ORGA_FIELD = 'TO BE DEFINED'
+ PERSON_TYPE = GENERAL_CONTRACTOR
+
+ def _media(self):
+ if self.status == 'corporation':
+ return forms.Media(js=('pdl/JQueryCorporation.js',))
+ media = property(_media)
+
+ def __init__(self, *args, **kwargs):
+
+ # get the status: natural person or corporation
+ DEFAULT_STATUS = 'natural'
+ current_status = ''
+ if 'data' in kwargs:
+ current_item_key = ((kwargs['prefix'] + '-') if kwargs.get('prefix')\
+ else '') + self.PERSON_FIELD
+ if kwargs['data'] and kwargs['data'].get(current_item_key):
+ model = self.associated_models[self.PERSON_FIELD]
+ try:
+ item = model.objects.get(pk=kwargs['data'][current_item_key])
+ current_status = 'natural'
+ except (model.DoesNotExist, ValueError):
+ pass
+ current_item_key = ((kwargs['prefix'] + '-') if kwargs.get('prefix')\
+ else '') + self.ORGA_FIELD
+ if kwargs['data'] and kwargs['data'].get(current_item_key):
+ current_status = 'corporation'
+
+ status = ''
+ if 'status' in kwargs:
+ status = kwargs.pop('status')
+ if current_status != status:
+ if kwargs.get('data'):
+ # status is different from the existing - clear fields
+ kwargs.pop('data')
+ elif current_status:
+ status = current_status
+ else:
+ status = DEFAULT_STATUS
+
+ self.status = status
+
+ if status not in ('natural', 'corporation'):
+ status = DEFAULT_STATUS
+ super(PersonOrgaForm, self).__init__(*args, **kwargs)
+
+ # distinct widget for natural and corporation
+ if status == 'natural':
+ self.fields[self.PERSON_FIELD] = forms.IntegerField(
+ label=self.fields[self.ORGA_FIELD].label,
+ required=False,
+ widget=widgets.JQueryPersonOrganization(
+ reverse_lazy('autocomplete-person',
+ args=[self.PERSON_TYPE.pk]),
+ reverse_lazy('person_create'),
+ model=Person,
+ limit={'person_types':[self.PERSON_TYPE.pk],
+ 'attached_to__isnull':True},
+ js_template='ishtar/blocks/JQueryNaturalPerson.js',
+ new=True),
+ validators=[valid_id(Person)])
+
+class FileFormGeneralContractor(PersonOrgaForm):
+ form_label = _(u"General contractor")
+ associated_models = {'general_contractor':models.Person}
+ raw_general_contractor = forms.CharField(label=_(u"General contractor"),
+ required=False, max_length=200)
+ PERSON_FIELD = 'general_contractor'
+ ORGA_FIELD = 'raw_general_contractor'
+ PERSON_TYPE = GENERAL_CONTRACTOR
+
+class FileFormPlanningService(PersonOrgaForm):
+ form_label = _(u"Town planning service")
+ associated_models = {'responsible_town_planning_service':models.Person}
+
+ reference_number = forms.IntegerField(label=_(u"File reference"),
+ required=False)
+ raw_town_planning_service = forms.CharField(
+ label=_(u"Responsible town planning service"), required=False,
+ max_length=200)
+ PERSON_FIELD = 'responsible_town_planning_service'
+ ORGA_FIELD = 'raw_town_planning_service'
+ PERSON_TYPE = RESPONSIBLE_PLANNING_SERVICE
+
+ def __init__(self, *args, **kwargs):
+ super(FileFormPlanningService, self).__init__(*args, **kwargs)
+ self.fields.keyOrder = []
+ if self.ORGA_FIELD in self.fields:
+ self.fields.keyOrder.append(self.ORGA_FIELD)
+ elif self.PERSON_FIELD in self.fields:
+ self.fields.keyOrder.append(self.PERSON_FIELD)
+ self.fields.keyOrder.append('reference_number')
+
+class FileFormInstruction(forms.Form):
+ form_label = u"Instruction SRA"
+ associated_models = {'in_charge':models.Person}
+ in_charge = forms.IntegerField(label=_("Person in charge"),
+ widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-person',
+ args=[PersonType.objects.get(txt_idx='sra_agent').pk]),
+ limit={'person_types':[PersonType.objects.get(txt_idx='sra_agent').pk]},
+ associated_model=Person, new=True),
+ validators=[valid_id(Person)])
+ related_file = forms.IntegerField(label=_("Related file"), required=False,
+ widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-file'),
+ associated_model=models.File),
+ validators=[valid_id(models.File)])
+ comment = forms.CharField(label=_(u"Comment"), widget=forms.Textarea,
+ required=False)
+ instruction_deadline = forms.DateField(widget=widgets.JQueryDate,
+ required=False)
+ year = forms.IntegerField(label=_("Year"),
+ validators=[validators.MinValueValidator(1900),
+ validators.MaxValueValidator(2100)])
+ numeric_reference = forms.IntegerField(label=_("Numeric reference"),
+ required=False)
+ end_date = forms.DateField(initial=get_now, widget=widgets.JQueryDate,
+ required=False)
+
+ def __init__(self, *args, **kwargs):
+ c_year = datetime.date.today().year
+ if 'year' in kwargs:
+ c_year = kwargs.pop('year')
+ super(FileFormInstruction, self).__init__(*args, **kwargs)
+ self.fields['year'].initial = c_year
+ self.fields['year'].widget.attrs.update({'readonly':'readonly'})
+ c_num, lasts = 0, ""
+ q = models.File.objects.filter(numeric_reference__isnull=False,
+ year=c_year).order_by('-numeric_reference')
+ if q.count():
+ num = q.all()[0].numeric_reference
+ lasts = u"SRA %s-%d" % (unicode(c_year), num)
+ lbl = self.fields['numeric_reference'].label
+ if lasts:
+ lbl += u"<br/>(dernière entrée : %s)" % lasts
+ self.fields['numeric_reference'].label = mark_safe(lbl)
+ self.fields['numeric_reference'].initial = c_num + 1
diff --git a/archaeological_files_pdl/locale/fr/LC_MESSAGES/django.po b/archaeological_files_pdl/locale/fr/LC_MESSAGES/django.po
new file mode 100644
index 000000000..5d8feb4ab
--- /dev/null
+++ b/archaeological_files_pdl/locale/fr/LC_MESSAGES/django.po
@@ -0,0 +1,139 @@
+# Ishtar po translation.
+# Copyright (C) 2014
+# This file is distributed under the same license as the Ishtar package.
+# Étienne Loks <etienne.loks at peacefrogs net>, 2014.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: stable\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-12-31 12:09+0100\n"
+"PO-Revision-Date: 2014-12-31 12:09+0100\n"
+"Last-Translator: Étienne Loks <etienne.loks at peacefrogs net>\n"
+"Language-Team: \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1)\n"
+
+#: forms.py:38
+msgid "General"
+msgstr "Général"
+
+#: forms.py:40
+msgid "File type"
+msgstr "Type de dossier"
+
+#: forms.py:41 forms.py:199
+msgid "Year"
+msgstr "Année"
+
+#: forms.py:45
+msgid "Creation date"
+msgstr "Date de création"
+
+#: forms.py:47
+msgid "Reception date"
+msgstr "Date de réception"
+
+#: forms.py:59
+msgid "Permit type"
+msgstr "Type de permis"
+
+#: forms.py:61
+msgid "Saisine type"
+msgstr "Type de saisine"
+
+#: forms.py:72
+msgid "Planning"
+msgstr "Aménagement"
+
+#: forms.py:74
+msgid "Planning name"
+msgstr "Nom de l'aménagement"
+
+#: forms.py:77
+msgid "Locality"
+msgstr "Lieu-dit"
+
+#: forms.py:79
+msgid "Address (number/street)"
+msgstr "Adresse (n° / voie)"
+
+#: forms.py:81
+msgid "Number/street"
+msgstr "n° / voie"
+
+#: forms.py:84
+msgid "Postal code"
+msgstr "Code postal"
+
+#: forms.py:88
+msgid "Total surface (m²)"
+msgstr "Surface totale des terrains (m²)"
+
+#: forms.py:92
+msgid "Total developed surface (m²)"
+msgstr "Surface totale aménagée (m²)"
+
+#: forms.py:97 forms.py:136 forms.py:149
+msgid "General contractor"
+msgstr "Aménageur"
+
+#: forms.py:161
+msgid "Town planning service"
+msgstr "Service instructeur"
+
+#: forms.py:163
+msgid "File reference"
+msgstr "Référence du dossier"
+
+#: forms.py:169
+msgid "Responsible town planning service"
+msgstr "Dossier suivi par"
+
+#: forms.py:185
+msgid "Person in charge"
+msgstr "Dossier suivi par"
+
+#: forms.py:191
+msgid "Related file"
+msgstr "Dossier lié à"
+
+#: forms.py:195
+msgid "Comment"
+msgstr "Commentaire"
+
+#: forms.py:202
+msgid "Numeric reference"
+msgstr "Référence numérique"
+
+#: views.py:46
+msgid "New file"
+msgstr "Nouveau dossier"
+
+#: views.py:58 views.py:61
+msgid "File followed by"
+msgstr "Dossier suivi par"
+
+#: templates/ishtar/wizard/wizard_generalcontractor.html:12
+msgid "Corporation"
+msgstr "Personne morale"
+
+#: templates/ishtar/wizard/wizard_generalcontractor.html:16
+msgid "Natural person"
+msgstr "Personne physique"
+
+#: templates/ishtar/wizard/wizard_generalcontractor.html:27
+#: templates/ishtar/wizard/wizard_instruction.html:60
+#: templates/ishtar/wizard/wizard_preventiveplanning.html:76
+msgid "Validate"
+msgstr "Validation"
+
+#: templates/ishtar/wizard/wizard_generalcontractor.html:28
+#: templates/ishtar/wizard/wizard_instruction.html:61
+#: templates/ishtar/wizard/wizard_preventiveplanning.html:77
+msgid "Validate and end"
+msgstr "Terminer"
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js
new file mode 100644
index 000000000..3eb375167
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryCorporationPerson.js
@@ -0,0 +1,2 @@
+var current_status = 'corporation';
+{% include "ishtar/blocks/JQueryPersonOrga.js" %}
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js
new file mode 100644
index 000000000..fc4b9a90c
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryNaturalPerson.js
@@ -0,0 +1,2 @@
+var current_status = 'natural';
+{% include "ishtar/blocks/JQueryPersonOrga.js" %}
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js
new file mode 100644
index 000000000..c151a5e4d
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js
@@ -0,0 +1,65 @@
+person_save_callback = function(item_id, lbl){
+ var url = {{edit_source}};
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(lbl);
+ if (item_id){
+ url = {{edit_source}}+item_id;
+ $('#id_{{field_id}}').val(item_id);
+ }
+ $("#id_select_{{field_id}}").trigger('autocompletechange');
+ $.get(url , function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+};
+
+edit_url = {{edit_source}};
+parent_id = "{{field_id}}";
+
+person_new_callback = function(){
+ var url = {{edit_source}};
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+}
+
+$(function() {
+ var $radios = $('input:radio[name=person_type]');
+ if($radios.is(':checked') === false) {
+ $radios.filter('[value='+ current_status +']').prop('checked', true);
+ }
+
+ $radios.change(function(){
+ var loc = window.location;
+ window.location = loc.protocol + '//' + loc.host + loc.pathname + "?status=" + $('input:radio[name=person_type]:checked').val();
+ });
+
+ $("#id_select_{{field_id}}").autocomplete({
+ source: {{source}},
+ select: function( event, ui ) {
+ var url = {{edit_source}};
+ if(ui.item){
+ url = {{edit_source}}+ui.item.id;
+ $('#id_{{field_id}}').val(ui.item.id);
+ } else {
+ $('#id_{{field_id}}').val(null);
+ }
+ $.get(url , function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+ },
+ minLength: 2{% if options %},
+ {{options}}
+ {% endif %}
+ });
+
+ $.get( {{edit_source}}{% if selected %}+'{{selected}}'{% endif %}, function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+
+ $('#id_select_{{field_id}}').live('click', function(){
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+ $.get( {{edit_source}}, function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+ });
+});
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html
new file mode 100644
index 000000000..e43e336c4
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_generalcontractor.html
@@ -0,0 +1,15 @@
+{% extends "ishtar/wizard/wizard_person_orga.html" %}
+
+{% block corporation %}
+ <tr class='required'>
+ <th>{{ wizard.form.raw_general_contractor.label_tag }}</th>
+ <td> {{ wizard.form.raw_general_contractor.errors }}{{wizard.form.raw_general_contractor|safe}}</td>
+ </tr>
+{% endblock %}
+
+{% block natural %}
+ <tr class='required'>
+ <th>{{ wizard.form.general_contractor.label_tag }}</th>
+ <td> {{ wizard.form.general_contractor.errors }}{{wizard.form.general_contractor|safe}}</td>
+ </tr>
+{% endblock %}
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html
new file mode 100644
index 000000000..4162a3764
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_instruction.html
@@ -0,0 +1,106 @@
+{% extends "ishtar/wizard/default_wizard.html" %}
+{% load i18n range table_form %}
+{% block wizard_form %}
+<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+<div class='form'>
+{{ wizard.form.media }}
+{{ wizard.management_form }}
+
+<table>
+
+<tr class='required'>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-in_charge">Dossier suivi par</label></th>
+</tr>
+<tr class='required'>
+ <td>{{wizard.form.in_charge.errors}}{{wizard.form.in_charge|safe}}</td>
+</tr>
+
+<tr>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-related_file">Dossier lié à</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.related_file|safe}}</td>
+</tr>
+
+<tr>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-comment">Commentaire</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.comment|safe}}</td>
+</tr>
+
+<tr class='required'>
+ <th><label>État du dossier</label></th>
+</tr>
+<tr>
+ <td><input type='radio' name='state' value='open' id='state-open'/> <label for='state-open'>Dossier actif</label></td>
+</tr>
+<tr>
+ <td><input type='radio' name='state' value='closed' id='state-closed'/> <label for='state-closed'>Dossier clos / date de clôture</label> : {{wizard.form.end_date|safe}}</td>
+</tr>
+
+<tr class='required'>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-instruction_deadline">Date limite d'instruction</label></th>
+</tr>
+<tr class='required'>
+ <td>{{wizard.form.instruction_deadline.errors}}{{wizard.form.instruction_deadline|safe}}</td>
+</tr>
+
+<tr class='required'>
+ <th><label for="id_instruction-{{CURRENT_ACTION}}-year">{{wizard.form.numeric_reference.label}}</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.numeric_reference.errors}}SRA <span class='small'>{{wizard.form.year|safe}}</span> - <span class='small'>{{wizard.form.numeric_reference|safe}}</span></td>
+</tr>
+</table>
+
+<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
+{{ previous_fields|safe }}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
+</div>
+</form>
+<script type='text/javascript'>
+$(function(){
+
+ if ($('#id_instruction-{{CURRENT_ACTION}}-end_date').val()){
+ $("#state-closed").prop('checked', true);
+ } else {
+ $("#state-open").prop('checked', true);
+ }
+
+ check_state = function(){
+ var state = $("input[name=state]:checked").val();
+ if (state == 'closed'){
+ $('#id_instruction-{{CURRENT_ACTION}}-end_date').focus();
+ $('#id_instruction-{{CURRENT_ACTION}}-end_date').prop('disabled', false);
+ } else if (state == 'open'){
+ $('#id_instruction-{{CURRENT_ACTION}}-end_date').val('');
+ $('#id_instruction-{{CURRENT_ACTION}}-end_date').prop('disabled', true);
+ }
+ };
+
+ $('input[name=state]').click(check_state);
+
+ check_state();
+
+ $('#submit_form').click(function(){
+ var state = $("input[name=state]:checked").val();
+ if (state == 'closed'){
+ if (!$('#id_instruction-{{CURRENT_ACTION}}-end_date').val()){
+ alert("Vous devez sélectionner une date de clôture.")
+ return false;
+ }
+ return true;
+ } else if (state == 'open'){
+ return true;
+ } else {
+ alert("Vous devez choisir un état pour ce dossier.")
+ return false;
+ }
+ return true;
+ });
+});
+</script>
+{% endblock %}
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html
new file mode 100644
index 000000000..91dd7e042
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_person_orga.html
@@ -0,0 +1,66 @@
+{% extends "ishtar/wizard/default_wizard.html" %}
+{% load i18n range table_form %}
+{% block wizard_form %}
+<script type='text/javascript'>
+function update_form(){
+ if ($('input[name="person_type"]:radio:checked').val() == 'corporation'){
+ $('#natural_div').hide();
+ $('#corporation_div').show();
+ } else {
+ $('#natural_div').show();
+ $('#corporation_div').hide();
+ }
+}
+$(function() {
+ update_form();
+});
+</script>
+<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+<div class='form'>
+{% if wizard.form.media %}{{ wizard.form.media }}{% endif %}
+{{ wizard.management_form }}
+
+<table class='formset'>
+ <caption>Statut</caption>
+ <tr>
+ <th><label>{% trans "Corporation" %}</label></th>
+ <td><input type='radio' name='person_type' value='corporation'/></td>
+ </tr>
+ <tr>
+ <th><label>{% trans "Natural person" %}</label></th>
+ <td><input type='radio' name='person_type' value='natural'/></td>
+ </tr>
+</table>
+
+<table id='corporation_div'>
+ {% if wizard.form.non_field_errors %}<tr class='errors'>
+ <td colspan='3'>{{wizard.form.non_field_errors}}</td>
+ </tr>{%endif%}
+
+{% block corporation %}
+{% endblock %}
+</table>
+
+<div id='natural_div'>
+<table>
+ {% if wizard.form.non_field_errors %}<tr class='errors'>
+ <td colspan='3'>{{wizard.form.non_field_errors}}</td>
+ </tr>{%endif%}
+
+{% block natural %}
+{% endblock %}
+</table>
+</div>
+
+{% block otherfields %}
+{% endblock %}
+
+<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
+{{ previous_fields|safe }}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
+</div>
+</form>
+{% endblock %}
+
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html
new file mode 100644
index 000000000..29bc2397c
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_planningservice.html
@@ -0,0 +1,15 @@
+{% extends "ishtar/wizard/wizard_person_orga.html" %}
+
+{% block corporation %}
+ <tr class='required'>
+ <th>{{ wizard.form.raw_town_planning_service.label_tag }}</th>
+ <td> {{ wizard.form.raw_town_planning_service.errors }}{{wizard.form.raw_town_planning_service|safe}}</td>
+ </tr>
+{% endblock %}
+
+{% block natural %}
+ <tr class='required'>
+ <th>{{ wizard.form.responsible_town_planning_service.label_tag }}</th>
+ <td> {{ wizard.form.responsible_town_planning_service.errors }}{{wizard.form.responsible_town_planning_service|safe}}</td>
+ </tr>
+{% endblock %}
diff --git a/archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html b/archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html
new file mode 100644
index 000000000..66569a66d
--- /dev/null
+++ b/archaeological_files_pdl/templates/ishtar/wizard/wizard_preventiveplanning.html
@@ -0,0 +1,80 @@
+{% extends "ishtar/wizard/default_wizard.html" %}
+{% load i18n range table_form %}
+{% block wizard_form %}
+<form action="." method="post" name='wizard'{% if wizard.form.file_upload %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
+<div class='form'>
+{{ wizard.form.media }}
+{{ wizard.management_form }}
+
+<table>
+
+<tr class='required'>
+ <th><label for="id_preventiveplanning-{{CURRENT_ACTION}}-name">Nom de l'aménagement</label></th>
+</tr>
+<tr class='required'>
+ <td>{{wizard.form.name|safe}}</td>
+</tr>
+
+</table>
+
+<h4>Localisation</h4>
+<table>
+
+{% if wizard.form.main_town.errors %}<tr>
+ <td colspan="2">{{wizard.form.main_town.errors}}</td>
+</tr>{% endif %}
+
+<tr>
+ <td>{{wizard.form.main_town|safe}}</td>
+</tr>
+
+<tr>
+ <th colspan='2'><label for="id_preventiveplanning-{{CURRENT_ACTION}}-locality">Lieu-dit</label></th>
+</tr>
+<tr>
+ <td colspan='2'>{{wizard.form.locality|safe}}</td>
+</tr>
+
+<tr>
+ <th colspan='2'><label for="id_preventiveplanning-{{CURRENT_ACTION}}-address">Adresse</label></th>
+</tr>
+<tr>
+ <td colspan='2'>{{wizard.form.address|safe}}</td>
+</tr>
+
+<tr>
+ <th colspan='2'><label for="id_preventiveplanning-{{CURRENT_ACTION}}-postal_code">Code postal</label></th>
+</tr>
+<tr>
+ <td colspan='2'>{{wizard.form.postal_code|safe}}</td>
+</tr>
+
+</table>
+
+<h4>Surfaces</h4>
+<table>
+
+<tr>
+ <th><label for="id_preventiveplanning-{{CURRENT_ACTION}}-total_surface">Surface totale des terrains</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.total_surface|safe}}</td>
+</tr>
+
+<tr>
+ <th><label for="id_preventiveplanning-{{CURRENT_ACTION}}-total_developed_surface">Surface totale aménagée</label></th>
+</tr>
+<tr>
+ <td>{{wizard.form.total_developed_surface|safe}}</td>
+</tr>
+
+</table>
+
+<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
+{{ previous_fields|safe }}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
+</div>
+</form>
+{% endblock %}
diff --git a/archaeological_files_pdl/urls.py b/archaeological_files_pdl/urls.py
index b6878e90b..4cd746e8a 100644
--- a/archaeological_files_pdl/urls.py
+++ b/archaeological_files_pdl/urls.py
@@ -24,4 +24,12 @@ from archaeological_files_pdl import views
urlpatterns = patterns('',
url(r'file_creation/(?P<step>.+)?$',
views.file_creation_wizard, name='file_creation'),
+ url(r'file_modification/(?P<step>.+)?$',
+ views.file_modification_wizard, name='file_modification'),
+ url(r'townplanning-edit/$',
+ views.TownPlanningCreate.as_view(),
+ name='townplanning_create'),
+ url(r'townplanning-edit/(?P<pk>\d+)$',
+ views.TownPlanningEdit.as_view(),
+ name='townplanning_edit'),
)
diff --git a/archaeological_files_pdl/views.py b/archaeological_files_pdl/views.py
index 7d51c8ec5..bcb1c0211 100644
--- a/archaeological_files_pdl/views.py
+++ b/archaeological_files_pdl/views.py
@@ -19,30 +19,81 @@
from django.utils.translation import ugettext_lazy as _
-from archaeological_files.wizards import FileWizard
+from archaeological_files_pdl.wizards import FileWizard, FileModificationWizard
from archaeological_operations.wizards import is_preventive, is_not_preventive
-from ishtar_common.forms_common import TownFormset
+from ishtar_common.views import OrganizationPersonCreate, OrganizationPersonEdit
+
from archaeological_files_pdl import forms
from archaeological_files import forms as ref_forms
from archaeological_operations.forms import ParcelFormSet
from archaeological_files import models
+
+file_creation_wizard_is_preventive = is_preventive('general-file_creation',
+ models.FileType, type_key='file_type')
+file_creation_wizard_is_not_preventive = is_not_preventive(
+ 'general-file_creation', models.FileType, type_key='file_type')
file_creation_wizard = FileWizard.as_view([
- ('general-file_creation', forms.FileFormGeneral),
- ('towns-file_creation', TownFormset),
- ('parcels-file_creation', ParcelFormSet),
- ('preventive-file_creation', ref_forms.FileFormPreventive),
- ('research-file_creation', ref_forms.FileFormResearch),
- ('final-file_creation', ref_forms.FinalForm)],
+ ('general-file_creation', forms.FileFormGeneral),
+ ('preventivetype-file_creation', forms.FileFormPreventiveType),
+ ('preventiveplanning-file_creation', forms.FileFormPlanning),
+ ('researchaddress-file_creation', forms.FileFormResearchAddress),
+ ('parcelspdl-file_creation', ParcelFormSet),
+ ('generalcontractor-file_creation',
+ forms.FileFormGeneralContractor),
+ ('planningservice-file_creation',
+ forms.FileFormPlanningService),
+ ('research-file_creation', ref_forms.FileFormResearch),
+ ('instruction-file_creation',
+ forms.FileFormInstruction),
+ ('final-file_creation', ref_forms.FinalForm)],
label=_(u"New file"),
condition_dict={
- 'preventive-file_creation':\
- is_preventive( 'general-file_creation', models.FileType,
- type_key='file_type'),
- 'research-file_creation':\
- is_not_preventive('general-file_creation', models.FileType,
- type_key='file_type'),
+ 'preventivetype-file_creation':file_creation_wizard_is_preventive,
+ 'preventiveplanning-file_creation':file_creation_wizard_is_preventive,
+ 'generalcontractor-file_creation':file_creation_wizard_is_preventive,
+ 'planningservice-file_creation':file_creation_wizard_is_preventive,
+ 'researchaddress-file_creation':file_creation_wizard_is_not_preventive,
+ 'research-file_creation':file_creation_wizard_is_not_preventive
},
url_name='file_creation',)
+
+file_modification_wizard_is_preventive = is_preventive('general-file_modification',
+ models.FileType, type_key='file_type')
+file_modification_wizard_is_not_preventive = is_not_preventive(
+ 'general-file_modification', models.FileType, type_key='file_type')
+file_modification_wizard = FileModificationWizard.as_view([
+ ('selec-file_modification', ref_forms.FileFormSelection),
+
+ ('general-file_modification', forms.FileFormGeneral),
+ ('preventivetype-file_modification', forms.FileFormPreventiveType),
+ ('preventiveplanning-file_modification', forms.FileFormPlanning),
+ ('researchaddress-file_modification', forms.FileFormResearchAddress),
+ ('parcelspdl-file_modification', ParcelFormSet),
+ ('generalcontractor-file_modification',
+ forms.FileFormGeneralContractor),
+ ('planningservice-file_modification',
+ forms.FileFormPlanningService),
+ ('research-file_modification', ref_forms.FileFormResearch),
+ ('instruction-file_modification',
+ forms.FileFormInstruction),
+ ('final-file_modification', ref_forms.FinalForm)],
+ label=_(u"File modification"),
+ condition_dict={
+ 'preventivetype-file_modification':file_modification_wizard_is_preventive,
+ 'preventiveplanning-file_modification':file_modification_wizard_is_preventive,
+ 'generalcontractor-file_modification':file_modification_wizard_is_preventive,
+ 'planningservice-file_modification':file_modification_wizard_is_preventive,
+ 'researchaddress-file_modification':file_modification_wizard_is_not_preventive,
+ 'research-file_modification':file_modification_wizard_is_not_preventive
+ },
+ url_name='file_modification',)
+
+
+class TownPlanningEdit(OrganizationPersonEdit):
+ relative_label = _("File followed by")
+
+class TownPlanningCreate(OrganizationPersonCreate):
+ relative_label = _("File followed by")
diff --git a/archaeological_files_pdl/wizards.py b/archaeological_files_pdl/wizards.py
new file mode 100644
index 000000000..2d3491c8d
--- /dev/null
+++ b/archaeological_files_pdl/wizards.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2014 É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 archaeological_files.wizards import FileWizard as BaseFileWizard
+
+class FileWizard(BaseFileWizard):
+ parcel_step_key = 'parcelspdl-'
+ town_step_keys = ['preventiveplanning-', 'researchaddress-']
+ town_input_id = 'main_town'
+ multi_towns = False
+ wizard_templates = {
+ 'generalcontractor-%(url_name)s':\
+ 'ishtar/wizard/wizard_generalcontractor.html',
+ 'planningservice-%(url_name)s':\
+ 'ishtar/wizard/wizard_planningservice.html',
+ 'instruction-%(url_name)s':\
+ 'ishtar/wizard/wizard_instruction.html',
+ 'preventiveplanning-%(url_name)s':\
+ 'ishtar/wizard/wizard_preventiveplanning.html',
+ }
+
+ def get_current_year(self):
+ general_form_key = 'general-' + self.url_name
+ return self.session_get_value(general_form_key, 'year')
+
+ def get_form_kwargs(self, *args, **kwargs):
+ returned = super(FileWizard, self).get_form_kwargs(*args, **kwargs)
+ if args and (args[0].startswith('generalcontractor-') or
+ args[0].startswith('planningservice-')):
+ if 'status' in self.request.GET:
+ returned['status'] = self.request.GET['status']
+ if args and args[0].startswith('instruction-'):
+ returned['year'] = self.get_current_year()
+ return returned
+
+class FileModificationWizard(FileWizard):
+ modification = True
diff --git a/archaeological_finds/data_importer.py b/archaeological_finds/data_importer.py
index 197bf20ec..40808cbcd 100644
--- a/archaeological_finds/data_importer.py
+++ b/archaeological_finds/data_importer.py
@@ -64,7 +64,7 @@ class FindsImporterBibracte(Importer):
# lien UE
ImportFormater('context_record__external_id', UnicodeFormater(120),),
# date decouverte
- ImportFormater('discovery_date', DateFormater('%Y/%m/%d'), required=False,),
+ ImportFormater('discovery_date', DateFormater(['%Y/%m/%d']), required=False,),
# lien parcelle (unique)
None,
# etat conservation
diff --git a/archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py b/archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py
new file mode 100644
index 000000000..56331ba2a
--- /dev/null
+++ b/archaeological_finds/migrations/0019_auto__chg_field_preservationtype_txt_idx__chg_field_treatmenttype_txt_.py
@@ -0,0 +1,824 @@
+# -*- 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 'PreservationType.txt_idx'
+ db.alter_column('archaeological_finds_preservationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'TreatmentType.txt_idx'
+ db.alter_column('archaeological_finds_treatmenttype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'MaterialType.txt_idx'
+ db.alter_column('archaeological_finds_materialtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'ConservatoryState.txt_idx'
+ db.alter_column('archaeological_finds_conservatorystate', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ def backwards(self, orm):
+
+ # Changing field 'PreservationType.txt_idx'
+ db.alter_column('archaeological_finds_preservationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'TreatmentType.txt_idx'
+ db.alter_column('archaeological_finds_treatmenttype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'MaterialType.txt_idx'
+ db.alter_column('archaeological_finds_materialtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'ConservatoryState.txt_idx'
+ db.alter_column('archaeological_finds_conservatorystate', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=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': {'object_name': 'ContextRecord'},
+ 'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", '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'}),
+ 'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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_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'}),
+ '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'location': ('django.db.models.fields.CharField', [], {'max_length': '200', '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']"}),
+ '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.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': {'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.identificationtype': {
+ 'Meta': {'ordering': "('order',)", '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',)", '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'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
+ },
+ 'archaeological_context_records.unit': {
+ 'Meta': {'ordering': "('order',)", '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'}),
+ 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', '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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'", '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.CharField', [], {'max_length': '100', '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.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'}),
+ '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'}),
+ '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'}),
+ 'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_operations.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'", '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'total_surface': ('django.db.models.fields.IntegerField', [], {'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': '2015'})
+ },
+ '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'},
+ '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'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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'}),
+ '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'}),
+ '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'})
+ },
+ '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': {'object_name': 'Find'},
+ 'base_finds': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'find'", 'symmetrical': 'False', 'to': "orm['archaeological_finds.BaseFind']"}),
+ 'conservatory_state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.ConservatoryState']", 'null': 'True', 'blank': 'True'}),
+ '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']", 'null': 'True', 'blank': 'True'}),
+ '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']"}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}),
+ 'find_number': ('django.db.models.fields.IntegerField', [], {'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': '100', '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']"}),
+ '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', [], {'default': '1'}),
+ 'preservation_to_consider': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.PreservationType']", 'null': 'True', 'blank': 'True'}),
+ 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ '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'}),
+ 'weight_unit': ('django.db.models.fields.CharField', [], {'max_length': '1', 'null': 'True', 'blank': 'True'})
+ },
+ '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'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '12', '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'}),
+ 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
+ 'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ 'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'reference': ('django.db.models.fields.CharField', [], {'max_length': '25', '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'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'})
+ },
+ 'archaeological_finds.historicalbasefind': {
+ 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalBaseFind'},
+ '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'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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'}),
+ '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'}),
+ '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'})
+ },
+ 'archaeological_finds.historicalfind': {
+ 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalFind'},
+ '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_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'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}),
+ 'find_number': ('django.db.models.fields.IntegerField', [], {'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': '100', 'null': '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', [], {'default': '1'}),
+ 'preservation_to_consider_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', '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': '1', 'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_finds.historicaltreatment': {
+ 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalTreatment'},
+ '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'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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'}),
+ 'location_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'other_location': ('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'}),
+ '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': {'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.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.treatment': {
+ 'Meta': {'object_name': 'Treatment'},
+ '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'}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', '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_treatment'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}),
+ 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}),
+ 'other_location': ('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']"}),
+ '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'},
+ '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'}),
+ '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'}),
+ 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
+ 'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ 'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'reference': ('django.db.models.fields.CharField', [], {'max_length': '25', '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'}),
+ '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.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'}),
+ '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'}),
+ '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': '1'}),
+ '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']"}),
+ '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'}),
+ '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'},
+ 'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.ArchaeologicalSite']", 'symmetrical': 'False'}),
+ '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_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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'}),
+ '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'}),
+ 'negative_result': ('django.db.models.fields.NullBooleanField', [], {'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['archaeological_operations.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', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}),
+ 'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}),
+ 'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'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'}),
+ 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}),
+ 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_operations.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'})
+ },
+ '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']"}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '12', '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'}),
+ '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': {'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_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_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_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}),
+ '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': {'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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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': '40'}),
+ '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'}),
+ 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', '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.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': {'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': {'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'}),
+ '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': {'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'},
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}),
+ 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', '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.importertype': {
+ 'Meta': {'object_name': 'ImporterType'},
+ 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ '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'}),
+ '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']},
+ '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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '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'}),
+ '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']"}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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'}),
+ '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'}),
+ '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'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2', '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': {'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.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'})
+ }
+ }
+
+ complete_apps = ['archaeological_finds'] \ No newline at end of file
diff --git a/archaeological_operations/data_importer.py b/archaeological_operations/data_importer.py
index 94bbdff7c..252fdcca0 100644
--- a/archaeological_operations/data_importer.py
+++ b/archaeological_operations/data_importer.py
@@ -170,9 +170,9 @@ class OperationImporterBibracte(Importer):
# resp. lien IMPORT avec personne
ImportFormater('in_charge__raw_name', UnicodeFormater(300),),
# début
- ImportFormater('start_date', DateFormater('%Y/%m/%d'),),
+ ImportFormater('start_date', DateFormater(['%Y/%m/%d']),),
# fin
- ImportFormater('excavation_end_date', DateFormater('%Y/%m/%d'),),
+ ImportFormater('excavation_end_date', DateFormater(['%Y/%m/%d']),),
# Chronos
ImportFormater('periods', TypeFormater(models.Period, many_split="&"),
required=False),
@@ -242,7 +242,7 @@ class DocImporterBibracte(Importer):
# auteur
ImportFormater('authors__person__raw_name', UnicodeFormater(300), required=False),
# annee
- ImportFormater('creation_date', DateFormater('%Y'),),
+ ImportFormater('creation_date', DateFormater(['%Y']),),
# format
ImportFormater('format_type', TypeFormater(Format), required=False),
# description legende
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 1a09b66b4..d0e4be0d3 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -89,7 +89,7 @@ class ParcelForm(forms.Form):
kwargs.pop('files')
super(ParcelForm, self).__init__(*args, **kwargs)
if towns:
- self.fields['town'].choices = [('', '--')] + towns
+ self.fields['town'].choices = towns
def clean(self):
"""Check required fields"""
@@ -98,9 +98,10 @@ class ParcelForm(forms.Form):
if not self.cleaned_data or (DELETION_FIELD_NAME in self.cleaned_data \
and self.cleaned_data[DELETION_FIELD_NAME]):
return
- if not self.cleaned_data.get('parcel_number'):
+ if not self.cleaned_data.get('parcel_number') and \
+ self.cleaned_data.get('section') != 'DP':
return {}
- for key in ('town', 'parcel_number', 'section'):
+ for key in ('town', 'section'):
if not key in self.cleaned_data or not self.cleaned_data[key]:
raise forms.ValidationError(_(u"Town section and parcel number "
u"fields are required."))
diff --git a/archaeological_operations/ishtar_menu.py b/archaeological_operations/ishtar_menu.py
index 237cc84cc..249c86185 100644
--- a/archaeological_operations/ishtar_menu.py
+++ b/archaeological_operations/ishtar_menu.py
@@ -50,6 +50,11 @@ MENU_SECTIONS = [
'change_own_operation']),
SectionItem('operation_source', _(u"Documentation"),
childs=[
+ MenuItem('operation_source_search',
+ _(u"Search"),
+ model=models.OperationSource,
+ access_controls=['change_operation',
+ 'change_own_operation']),
MenuItem('operation_source_creation',
_(u"Add"),
model=models.OperationSource,
@@ -96,6 +101,11 @@ if FILES_AVAILABLE:
SectionItem('admin_act_operations',
_(u"Administrative act"),
childs=[
+ MenuItem('operation_administrativeactop_search',
+ _(u"Search"),
+ model=models.Operation,
+ access_controls=['change_operation',
+ 'change_own_operation']),
MenuItem('operation_administrativeactop',
_(u"Add"),
model=models.Operation,
diff --git a/archaeological_operations/management/commands/import_operations.py b/archaeological_operations/management/commands/ishtar_imports.py
index 09bfe23b6..3f4d9e2e8 100644
--- a/archaeological_operations/management/commands/import_operations.py
+++ b/archaeological_operations/management/commands/ishtar_imports.py
@@ -18,6 +18,7 @@
# See the file COPYING for details.
import datetime, unicodecsv
+from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
@@ -31,6 +32,12 @@ IMPORTERS = {
}
try:
+ from archaeological_files.data_importer import *
+ IMPORTERS['sra-pdl-files'] = FileImporterSraPdL
+except ImportError:
+ pass
+
+try:
from archaeological_context_records.data_importer import *
IMPORTERS['bibracte-ue'] = ContextRecordsImporterBibracte
IMPORTERS['bibracte-ue-rel'] = ContextRecordsRelationImporterBibracte
@@ -48,6 +55,14 @@ except ImportError:
class Command(BaseCommand):
args = '<filename> <importer_name> [<nb lines skipped>]'
help = "Import archaeological operations"
+ option_list = BaseCommand.option_list + (
+ make_option('--choose-default',
+ action='store_true',
+ dest='choose_default',
+ default=False,
+ help='When a choice is requested choose the first one available. '\
+ 'For testing purpose'),
+ )
def handle(self, *args, **options):
if not args or not args[0]:
@@ -62,6 +77,7 @@ class Command(BaseCommand):
skip_lines = int(args[2])
except:
skip_lines = 0
+ choose_default = options.get('choose_default')
filename = args[0]
importer = IMPORTERS[args[1]](skip_lines=skip_lines, output='cli')
sys.stdout.write("*" * 72 + "\n")
@@ -76,7 +92,8 @@ class Command(BaseCommand):
for encoding in encodings:
try:
importer.importation([line for line in
- unicodecsv.reader(csv_file, encoding='utf-8')])
+ unicodecsv.reader(csv_file, encoding='utf-8')],
+ choose_default=choose_default)
errors = importer.get_csv_errors()
sys.stdout.write("\n")
if errors:
diff --git a/archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py b/archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py
new file mode 100644
index 000000000..aa023a7eb
--- /dev/null
+++ b/archaeological_operations/migrations/0037_auto__chg_field_parcel_parcel_number__chg_field_operationtype_txt_idx_.py
@@ -0,0 +1,559 @@
+# -*- 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 'Parcel.parcel_number'
+ db.alter_column('archaeological_operations_parcel', 'parcel_number', self.gf('django.db.models.fields.CharField')(max_length=6, null=True))
+
+ # Changing field 'OperationType.txt_idx'
+ db.alter_column('archaeological_operations_operationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'Period.txt_idx'
+ db.alter_column('archaeological_operations_period', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'ActType.txt_idx'
+ db.alter_column('archaeological_operations_acttype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'RemainType.txt_idx'
+ db.alter_column('archaeological_operations_remaintype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ def backwards(self, orm):
+
+ # Changing field 'Parcel.parcel_number'
+ db.alter_column('archaeological_operations_parcel', 'parcel_number', self.gf('django.db.models.fields.CharField')(default='-', max_length=6))
+
+ # Changing field 'OperationType.txt_idx'
+ db.alter_column('archaeological_operations_operationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'Period.txt_idx'
+ db.alter_column('archaeological_operations_period', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'ActType.txt_idx'
+ db.alter_column('archaeological_operations_acttype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'RemainType.txt_idx'
+ db.alter_column('archaeological_operations_remaintype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ models = {
+ 'archaeological_files.file': {
+ 'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'},
+ 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', '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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'", '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.CharField', [], {'max_length': '100', '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.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'}),
+ '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'}),
+ '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'}),
+ 'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_operations.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'", '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.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'total_surface': ('django.db.models.fields.IntegerField', [], {'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': '2015'})
+ },
+ '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.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': '1'}),
+ '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']"}),
+ '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'}),
+ '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'}),
+ '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'}),
+ 'year': ('django.db.models.fields.IntegerField', [], {'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'}),
+ '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_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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'}),
+ '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'}),
+ 'negative_result': ('django.db.models.fields.NullBooleanField', [], {'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'}),
+ 'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'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'}),
+ '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'},
+ 'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.ArchaeologicalSite']", 'symmetrical': 'False'}),
+ '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_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'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ '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'}),
+ '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'}),
+ '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'}),
+ 'negative_result': ('django.db.models.fields.NullBooleanField', [], {'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['archaeological_operations.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', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}),
+ 'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}),
+ 'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'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'}),
+ 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': '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'}),
+ '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'}),
+ 'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '25', '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'}),
+ 'reference': ('django.db.models.fields.CharField', [], {'max_length': '25', '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'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'})
+ },
+ 'archaeological_operations.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'})
+ },
+ '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']"}),
+ 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '12', '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'}),
+ '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_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', [], {'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.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'})
+ },
+ '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', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"})
+ },
+ 'ishtar_common.authortype': {
+ 'Meta': {'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'}),
+ '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': {'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'},
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}),
+ 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', '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.importertype': {
+ 'Meta': {'object_name': 'ImporterType'},
+ 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ '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'}),
+ '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']},
+ '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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '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'}),
+ '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']"}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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'}),
+ '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'}),
+ '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'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2', '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': {'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.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'})
+ }
+ }
+
+ complete_apps = ['archaeological_operations'] \ No newline at end of file
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 7d44a8bcf..53e572a20 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -204,7 +204,7 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
if settings.COUNTRY == 'fr':
code_patriarche = models.IntegerField(u"Code PATRIARCHE", null=True,
blank=True)
- TABLE_COLS = ['code_patriarche'] + TABLE_COLS
+ TABLE_COLS = ['full_code_patriarche'] + TABLE_COLS
code_dracar = models.CharField(u"Code DRACAR", max_length=10, null=True,
blank=True)
fnap_financing = models.FloatField(u"Financement FNAP (%)",
@@ -291,12 +291,13 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
def get_reference(self, full=False):
ref = ""
if self.code_patriarche:
- ref = unicode(self.code_patriarche)
+ ref = "OA" + unicode(self.code_patriarche)
if not full:
return ref
if self.year and self.operation_code:
if ref:
ref += u" - "
+ ref += settings.OP_PREFIX
ref += u"-".join((unicode(self.year),
unicode(self.operation_code)))
return ref or "00"
@@ -370,9 +371,15 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,
return ""
lbl = unicode(self.operation_code)
year = self.year or 0
- lbl = u"%d-%s%s" % (year, (3-len(lbl))*"0", lbl)
+ lbl = settings.OP_PREFIX + u"%d-%s%s" % (year, (3-len(lbl))*"0", lbl)
return lbl
+ @property
+ def full_code_patriarche(self):
+ if not self.code_patriarche:
+ return ''
+ return u"OA" + unicode(self.code_patriarche)
+
def clean(self):
objs = self.__class__.objects.filter(year=self.year,
operation_code=self.operation_code)
@@ -674,7 +681,8 @@ class Parcel(LightHistorizedItem):
town = models.ForeignKey(Town, related_name='parcels',
verbose_name=_(u"Town"))
section = models.CharField(_(u"Section"), max_length=4)
- parcel_number = models.CharField(_(u"Parcel number"), max_length=6)
+ parcel_number = models.CharField(_(u"Parcel number"), max_length=6,
+ null=True, blank=True)
external_id = models.CharField(_(u"External ID"), max_length=12, null=True,
blank=True)
address = models.TextField(_(u"Address - Locality"), null=True, blank=True)
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 5f0626a02..cc69abda0 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -30,7 +30,7 @@
{% if item.year %}<p><label>{%trans "Year:"%}</label> <span class='value strong'>{{ item.year }}</span></p>{% endif %}
{% if item.operation_code %}<p><label>{%trans "Numerical reference:"%}</label> <span class='value strong'>{{ item.operation_code }}</span></p>{% endif %}
-{% if item.code_patriarche %}<p><label>{%trans "Patriarche OA code:"%}</label> <span class='value'>{{ item.code_patriarche }}</span></p>{%else%}
+{% if item.code_patriarche %}<p><label>{%trans "Patriarche OA code:"%}</label> <span class='value'>OA{{ item.code_patriarche }}</span></p>{%else%}
<p class='alert'>{%trans "Patriarche OA code not yet recorded!"%}</p>{%endif%}
<p><label>{%trans "Edition date:"%}</label> <span class='value'>{% if item.history_date %}{{ item.history_date }}{% else %}{{ item.history.all.0.history_date }}{% endif %}</span></p> <!-- date = now -->
diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py
index fcd85efb5..f448fd6a7 100644
--- a/archaeological_operations/urls.py
+++ b/archaeological_operations/urls.py
@@ -23,6 +23,9 @@ import views
# forms
urlpatterns = patterns('',
+ url(r'operation_administrativeactop_search/(?P<step>.+)?$',
+ views.operation_administrativeactop_search_wizard,
+ name='operation_administrativeactop_search'),
url(r'operation_administrativeactop/(?P<step>.+)?$',
views.operation_administrativeactop_wizard,
name='operation_administrativeactop'),
@@ -32,6 +35,9 @@ urlpatterns = patterns('',
url(r'operation_administrativeactop_deletion/(?P<step>.+)?$',
views.operation_administrativeactop_deletion_wizard,
name='operation_administrativeactop_deletion'),
+ url(r'operation_source_search/(?P<step>.+)?$',
+ views.operation_source_search_wizard,
+ name='operation_source_search'),
url(r'operation_source_creation/(?P<step>.+)?$',
views.operation_source_creation_wizard,
name='operation_source_creation'),
@@ -45,6 +51,8 @@ urlpatterns = patterns('',
views.operation_search_wizard, name='operation_search'),
url(r'operation_creation/(?P<step>.+)?$',
views.operation_creation_wizard, name='operation_creation'),
+ url(r'operation_add/(?P<file_id>\d+)$',
+ views.operation_add, name='operation_add'),
url(r'operation_modification/(?P<step>.+)?$',
views.operation_modification_wizard,
name='operation_modification'),
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index b4e9d2a2f..a8ded32cf 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -255,6 +255,14 @@ def operation_modify(request, pk):
return redirect(reverse('operation_modification',
kwargs={'step':'general-operation_modification'}))
+def operation_add(request, file_id):
+ view = operation_creation_wizard(request)
+ OperationWizard.session_set_value(
+ request, 'filechoice-operation_creation', 'associated_file',
+ file_id, reset=True)
+ return redirect(reverse('operation_creation',
+ kwargs={'step':'general-operation_creation'}))
+
operation_closing_wizard = OperationClosingWizard.as_view([
('selec-operation_closing', OperationFormSelection),
('date-operation_closing', ClosingDateFormSelection),
@@ -268,6 +276,11 @@ operation_deletion_wizard = OperationDeletionWizard.as_view([
label=_(u"Operation deletion"),
url_name='operation_deletion',)
+operation_source_search_wizard = SearchWizard.as_view([
+ ('selec-operation_source_search', OperationSourceFormSelection)],
+ label=_(u"Operation: source search"),
+ url_name='operation_source_search',)
+
operation_source_creation_wizard = OperationSourceWizard.as_view([
('selec-operation_source_creation', SourceOperationFormSelection),
('source-operation_source_creation',OperationSourceForm),
@@ -290,6 +303,12 @@ operation_source_deletion_wizard = OperationSourceDeletionWizard.as_view([
label=_(u"Operation: source deletion"),
url_name='operation_source_deletion',)
+operation_administrativeactop_search_wizard = SearchWizard.as_view([
+ ('general-operation_administrativeactop_search',
+ AdministrativeActOpeFormSelection)],
+ label=_(u"Administrative act search"),
+ url_name='operation_administrativeactop_search',)
+
operation_administrativeactop_wizard = \
OperationAdministrativeActWizard.as_view([
('selec-operation_administrativeactop', OperationFormSelection),
@@ -381,3 +400,20 @@ def administrativeactfile_document(request, operation=True):
operation=operation)
return render_to_response('ishtar/administrativeact_document.html', dct,
context_instance=RequestContext(request))
+
+def reset_wizards(request):
+ for wizard_class, url_name in (
+ (OperationWizard, 'operation_creation'),
+ (OperationModificationWizard, 'operation_modification'),
+ (OperationClosingWizard, 'operation_closing'),
+ (OperationDeletionWizard, 'operation_deletion_wizard'),
+ (OperationSourceWizard, 'operation_source_creation'),
+ (OperationSourceWizard, 'operation_source_modification'),
+ (OperationSourceDeletionWizard, 'operation_source_deletion'),
+ (OperationAdministrativeActWizard, 'operation_administrativeactop'),
+ (OperationEditAdministrativeActWizard,
+ 'operation_administrativeactop_modification'),
+ (AdministrativeActDeletionWizard,
+ 'operation_administrativeactop_deletion'),
+ ):
+ wizard_class.session_reset(request, url_name)
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index 1e4de70b7..01f15886d 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -39,6 +39,9 @@ class OperationWizard(Wizard):
model = models.Operation
object_parcel_type = 'operation'
parcel_step_key = 'parcelsgeneral-'
+ town_step_keys = ['towns-'] # step contening the current(s) town(s)
+ town_input_id = 'town' # input id of the current(s) town(s)
+ multi_towns = True # true if current town are multi
wizard_done_window = reverse_lazy('show-operation')
def get_template_names(self):
@@ -47,8 +50,7 @@ class OperationWizard(Wizard):
if current_step.startswith('towns-'):
#templates = ['ishtar/wizard/towns_wizard.html'] + templates
pass
- if current_step.startswith('parcels-') or \
- current_step.startswith('parcelsgeneral-') :
+ if current_step.startswith(self.parcel_step_key):
templates = ['ishtar/wizard/parcels_wizard.html'] + templates
return templates
@@ -131,16 +133,22 @@ class OperationWizard(Wizard):
# manage the dynamic choice of towns
if step.startswith('towns') and hasattr(form, 'management_form'):
data['TOWNS'] = self.get_towns()
- elif step.startswith('parcels') and hasattr(form, 'management_form'):
+ elif step.startswith(self.parcel_step_key) \
+ and hasattr(form, 'management_form'):
file = self.get_current_file()
if file:
data['PARCELS'] = self.get_available_parcels(file)
else:
- town_form_key = step.startswith('parcelsgeneral') \
- and 'townsgeneral-' or 'towns-'
- town_form_key += self.url_name
- town_ids = self.session_get_value(town_form_key, 'town',
- multi=True) or []
+ town_ids = []
+ for town_step_key in self.town_step_keys:
+ town_form_key = town_step_key + self.url_name
+ town_ids = self.session_get_value(town_form_key,
+ self.town_input_id,
+ multi=self.multi_towns) or []
+ if town_ids:
+ break
+ if not self.multi_towns and town_ids:
+ town_ids = [town_ids]
towns = []
for town_id in town_ids:
try:
diff --git a/archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py b/archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py
new file mode 100644
index 000000000..a823623b9
--- /dev/null
+++ b/archaeological_warehouse/migrations/0007_auto__chg_field_warehousetype_txt_idx__chg_field_containertype_txt_idx.py
@@ -0,0 +1,206 @@
+# -*- 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 'WarehouseType.txt_idx'
+ db.alter_column('archaeological_warehouse_warehousetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'ContainerType.txt_idx'
+ db.alter_column('archaeological_warehouse_containertype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ def backwards(self, orm):
+
+ # Changing field 'WarehouseType.txt_idx'
+ db.alter_column('archaeological_warehouse_warehousetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'ContainerType.txt_idx'
+ db.alter_column('archaeological_warehouse_containertype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ 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_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_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}),
+ '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': {'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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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': '40'}),
+ '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'}),
+ 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', '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.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.import': {
+ 'Meta': {'object_name': 'Import'},
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}),
+ 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', '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.importertype': {
+ 'Meta': {'object_name': 'ImporterType'},
+ 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ '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'}),
+ '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']},
+ '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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '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'}),
+ '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']"}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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'}),
+ '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'}),
+ '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'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2', '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'})
+ }
+ }
+
+ complete_apps = ['archaeological_warehouse'] \ No newline at end of file
diff --git a/example_project/settings.py b/example_project/settings.py
index f81e3e984..901987905 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -48,6 +48,8 @@ LANGUAGE_CODE = 'fr-fr'
COUNTRY = "fr"
OOOK_DATE_FORMAT = u"%-d %B %Y"
+OOO_DATE_FORMAT = u"%-d %B %Y"
+DATE_FORMAT = u"%-d %B %Y"
SITE_ID = 1
@@ -190,16 +192,23 @@ ISHTAR_DOC_TYPES = {u"undefined":u"Undefined"}
ISHTAR_DPTS = []
+OP_PREFIX = 'OP'
+FILE_PREFIX = 'SRA'
+
+PRE_APPS = []
EXTRA_APPS = []
try:
from local_settings import *
except ImportError, e:
- print 'Unable to load local_settings.py:', e
+ print('Unable to load local_settings.py:', e)
if 'test' in sys.argv:
SOUTH_TESTS_MIGRATE = False
+for app in PRE_APPS:
+ INSTALLED_APPS.insert(INSTALLED_APPS.index('ishtar_common'), app)
+
if 'archaeological_files' in EXTRA_APPS:
EXTRA_APPS.pop(EXTRA_APPS.index('archaeological_files'))
INSTALLED_APPS.insert(INSTALLED_APPS.index('archaeological_operations'),
diff --git a/install/install.sh b/install/install.sh
index 7dadfe422..f4ab7f195 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -64,8 +64,8 @@ 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-imaging python-django-south \
- python-psycopg2 python-gdal gettext python-tidylib python-lxml \
+ python-utidylib python-lxml python-imaging python-django-south \
+ python-psycopg2 python-gdal gettext python-bs4 python-tidylib \
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
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py
index f5e70e0ee..a7c32e6a8 100644
--- a/ishtar_common/data_importer.py
+++ b/ishtar_common/data_importer.py
@@ -63,14 +63,15 @@ class ImportFormater(object):
def report_error(self, *args):
return
- def init(self, vals, output=None):
+ def init(self, vals, output=None, choose_default=False):
try:
lst = iter(self.formater)
except TypeError:
lst = [self.formater]
for formater in lst:
if formater:
- formater.check(vals, output)
+ formater.check(vals, output, self.comment,
+ choose_default=choose_default)
def post_process(self, obj, context, value, owner=None):
raise NotImplemented()
@@ -92,9 +93,19 @@ class Formater(object):
def format(self, value):
return value
- def check(self, values, output=None):
+ def check(self, values, output=None, comment='', choose_default=False):
return
+class ChoiceChecker(object):
+ def report_new(self, comment):
+ if not self.new_keys:
+ return
+ msg = u"For \"%s\" these new associations have been made:\n" % comment
+ sys.stderr.write(msg.encode('utf-8'))
+ for k in self.new_keys:
+ msg = u'"%s";"%s"\n' % (k, self.new_keys[k])
+ sys.stderr.write(msg.encode('utf-8'))
+
class UnicodeFormater(Formater):
def __init__(self, max_length, clean=False, re_filter=None, notnull=False,
db_target=None):
@@ -183,7 +194,7 @@ class IntegerFormater(Formater):
raise ValueError(_(u"\"%(value)s\" is not an integer") % {
'value':value})
-class StrChoiceFormater(Formater):
+class StrChoiceFormater(Formater, ChoiceChecker):
def __init__(self, choices, strict=False, equiv_dict={}, model=None,
cli=False, many_split='', db_target=None):
self.choices = list(choices)
@@ -194,6 +205,7 @@ class StrChoiceFormater(Formater):
self.db_target = db_target
self.create = False
self.missings = set()
+ self.new_keys = {}
self.many_split = many_split
for key, value in self.choices:
value = unicode(value)
@@ -219,8 +231,9 @@ class StrChoiceFormater(Formater):
def prepare(self, value):
return unicode(value).strip()
- def _get_choices(self):
- msgstr = unicode(_(u"Choice for \"%s\" is not available. "\
+ def _get_choices(self, comment=''):
+ msgstr = comment + u" - "
+ msgstr += unicode(_(u"Choice for \"%s\" is not available. "\
u"Which one is relevant?\n"))
idx = -1
for idx, choice in enumerate(self.choices):
@@ -233,8 +246,8 @@ class StrChoiceFormater(Formater):
msgstr += unicode(_(u"%d. None of the above - skip")) % idx + u"\n"
return msgstr, idx
- def check(self, values, output=None):
- if not output or output == 'silent':
+ def check(self, values, output=None, comment='', choose_default=False):
+ if (not output or output == 'silent') and not choose_default:
return
if self.many_split:
new_values = []
@@ -247,14 +260,18 @@ class StrChoiceFormater(Formater):
value = self.prepare(value)
if value in self.equiv_dict:
continue
- if output != 'cli':
+ if output != 'cli' and not choose_default:
self.missings.add(value)
continue
- msgstr, idx = self._get_choices()
+ msgstr, idx = self._get_choices(comment)
res = None
+ if choose_default:
+ res = 1
while res not in range(1, idx+1):
- sys.stdout.write(msgstr % value)
- res = raw_input(">>> ")
+ msg = msgstr % value
+ sys.stdout.write(msg.encode('utf-8'))
+ sys.stdout.write("\n>>> ")
+ res = raw_input()
try:
res = int(res)
except ValueError:
@@ -266,10 +283,12 @@ class StrChoiceFormater(Formater):
v = self.model.objects.get(pk=v)
self.equiv_dict[value] = v
self.add_key(v, value)
+ self.new_keys[value] = v
elif self.create and res == len(self.choices):
self.equiv_dict[value] = self.new(base_value)
self.choices.append((self.equiv_dict[value].pk,
unicode(self.equiv_dict[value])))
+ self.new_keys[value] = unicode(self.equiv_dict[value])
else:
self.equiv_dict[value] = None
if output == 'db' and self.db_target:
@@ -283,6 +302,8 @@ class StrChoiceFormater(Formater):
TargetKey.objects.create(**q)
except IntegrityError:
pass
+ if output == 'cli':
+ self.report_new(comment)
def new(self, value):
return
@@ -308,6 +329,7 @@ class TypeFormater(StrChoiceFormater):
self.db_target = db_target
self.missings = set()
self.equiv_dict, self.choices = {}, []
+ self.new_keys = {}
for item in model.objects.all():
self.choices.append((item.pk, unicode(item)))
for key in item.get_keys():
@@ -332,21 +354,25 @@ class TypeFormater(StrChoiceFormater):
return self.model.objects.create(**values)
class DateFormater(Formater):
- def __init__(self, date_format="%d/%m/%Y", db_target=None):
- self.date_format = date_format
+ def __init__(self, date_formats=["%d/%m/%Y"], db_target=None):
+ self.date_formats = date_formats
+ if type(date_formats) not in (list, tuple):
+ self.date_formats = [self.date_formats]
self.db_target = db_target
def format(self, value):
value = value.strip()
if not value:
return
- try:
- return datetime.datetime.strptime(value, self.date_format).date()
- except:
- raise ValueError(_(u"\"%(value)s\" is not a valid date") % {
+ for date_format in self.date_formats:
+ try:
+ return datetime.datetime.strptime(value, date_format).date()
+ except:
+ continue
+ raise ValueError(_(u"\"%(value)s\" is not a valid date") % {
'value':value})
-class StrToBoolean(Formater):
+class StrToBoolean(Formater, ChoiceChecker):
def __init__(self, choices={}, cli=False, strict=False, db_target=None):
self.dct = copy.copy(choices)
self.cli = cli
@@ -367,6 +393,7 @@ class StrToBoolean(Formater):
else:
v = None
self.dct[value] = v
+ self.new_keys = {}
def prepare(self, value):
value = unicode(value).strip()
@@ -374,10 +401,11 @@ class StrToBoolean(Formater):
value = slugify(value)
return value
- def check(self, values, output=None):
- if not output or output == 'silent':
+ def check(self, values, output=None, comment='', choose_default=False):
+ if (not output or output == 'silent') and not choose_default:
return
- msgstr = unicode(_(u"Choice for \"%s\" is not available. "\
+ msgstr = comment + u" - "
+ msgstr += unicode(_(u"Choice for \"%s\" is not available. "\
u"Which one is relevant?\n"))
msgstr += u"1. True\n"
msgstr += u"2. False\n"
@@ -386,13 +414,17 @@ class StrToBoolean(Formater):
value = self.prepare(value)
if value in self.dct:
continue
- if not self.cli:
+ if output != 'cli' and not choose_default:
self.missings.add(value)
continue
res = None
+ if choose_default:
+ res = 1
while res not in range(1, 4):
- sys.stdout.write(msgstr % value)
- res = raw_input(">>> ")
+ msg = msgstr % value
+ sys.stdout.write(msg.encode('utf-8'))
+ sys.stdout.write("\n>>> ")
+ res = raw_input()
try:
res = int(res)
except ValueError:
@@ -411,6 +443,9 @@ class StrToBoolean(Formater):
models.TargetKey.objects.create(**q)
except IntegrityError:
pass
+ self.new_keys[value] = unicode(self.dct[value])
+ if output == 'cli':
+ self.report_new(comment)
def format(self, value):
value = self.prepare(value)
@@ -419,13 +454,22 @@ class StrToBoolean(Formater):
logger = logging.getLogger(__name__)
+def get_object_from_path(obj, path):
+ for k in path.split('__')[:-1]:
+ if not hasattr(obj, k):
+ return
+ obj = getattr(obj, k)
+ return obj
+
class Importer(object):
DESC = ""
LINE_FORMAT = []
OBJECT_CLS = None
IMPORTED_LINE_FIELD = None
UNICITY_KEYS = []
+ EXTRA_DEFAULTS = {}
DEFAULTS = {}
+ STR_CUT = {}
ERRORS = {
'header_check':_(u"The given file is not correct. Check the file "
u"format. If you use a CSV file: check that column separator "
@@ -459,6 +503,12 @@ class Importer(object):
self.line_format = copy.copy(self.LINE_FORMAT)
self.import_instance = import_instance
self._defaults = self.DEFAULTS.copy()
+ # EXTRA_DEFAULTS are for multiple inheritance
+ if self.EXTRA_DEFAULTS:
+ for k in self.EXTRA_DEFAULTS:
+ if k not in self._defaults:
+ self._defaults[k] = {}
+ self._defaults[k].update(self.EXTRA_DEFAULTS[k])
self.history_modifier = history_modifier
self.output = output
if not self.history_modifier:
@@ -469,7 +519,10 @@ class Importer(object):
self.history_modifier = User.objects.filter(
is_superuser=True).order_by('pk')[0]
- def initialize(self, table, output='silent'):
+ def post_processing(self, item, data):
+ return item
+
+ def initialize(self, table, output='silent', choose_default=False):
"""
copy vals in columns and initialize formaters
* output:
@@ -491,11 +544,11 @@ class Importer(object):
vals[idx_col].append(val)
for idx, formater in enumerate(self.line_format):
if formater and idx < len(vals):
- formater.init(vals[idx], output)
+ formater.init(vals[idx], output, choose_default=choose_default)
- def importation(self, table, initialize=True):
+ def importation(self, table, initialize=True, choose_default=False):
if initialize:
- self.initialize(table, self.output)
+ self.initialize(table, self.output, choose_default=choose_default)
self._importation(table)
@classmethod
@@ -560,10 +613,10 @@ class Importer(object):
time_by_item = ellapsed/idx_line
if time_by_item:
left = ((total - idx_line)*time_by_item).seconds
- txt = "\r* %d/%d" % (idx_line+1, total)
+ txt = u"\r* %d/%d" % (idx_line+1, total)
if left:
- txt += " (%d seconds left)" % left
- sys.stdout.write(txt)
+ txt += u" (%d seconds left)" % left
+ sys.stdout.write(txt.encode('utf-8'))
sys.stdout.flush()
try:
self._line_processing(idx_line, line)
@@ -623,8 +676,8 @@ class Importer(object):
if 'history_modifier' in \
self.OBJECT_CLS._meta.get_all_field_names():
data['history_modifier'] = self.history_modifier
- obj, created = self.get_object(self.OBJECT_CLS, data)
+ obj, created = self.get_object(self.OBJECT_CLS, data)
if self.import_instance and hasattr(obj, 'imports'):
obj.imports.add(self.import_instance)
@@ -669,6 +722,8 @@ class Importer(object):
for formater, val in self._post_processing:
formater.post_process(obj, data, val, owner=self.history_modifier)
+ obj = self.post_processing(obj, data)
+
def _row_processing(self, c_row, idx_col, idx_line, val, data):
if idx_col >= len(self.line_format):
return
@@ -833,12 +888,19 @@ class Importer(object):
self.history_modifier
data[attribute], created = self.get_object(
field_object.rel.to, data[attribute], c_path)
+ # default values
path = tuple(path)
if path in self._defaults:
for k in self._defaults[path]:
if k not in data or not data[k]:
data[k] = self._defaults[path][k]
+ # pre treatment
+ if path in self.STR_CUT:
+ for k in self.STR_CUT[path]:
+ if k in data and data[k]:
+ data[k] = unicode(data[k])[:self.STR_CUT[path][k]]
+
# filter default values
create_dict = copy.deepcopy(data)
for k in create_dict.keys():
@@ -857,11 +919,7 @@ class Importer(object):
obj.imports.add(self.import_instance)
except IntegrityError as e:
raise IntegrityError(e.message)
- except:
- q = cls.objects.filter(**create_dict)
- if not q.count():
- raise ImporterError("Erreur d'import %s, contexte : %s"\
- % (unicode(cls), unicode(data)))
+ except cls.MultipleObjectsReturned:
created = False
obj = cls.objects.filter(**create_dict).all()[0]
for attr, value in m2ms:
@@ -871,6 +929,15 @@ class Importer(object):
for v in values:
getattr(obj, attr).add(v)
except IntegrityError as e:
+ message = e.message
+ try:
+ message = unicode(e.message.decode('utf-8'))
+ except (UnicodeDecodeError, UnicodeDecodeError):
+ message = ''
+ try:
+ data = unicode(data)
+ except UnicodeDecodeError:
+ data = ''
raise ImporterError(
"Erreur d'import %s, contexte : %s, erreur : %s" \
% (unicode(cls), unicode(data), e.message.decode('utf-8')))
diff --git a/ishtar_common/fixtures/initial_dpts-fr.json b/ishtar_common/fixtures/initial_dpts-fr.json
new file mode 100644
index 000000000..721a96a8a
--- /dev/null
+++ b/ishtar_common/fixtures/initial_dpts-fr.json
@@ -0,0 +1,1127 @@
+[
+ {
+ "pk": 28,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "1",
+ "label": "Guadeloupe"
+ }
+ },
+ {
+ "pk": 33,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "11",
+ "label": "\u00cele-de-France"
+ }
+ },
+ {
+ "pk": 29,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "2",
+ "label": "Martinique"
+ }
+ },
+ {
+ "pk": 34,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "21",
+ "label": "Champagne-Ardenne"
+ }
+ },
+ {
+ "pk": 35,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "22",
+ "label": "Picardie"
+ }
+ },
+ {
+ "pk": 36,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "23",
+ "label": "Haute-Normandie"
+ }
+ },
+ {
+ "pk": 37,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "24",
+ "label": "Centre"
+ }
+ },
+ {
+ "pk": 38,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "25",
+ "label": "Basse-Normandie"
+ }
+ },
+ {
+ "pk": 39,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "26",
+ "label": "Bourgogne"
+ }
+ },
+ {
+ "pk": 30,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "3",
+ "label": "Guyane"
+ }
+ },
+ {
+ "pk": 40,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "31",
+ "label": "Nord-Pas-de-Calais"
+ }
+ },
+ {
+ "pk": 31,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "4",
+ "label": "La R\u00e9union"
+ }
+ },
+ {
+ "pk": 41,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "41",
+ "label": "Lorraine"
+ }
+ },
+ {
+ "pk": 42,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "42",
+ "label": "Alsace"
+ }
+ },
+ {
+ "pk": 43,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "43",
+ "label": "Franche-Comt\u00e9"
+ }
+ },
+ {
+ "pk": 44,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "52",
+ "label": "Pays de la Loire"
+ }
+ },
+ {
+ "pk": 45,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "53",
+ "label": "Bretagne"
+ }
+ },
+ {
+ "pk": 46,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "54",
+ "label": "Poitou-Charentes"
+ }
+ },
+ {
+ "pk": 32,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "6",
+ "label": "Mayotte"
+ }
+ },
+ {
+ "pk": 47,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "72",
+ "label": "Aquitaine"
+ }
+ },
+ {
+ "pk": 48,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "73",
+ "label": "Midi-Pyr\u00e9n\u00e9es"
+ }
+ },
+ {
+ "pk": 49,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "74",
+ "label": "Limousin"
+ }
+ },
+ {
+ "pk": 50,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "82",
+ "label": "Rh\u00f4ne-Alpes"
+ }
+ },
+ {
+ "pk": 51,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "83",
+ "label": "Auvergne"
+ }
+ },
+ {
+ "pk": 52,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "91",
+ "label": "Languedoc-Roussillon"
+ }
+ },
+ {
+ "pk": 53,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "93",
+ "label": "Provence-Alpes-C\u00f4te d'Azur"
+ }
+ },
+ {
+ "pk": 54,
+ "model": "ishtar_common.state",
+ "fields": {
+ "number": "94",
+ "label": "Corse"
+ }
+ },
+ {
+ "pk": 1,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "01",
+ "label": "Ain"
+ }
+ },
+ {
+ "pk": 2,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 35,
+ "number": "02",
+ "label": "Aisne"
+ }
+ },
+ {
+ "pk": 3,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 51,
+ "number": "03",
+ "label": "Allier"
+ }
+ },
+ {
+ "pk": 4,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 53,
+ "number": "04",
+ "label": "Alpes-de-Haute-Provence"
+ }
+ },
+ {
+ "pk": 5,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 53,
+ "number": "05",
+ "label": "Hautes-Alpes"
+ }
+ },
+ {
+ "pk": 6,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 53,
+ "number": "06",
+ "label": "Alpes-Maritimes"
+ }
+ },
+ {
+ "pk": 7,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "07",
+ "label": "Ard\u00e8che"
+ }
+ },
+ {
+ "pk": 8,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 34,
+ "number": "08",
+ "label": "Ardennes"
+ }
+ },
+ {
+ "pk": 9,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "09",
+ "label": "Ari\u00e8ge"
+ }
+ },
+ {
+ "pk": 10,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 34,
+ "number": "10",
+ "label": "Aube"
+ }
+ },
+ {
+ "pk": 11,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 52,
+ "number": "11",
+ "label": "Aude"
+ }
+ },
+ {
+ "pk": 12,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "12",
+ "label": "Aveyron"
+ }
+ },
+ {
+ "pk": 13,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 53,
+ "number": "13",
+ "label": "Bouches-du-Rh\u00f4ne"
+ }
+ },
+ {
+ "pk": 14,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 38,
+ "number": "14",
+ "label": "Calvados"
+ }
+ },
+ {
+ "pk": 15,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 51,
+ "number": "15",
+ "label": "Cantal"
+ }
+ },
+ {
+ "pk": 16,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 46,
+ "number": "16",
+ "label": "Charente"
+ }
+ },
+ {
+ "pk": 17,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 46,
+ "number": "17",
+ "label": "Charente-Maritime"
+ }
+ },
+ {
+ "pk": 18,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 37,
+ "number": "18",
+ "label": "Cher"
+ }
+ },
+ {
+ "pk": 19,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 49,
+ "number": "19",
+ "label": "Corr\u00e8ze"
+ }
+ },
+ {
+ "pk": 22,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 39,
+ "number": "21",
+ "label": "C\u00f4te-d'Or"
+ }
+ },
+ {
+ "pk": 23,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 45,
+ "number": "22",
+ "label": "C\u00f4tes-d'Armor"
+ }
+ },
+ {
+ "pk": 24,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 49,
+ "number": "23",
+ "label": "Creuse"
+ }
+ },
+ {
+ "pk": 25,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 47,
+ "number": "24",
+ "label": "Dordogne"
+ }
+ },
+ {
+ "pk": 26,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 43,
+ "number": "25",
+ "label": "Doubs"
+ }
+ },
+ {
+ "pk": 27,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "26",
+ "label": "Dr\u00f4me"
+ }
+ },
+ {
+ "pk": 28,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 36,
+ "number": "27",
+ "label": "Eure"
+ }
+ },
+ {
+ "pk": 29,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 37,
+ "number": "28",
+ "label": "Eure-et-Loir"
+ }
+ },
+ {
+ "pk": 30,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 45,
+ "number": "29",
+ "label": "Finist\u00e8re"
+ }
+ },
+ {
+ "pk": 20,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 54,
+ "number": "2A",
+ "label": "Corse-du-Sud"
+ }
+ },
+ {
+ "pk": 21,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 54,
+ "number": "2B",
+ "label": "Haute-Corse"
+ }
+ },
+ {
+ "pk": 31,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 52,
+ "number": "30",
+ "label": "Gard"
+ }
+ },
+ {
+ "pk": 32,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "31",
+ "label": "Haute-Garonne"
+ }
+ },
+ {
+ "pk": 33,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "32",
+ "label": "Gers"
+ }
+ },
+ {
+ "pk": 34,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 47,
+ "number": "33",
+ "label": "Gironde"
+ }
+ },
+ {
+ "pk": 35,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 52,
+ "number": "34",
+ "label": "H\u00e9rault"
+ }
+ },
+ {
+ "pk": 36,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 45,
+ "number": "35",
+ "label": "Ille-et-Vilaine"
+ }
+ },
+ {
+ "pk": 37,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 37,
+ "number": "36",
+ "label": "Indre"
+ }
+ },
+ {
+ "pk": 38,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 37,
+ "number": "37",
+ "label": "Indre-et-Loire"
+ }
+ },
+ {
+ "pk": 39,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "38",
+ "label": "Is\u00e8re"
+ }
+ },
+ {
+ "pk": 40,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 43,
+ "number": "39",
+ "label": "Jura"
+ }
+ },
+ {
+ "pk": 41,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 47,
+ "number": "40",
+ "label": "Landes"
+ }
+ },
+ {
+ "pk": 42,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 37,
+ "number": "41",
+ "label": "Loir-et-Cher"
+ }
+ },
+ {
+ "pk": 43,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "42",
+ "label": "Loire"
+ }
+ },
+ {
+ "pk": 44,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 51,
+ "number": "43",
+ "label": "Haute-Loire"
+ }
+ },
+ {
+ "pk": 45,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 44,
+ "number": "44",
+ "label": "Loire-Atlantique"
+ }
+ },
+ {
+ "pk": 46,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 37,
+ "number": "45",
+ "label": "Loiret"
+ }
+ },
+ {
+ "pk": 47,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "46",
+ "label": "Lot"
+ }
+ },
+ {
+ "pk": 48,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 47,
+ "number": "47",
+ "label": "Lot-et-Garonne"
+ }
+ },
+ {
+ "pk": 49,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 52,
+ "number": "48",
+ "label": "Loz\u00e8re"
+ }
+ },
+ {
+ "pk": 50,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 44,
+ "number": "49",
+ "label": "Maine-et-Loire"
+ }
+ },
+ {
+ "pk": 51,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 38,
+ "number": "50",
+ "label": "Manche"
+ }
+ },
+ {
+ "pk": 52,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 34,
+ "number": "51",
+ "label": "Marne"
+ }
+ },
+ {
+ "pk": 53,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 34,
+ "number": "52",
+ "label": "Haute-Marne"
+ }
+ },
+ {
+ "pk": 54,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 44,
+ "number": "53",
+ "label": "Mayenne"
+ }
+ },
+ {
+ "pk": 55,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 41,
+ "number": "54",
+ "label": "Meurthe-et-Moselle"
+ }
+ },
+ {
+ "pk": 56,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 41,
+ "number": "55",
+ "label": "Meuse"
+ }
+ },
+ {
+ "pk": 57,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 45,
+ "number": "56",
+ "label": "Morbihan"
+ }
+ },
+ {
+ "pk": 58,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 41,
+ "number": "57",
+ "label": "Moselle"
+ }
+ },
+ {
+ "pk": 59,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 39,
+ "number": "58",
+ "label": "Ni\u00e8vre"
+ }
+ },
+ {
+ "pk": 60,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 40,
+ "number": "59",
+ "label": "Nord"
+ }
+ },
+ {
+ "pk": 61,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 35,
+ "number": "60",
+ "label": "Oise"
+ }
+ },
+ {
+ "pk": 62,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 38,
+ "number": "61",
+ "label": "Orne"
+ }
+ },
+ {
+ "pk": 63,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 40,
+ "number": "62",
+ "label": "Pas-de-Calais"
+ }
+ },
+ {
+ "pk": 64,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 51,
+ "number": "63",
+ "label": "Puy-de-D\u00f4me"
+ }
+ },
+ {
+ "pk": 65,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 47,
+ "number": "64",
+ "label": "Pyr\u00e9n\u00e9es-Atlantiques"
+ }
+ },
+ {
+ "pk": 66,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "65",
+ "label": "Hautes-Pyr\u00e9n\u00e9es"
+ }
+ },
+ {
+ "pk": 67,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 52,
+ "number": "66",
+ "label": "Pyr\u00e9n\u00e9es-Orientales"
+ }
+ },
+ {
+ "pk": 68,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 42,
+ "number": "67",
+ "label": "Bas-Rhin"
+ }
+ },
+ {
+ "pk": 69,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 42,
+ "number": "68",
+ "label": "Haut-Rhin"
+ }
+ },
+ {
+ "pk": 70,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "69",
+ "label": "Rh\u00f4ne"
+ }
+ },
+ {
+ "pk": 71,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 43,
+ "number": "70",
+ "label": "Haute-Sa\u00f4ne"
+ }
+ },
+ {
+ "pk": 72,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 39,
+ "number": "71",
+ "label": "Sa\u00f4ne-et-Loire"
+ }
+ },
+ {
+ "pk": 73,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 44,
+ "number": "72",
+ "label": "Sarthe"
+ }
+ },
+ {
+ "pk": 74,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "73",
+ "label": "Savoie"
+ }
+ },
+ {
+ "pk": 75,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 50,
+ "number": "74",
+ "label": "Haute-Savoie"
+ }
+ },
+ {
+ "pk": 76,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "75",
+ "label": "Paris"
+ }
+ },
+ {
+ "pk": 77,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 36,
+ "number": "76",
+ "label": "Seine-Maritime"
+ }
+ },
+ {
+ "pk": 78,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "77",
+ "label": "Seine-et-Marne"
+ }
+ },
+ {
+ "pk": 79,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "78",
+ "label": "Yvelines"
+ }
+ },
+ {
+ "pk": 80,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 46,
+ "number": "79",
+ "label": "Deux-S\u00e8vres"
+ }
+ },
+ {
+ "pk": 81,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 35,
+ "number": "80",
+ "label": "Somme"
+ }
+ },
+ {
+ "pk": 82,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "81",
+ "label": "Tarn"
+ }
+ },
+ {
+ "pk": 83,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 48,
+ "number": "82",
+ "label": "Tarn-et-Garonne"
+ }
+ },
+ {
+ "pk": 84,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 53,
+ "number": "83",
+ "label": "Var"
+ }
+ },
+ {
+ "pk": 85,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 53,
+ "number": "84",
+ "label": "Vaucluse"
+ }
+ },
+ {
+ "pk": 86,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 44,
+ "number": "85",
+ "label": "Vend\u00e9e"
+ }
+ },
+ {
+ "pk": 87,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 46,
+ "number": "86",
+ "label": "Vienne"
+ }
+ },
+ {
+ "pk": 88,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 49,
+ "number": "87",
+ "label": "Haute-Vienne"
+ }
+ },
+ {
+ "pk": 89,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 41,
+ "number": "88",
+ "label": "Vosges"
+ }
+ },
+ {
+ "pk": 90,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 39,
+ "number": "89",
+ "label": "Yonne"
+ }
+ },
+ {
+ "pk": 91,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 43,
+ "number": "90",
+ "label": "Territoire de Belfort"
+ }
+ },
+ {
+ "pk": 92,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "91",
+ "label": "Essonne"
+ }
+ },
+ {
+ "pk": 93,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "92",
+ "label": "Hauts-de-Seine"
+ }
+ },
+ {
+ "pk": 94,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "93",
+ "label": "Seine-Saint-Denis"
+ }
+ },
+ {
+ "pk": 95,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "94",
+ "label": "Val-de-Marne"
+ }
+ },
+ {
+ "pk": 96,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 33,
+ "number": "95",
+ "label": "Val-d'Oise"
+ }
+ },
+ {
+ "pk": 97,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 28,
+ "number": "971",
+ "label": "Guadeloupe"
+ }
+ },
+ {
+ "pk": 98,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 29,
+ "number": "972",
+ "label": "Martinique"
+ }
+ },
+ {
+ "pk": 99,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 30,
+ "number": "973",
+ "label": "Guyane"
+ }
+ },
+ {
+ "pk": 100,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 31,
+ "number": "974",
+ "label": "La R\u00e9union"
+ }
+ },
+ {
+ "pk": 101,
+ "model": "ishtar_common.department",
+ "fields": {
+ "state": 32,
+ "number": "976",
+ "label": "Mayotte"
+ }
+ }
+] \ No newline at end of file
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index 88a3306f4..e6f21ae5b 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-2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2010-2015 É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
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py
index d8740b68c..23d7126c9 100644
--- a/ishtar_common/forms_common.py
+++ b/ishtar_common/forms_common.py
@@ -54,6 +54,14 @@ def get_town_field(label=_(u"Town"), required=True):
validators=[models.valid_id(models.Town)], label=label,
help_text=mark_safe(help_text), required=required)
+def get_advanced_town_field(label=_(u"Town"), required=True):
+ # !FIXME hard_link, reverse_lazy doen't seem to work with formsets
+ return forms.IntegerField(
+ widget=widgets.JQueryTown("/" + settings.URL_PATH + \
+ 'autocomplete-advanced-town'),
+ validators=[models.valid_id(models.Town)], label=label,
+ required=required)
+
def get_person_field(label=_(u"Person"), required=True, person_types=[]):
# !FIXME hard_link, reverse_lazy doen't seem to work with formsets
widget = None
@@ -191,6 +199,13 @@ class OrganizationFormSelection(forms.Form):
OrganizationSelect, models.Organization),
validators=[models.valid_id(models.Organization)])
+class BaseOrganizationForm(forms.ModelForm):
+ form_prefix = "orga"
+ class Meta:
+ model = models.Organization
+ fields = ['name', 'organization_type', 'address', 'address_complement',
+ 'town', 'postal_code',]
+
class PersonSelect(TableSelect):
name = forms.CharField(label=_(u"Name"), max_length=30)
surname = forms.CharField(label=_(u"Surname"), max_length=20)
@@ -242,6 +257,39 @@ class SimplePersonForm(NewItemForm):
associated_model=models.Organization, new=True),
validators=[models.valid_id(models.Organization)], required=False)
+class BasePersonForm(forms.ModelForm):
+ class Meta:
+ model = models.Person
+ fields = ['title', 'name', 'surname', 'address', 'address_complement',
+ 'town', 'postal_code']
+
+class BaseOrganizationPersonForm(forms.ModelForm):
+ class Meta:
+ model = models.Person
+ fields = ['attached_to', 'title', 'name', 'surname',]
+ widgets = {'attached_to':widgets.JQueryPersonOrganization(
+ reverse_lazy('autocomplete-organization'),
+ reverse_lazy('organization_create'),
+ model=models.Organization,
+ attrs={'hidden':True},
+ new=True),
+ }
+
+ def __init__(self, *args, **kwargs):
+ super(BaseOrganizationPersonForm, self).__init__(*args, **kwargs)
+
+ def save(self, *args, **kwargs):
+ person = super(BaseOrganizationPersonForm, self).save(*args, **kwargs)
+ instance = person.attached_to
+ form = BaseOrganizationForm(self.data, instance=instance,
+ prefix=BaseOrganizationForm.form_prefix)
+ if form.is_valid():
+ orga = form.save()
+ if not person.attached_to:
+ person.attached_to = orga
+ person.save()
+ return person
+
class PersonForm(SimplePersonForm):
person_types = forms.MultipleChoiceField(label=_("Person type"),
choices=[], widget=forms.CheckboxSelectMultiple)
diff --git a/ishtar_common/ishtar_menu.py b/ishtar_common/ishtar_menu.py
index fdfe60448..a26234265 100644
--- a/ishtar_common/ishtar_menu.py
+++ b/ishtar_common/ishtar_menu.py
@@ -39,6 +39,9 @@ MENU_SECTIONS = [
childs=[
SectionItem('person', _(u"Person"),
childs=[
+ MenuItem('person_search', _(u"Search"),
+ model=models.Person,
+ access_controls=['add_person', 'add_own_person']),
MenuItem('person_creation', _(u"Creation"),
model=models.Person,
access_controls=['add_person', 'add_own_person']),
@@ -54,6 +57,10 @@ MENU_SECTIONS = [
]),
SectionItem('organization', _(u"Organization"),
childs=[
+ MenuItem('organization_search', _(u"Search"),
+ model=models.Organization,
+ access_controls=['add_organization',
+ 'add_own_organization']),
MenuItem('organization_creation', _(u"Creation"),
model=models.Organization,
access_controls=['add_organization',
diff --git a/ishtar_common/locale/fr/LC_MESSAGES/django.po b/ishtar_common/locale/fr/LC_MESSAGES/django.po
index 0052703e2..92e30b96a 100644
--- a/ishtar_common/locale/fr/LC_MESSAGES/django.po
+++ b/ishtar_common/locale/fr/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: alpha\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-05-20 00:33+0200\n"
+"POT-Creation-Date: 2015-05-20 00:35+0200\n"
"PO-Revision-Date: 2015-01-25\n"
"Last-Translator: Étienne Loks <etienne.loks at peacefrogs net>\n"
"Language-Team: \n"
@@ -32,7 +32,7 @@ msgstr "courriel"
msgid "Archaeological file"
msgstr "Dossier"
-#: context_processors.py:35 models.py:970
+#: context_processors.py:35 models.py:983
msgid "Operation"
msgstr "Opération"
@@ -44,49 +44,49 @@ msgstr "Unité d'Enregistrement"
msgid "Find"
msgstr "Mobilier"
-#: data_importer.py:123
+#: data_importer.py:134
#, python-format
msgid "\"%(value)s\" is too long. The max length is %(length)d characters."
msgstr ""
"\"%(value)s\" est trop long. La longueur maximum est de %(length)d "
"caractères."
-#: data_importer.py:137
+#: data_importer.py:148
#, python-format
msgid "\"%(value)s\" not equal to yes or no"
msgstr "\"%(value)s\" diffère de oui ou non"
-#: data_importer.py:148
+#: data_importer.py:159
#, python-format
msgid "\"%(value)s\" is not a float"
msgstr "\"%(value)s\" n'est pas un flottant"
-#: data_importer.py:160 data_importer.py:172 data_importer.py:346
+#: data_importer.py:171 data_importer.py:183 data_importer.py:372
#, python-format
msgid "\"%(value)s\" is not a valid date"
msgstr "\"%(value)s\" n'est pas une date valide"
-#: data_importer.py:183
+#: data_importer.py:194
#, python-format
msgid "\"%(value)s\" is not an integer"
msgstr "\"%(value)s\" n'est pas un entier"
-#: data_importer.py:223 data_importer.py:380
+#: data_importer.py:236 data_importer.py:408
#, python-format
msgid "Choice for \"%s\" is not available. Which one is relevant?\n"
msgstr "Le choix pour \"%s\" n'est pas disponible. Lequel est pertinent ?\n"
-#: data_importer.py:230
+#: data_importer.py:243
#, python-format
msgid "%d. None of the above - create new"
msgstr "%d. Aucun de ceux-là - créer un nouveau"
-#: data_importer.py:233
+#: data_importer.py:246
#, python-format
msgid "%d. None of the above - skip"
msgstr "%d. Aucun de ceux-là - passer"
-#: data_importer.py:430
+#: data_importer.py:474
msgid ""
"The given file is not correct. Check the file format. If you use a CSV file: "
"check that column separator and encoding are similar to the ones used by the "
@@ -96,41 +96,41 @@ msgstr ""
"utilisez un fichier CSV : vérifiez que le séparateur de colonne et "
"l'encodage sont similaires à ceux du fichier de référence."
-#: data_importer.py:434
+#: data_importer.py:478
#, python-format
msgid "Too many cols (%(user_col)d) when maximum is %(ref_col)d"
msgstr "Trop de colonnes (%(user_col)d). Le maximum est %(ref_col)d"
-#: data_importer.py:436
+#: data_importer.py:480
msgid "No data provided"
msgstr "Aucune donnée fournie"
-#: data_importer.py:437
+#: data_importer.py:481
msgid "Value is required"
msgstr "Valeur requise"
-#: data_importer.py:438
+#: data_importer.py:482
#, python-format
msgid "At least %d columns must be filled"
msgstr "Au moins %d colonnes doivent être remplies"
-#: data_importer.py:439
+#: data_importer.py:483
msgid "The regexp doesn't match."
msgstr "L'expression régulière ne fonctionne pas"
-#: data_importer.py:896
+#: data_importer.py:963
msgid "line"
msgstr "ligne"
-#: data_importer.py:896
+#: data_importer.py:963
msgid "col"
msgstr "colonne"
-#: data_importer.py:896
+#: data_importer.py:963
msgid "error"
msgstr "erreur"
-#: data_importer.py:909
+#: data_importer.py:976
#, python-format
msgid "\"%(value)s\" not in %(values)s"
msgstr "\"%(value)s\" n'est pas dans %(values)s"
@@ -139,7 +139,7 @@ msgstr "\"%(value)s\" n'est pas dans %(values)s"
msgid "Enter a valid name consisting of letters, spaces and hyphens."
msgstr "Entrez un nom correct composé de lettres, espaces et tirets."
-#: forms.py:76 forms_common.py:329
+#: forms.py:76 forms_common.py:377
msgid "Confirm"
msgstr "Confirmation"
@@ -167,8 +167,9 @@ msgstr "Ajouter un nouvel élément"
msgid "Template"
msgstr "Patron"
-#: forms_common.py:43 forms_common.py:151 forms_common.py:232
-#: forms_common.py:237 models.py:901 models.py:1770
+#: forms_common.py:43 forms_common.py:57 forms_common.py:159
+#: forms_common.py:247 forms_common.py:252 models.py:914 models.py:1798
+#: templates/blocks/JQueryAdvancedTown.html:19
#: templates/ishtar/sheet_organization.html:17
#: templates/ishtar/sheet_person.html:20 templates/ishtar/sheet_person.html:30
msgid "Town"
@@ -192,70 +193,70 @@ msgstr ""
"<p class='example'>Par exemple tapez « saint denis 93 » pour obtenir la "
"commune Saint-Denis dans le département français de Seine-Saint-Denis.</p>"
-#: forms_common.py:57 forms_common.py:517 ishtar_menu.py:40 models.py:1546
-#: models.py:1632 models.py:1672 templates/ishtar/sheet_person.html:6
+#: forms_common.py:65 forms_common.py:565 ishtar_menu.py:40 models.py:1559
+#: models.py:1660 models.py:1700 templates/ishtar/sheet_person.html:6
msgid "Person"
msgstr "Individu"
-#: forms_common.py:139 forms_common.py:199 ishtar_menu.py:55 models.py:1484
+#: forms_common.py:147 forms_common.py:214 ishtar_menu.py:58 models.py:1497
#: templates/ishtar/sheet_organization.html:6
msgid "Organization"
msgstr "Organisation"
-#: forms_common.py:141 forms_common.py:177 forms_common.py:195
-#: forms_common.py:224 models.py:850 models.py:1005 models.py:1163
-#: models.py:1479 models.py:1536 models.py:1756
+#: forms_common.py:149 forms_common.py:185 forms_common.py:210
+#: forms_common.py:239 models.py:850 models.py:1018 models.py:1176
+#: models.py:1492 models.py:1549 models.py:1784
#: templates/ishtar/sheet_organization.html:12
#: templates/ishtar/sheet_organization.html:25
#: templates/ishtar/sheet_person.html:12 templates/ishtar/sheet_person.html:26
msgid "Name"
msgstr "Nom"
-#: forms_common.py:143 models.py:965 models.py:1242
+#: forms_common.py:151 models.py:978 models.py:1255
msgid "Organization type"
msgstr "Type d'organisation"
-#: forms_common.py:145 forms_common.py:226 models.py:896
+#: forms_common.py:153 forms_common.py:241 models.py:909
#: templates/ishtar/sheet_organization.html:14
#: templates/ishtar/sheet_person.html:17 templates/ishtar/sheet_person.html:27
msgid "Address"
msgstr "Adresse"
-#: forms_common.py:147 forms_common.py:228 models.py:897
+#: forms_common.py:155 forms_common.py:243 models.py:910
#: templates/ishtar/sheet_organization.html:15
#: templates/ishtar/sheet_person.html:18 templates/ishtar/sheet_person.html:28
msgid "Address complement"
msgstr "Complément d'adresse"
-#: forms_common.py:149 forms_common.py:230 models.py:899
+#: forms_common.py:157 forms_common.py:245 models.py:912
#: templates/ishtar/sheet_organization.html:16
#: templates/ishtar/sheet_person.html:19 templates/ishtar/sheet_person.html:29
msgid "Postal code"
msgstr "Code postal"
-#: forms_common.py:152 forms_common.py:233 models.py:902
+#: forms_common.py:160 forms_common.py:248 models.py:915
msgid "Country"
msgstr "Pays"
-#: forms_common.py:154 forms_common.py:197 forms_common.py:235
-#: forms_common.py:287 models.py:907 templates/ishtar/sheet_person.html:15
+#: forms_common.py:162 forms_common.py:212 forms_common.py:250
+#: forms_common.py:335 models.py:920 templates/ishtar/sheet_person.html:15
msgid "Email"
msgstr "Courriel"
-#: forms_common.py:155 forms_common.py:236 models.py:904
+#: forms_common.py:163 forms_common.py:251 models.py:917
#: templates/ishtar/sheet_organization.html:18
#: templates/ishtar/sheet_person.html:21 templates/ishtar/sheet_person.html:31
msgid "Phone"
msgstr "Téléphone"
-#: forms_common.py:156 models.py:905
+#: forms_common.py:164 models.py:918
#: templates/ishtar/sheet_organization.html:19
#: templates/ishtar/sheet_person.html:22 templates/ishtar/sheet_person.html:32
msgid "Mobile phone"
msgstr "Téléphone portable"
-#: forms_common.py:178 forms_common.py:198 models.py:1257 models.py:1481
-#: models.py:1708 templates/sheet_ope.html:85 templates/sheet_ope.html.py:105
+#: forms_common.py:186 forms_common.py:213 models.py:1270 models.py:1494
+#: models.py:1736 templates/sheet_ope.html:85 templates/sheet_ope.html.py:105
#: templates/sheet_ope.html:126 templates/ishtar/import_list.html:13
#: templates/ishtar/sheet_organization.html:27
#: templates/ishtar/sheet_person.html:42 templates/ishtar/sheet_person.html:95
@@ -263,121 +264,121 @@ msgstr "Téléphone portable"
msgid "Type"
msgstr "Type"
-#: forms_common.py:186
+#: forms_common.py:194 views.py:106
msgid "Organization search"
msgstr "Recherche d'organisations"
-#: forms_common.py:196 forms_common.py:222 models.py:1534
+#: forms_common.py:211 forms_common.py:237 models.py:1547
#: templates/ishtar/sheet_organization.html:26
#: templates/ishtar/sheet_person.html:13
msgid "Surname"
msgstr "Prénom"
-#: forms_common.py:210
+#: forms_common.py:225 views.py:80
msgid "Person search"
msgstr "Recherche d'individus"
-#: forms_common.py:219
+#: forms_common.py:234
msgid "Identity"
msgstr "Identité"
-#: forms_common.py:221 forms_common.py:474 models.py:1532 models.py:1705
+#: forms_common.py:236 forms_common.py:522 models.py:1545 models.py:1733
#: templates/sheet_ope.html:104 templates/ishtar/sheet_person.html:94
#: templates/ishtar/blocks/window_tables/documents.html:5
msgid "Title"
msgstr "Titre"
-#: forms_common.py:239
+#: forms_common.py:254
msgid "Current organization"
msgstr "Organisation actuelle"
-#: forms_common.py:246 forms_common.py:269 forms_common.py:272 models.py:1517
+#: forms_common.py:294 forms_common.py:317 forms_common.py:320 models.py:1530
msgid "Person type"
msgstr "Type d'individu"
-#: forms_common.py:282 forms_common.py:286
+#: forms_common.py:330 forms_common.py:334
msgid "Account"
msgstr "Compte"
-#: forms_common.py:289 wizards.py:938
+#: forms_common.py:337 wizards.py:948
msgid "New password"
msgstr "Nouveau mot de passe"
-#: forms_common.py:293
+#: forms_common.py:341
msgid "New password (confirmation)"
msgstr "Nouveau mot de passe (confirmation)"
-#: forms_common.py:311
+#: forms_common.py:359
msgid "Your password and confirmation password do not match."
msgstr "La vérification du mot de passe a échoué."
-#: forms_common.py:316
+#: forms_common.py:364
msgid "You must provide a correct password."
msgstr "Vous devez fournir un mot de passe correct."
-#: forms_common.py:324
+#: forms_common.py:372
msgid "This username already exists."
msgstr "Ce nom d'utilisateur existe déjà."
-#: forms_common.py:330
+#: forms_common.py:378
msgid "Send the new password by email?"
msgstr "Envoyer le nouveau mot de passe par courriel ?"
-#: forms_common.py:338 forms_common.py:350 models.py:1771
+#: forms_common.py:386 forms_common.py:398 models.py:1799
#: templates/ishtar/sheet_person.html:72
msgid "Towns"
msgstr "Communes"
-#: forms_common.py:347
+#: forms_common.py:395
msgid "There are identical towns."
msgstr "Il y a des communes identiques."
-#: forms_common.py:426
+#: forms_common.py:474
msgid "Only one choice can be checked."
msgstr "Seul un choix peut être coché."
-#: forms_common.py:472
+#: forms_common.py:520
msgid "Documentation informations"
msgstr "Information sur le document"
-#: forms_common.py:476 forms_common.py:495 models.py:1243 models.py:1691
+#: forms_common.py:524 forms_common.py:543 models.py:1256 models.py:1719
msgid "Source type"
msgstr "Type de source"
-#: forms_common.py:478 models.py:1718
+#: forms_common.py:526 models.py:1746
msgid "Numerical ressource (web address)"
msgstr "Ressource numérique (adresse web)"
-#: forms_common.py:479 models.py:1720
+#: forms_common.py:527 models.py:1748
msgid "Receipt date"
msgstr "Date de réception"
-#: forms_common.py:481 models.py:1353 models.py:1722
+#: forms_common.py:529 models.py:1366 models.py:1750
msgid "Creation date"
msgstr "Date de création"
-#: forms_common.py:492 forms_common.py:511 forms_common.py:542 models.py:1677
+#: forms_common.py:540 forms_common.py:559 forms_common.py:590 models.py:1705
#: templates/ishtar/wizard/wizard_person_deletion.html:124
msgid "Author"
msgstr "Auteur"
-#: forms_common.py:504
+#: forms_common.py:552
msgid "Would you like to delete this documentation?"
msgstr "Voulez-vous supprimer ce document ?"
-#: forms_common.py:518 models.py:1244 models.py:1668 models.py:1674
+#: forms_common.py:566 models.py:1257 models.py:1696 models.py:1702
msgid "Author type"
msgstr "Type d'auteur"
-#: forms_common.py:536
+#: forms_common.py:584
msgid "Author selection"
msgstr "Sélection d'auteur"
-#: forms_common.py:548
+#: forms_common.py:596
msgid "There are identical authors."
msgstr "Il y a des auteurs identiques."
-#: forms_common.py:552 models.py:1678 models.py:1715
+#: forms_common.py:600 models.py:1706 models.py:1743
#: templates/sheet_ope.html:106
#: templates/ishtar/blocks/window_tables/documents.html:7
msgid "Authors"
@@ -387,11 +388,11 @@ msgstr "Auteurs"
msgid "Administration"
msgstr "Administration"
-#: ishtar_menu.py:30 views.py:122
+#: ishtar_menu.py:30 views.py:132
msgid "Account management"
msgstr "Gestion des comptes"
-#: ishtar_menu.py:33 models.py:641 views.py:864
+#: ishtar_menu.py:33 models.py:641 views.py:930
msgid "Global variables"
msgstr "Variables globales"
@@ -399,35 +400,39 @@ msgstr "Variables globales"
msgid "Directory"
msgstr "Annuaire"
-#: ishtar_menu.py:42 ishtar_menu.py:57 templates/ishtar/import_list.html:15
+#: ishtar_menu.py:42 ishtar_menu.py:60 templates/blocks/JQueryJqGrid.html:4
+msgid "Search"
+msgstr "Recherche"
+
+#: ishtar_menu.py:45 ishtar_menu.py:64 templates/ishtar/import_list.html:15
msgid "Creation"
msgstr "Ajout"
-#: ishtar_menu.py:45 ishtar_menu.py:61
+#: ishtar_menu.py:48 ishtar_menu.py:68
msgid "Modification"
msgstr "Modification"
-#: ishtar_menu.py:48 ishtar_menu.py:65 templates/ishtar/merge.html:5
+#: ishtar_menu.py:51 ishtar_menu.py:72 templates/ishtar/merge.html:5
msgid "Merge"
msgstr "Fusion"
-#: ishtar_menu.py:51 ishtar_menu.py:68 models.py:1383 widgets.py:107
+#: ishtar_menu.py:54 ishtar_menu.py:75 models.py:1396 widgets.py:108
msgid "Delete"
msgstr "Suppression"
-#: ishtar_menu.py:75 models.py:1361
+#: ishtar_menu.py:82 models.py:1374
msgid "Imports"
msgstr "Imports"
-#: ishtar_menu.py:77 views.py:871
+#: ishtar_menu.py:84 views.py:937
msgid "New import"
msgstr "Nouvel import"
-#: ishtar_menu.py:80 views.py:884
+#: ishtar_menu.py:87 views.py:950
msgid "Current imports"
msgstr "Imports en cours"
-#: ishtar_menu.py:83
+#: ishtar_menu.py:90
msgid "Old imports"
msgstr "Anciens imports"
@@ -443,7 +448,7 @@ msgstr "Un élément sélectionné n'est pas valide."
msgid "This item already exist."
msgstr "Cet élément existe déjà."
-#: models.py:239 models.py:884
+#: models.py:239 models.py:884 models.py:895
msgid "Label"
msgstr "Libellé"
@@ -451,7 +456,7 @@ msgstr "Libellé"
msgid "Textual ID"
msgstr "Identifiant textuel"
-#: models.py:242 models.py:1729
+#: models.py:242 models.py:1757
msgid "Comment"
msgstr "Commentaire"
@@ -459,7 +464,7 @@ msgstr "Commentaire"
msgid "Available"
msgstr "Disponible"
-#: models.py:415 models.py:1207
+#: models.py:415 models.py:1220
msgid "Key"
msgstr "Clé"
@@ -483,7 +488,7 @@ msgstr "Nom de la variable"
msgid "Description of the variable"
msgstr "Description de la variable"
-#: models.py:638 models.py:1208
+#: models.py:638 models.py:1221
msgid "Value"
msgstr "Valeur"
@@ -495,7 +500,7 @@ msgstr "Variables globales"
msgid "Total"
msgstr "Total"
-#: models.py:762 models.py:885
+#: models.py:762 models.py:885 models.py:896
#: templates/ishtar/dashboards/dashboard_main_detail.html:135
#: templates/ishtar/dashboards/dashboard_main_detail_users.html:26
msgid "Number"
@@ -517,423 +522,423 @@ msgstr "Patron de document"
msgid "Document templates"
msgstr "Patrons de documents"
-#: models.py:888
+#: models.py:888 models.py:897 models.py:1364
+msgid "State"
+msgstr "État"
+
+#: models.py:901 templates/blocks/JQueryAdvancedTown.html:12
msgid "Department"
msgstr "Département"
-#: models.py:889
+#: models.py:902
msgid "Departments"
msgstr "Départements"
-#: models.py:914
+#: models.py:927
msgid "Merge key"
msgstr "Clé de fusion"
-#: models.py:966
+#: models.py:979
msgid "Organization types"
msgstr "Types d'organisation"
-#: models.py:971
+#: models.py:984
msgid "Parcels"
msgstr "Parcelles"
-#: models.py:973
+#: models.py:986
msgid "Operation source"
msgstr "Documentation de l'opération"
-#: models.py:976 views.py:709 views.py:765
+#: models.py:989 views.py:761 views.py:817
msgid "Archaeological files"
msgstr "Dossiers archéologiques"
-#: models.py:980 views.py:712 views.py:774
+#: models.py:993 views.py:764 views.py:826
msgid "Context records"
msgstr "Unité d'Enregistrement"
-#: models.py:1007 models.py:1164 models.py:1728 templates/sheet_ope.html:128
+#: models.py:1020 models.py:1177 models.py:1756 templates/sheet_ope.html:128
msgid "Description"
msgstr "Description"
-#: models.py:1009 templates/ishtar/dashboards/dashboard_main.html:26
+#: models.py:1022 templates/ishtar/dashboards/dashboard_main.html:26
msgid "Users"
msgstr "Utilisateurs"
-#: models.py:1011
+#: models.py:1024
msgid "Associated model"
msgstr "Modèle associé"
-#: models.py:1013
+#: models.py:1026
msgid "Is template"
msgstr "Est un patron"
-#: models.py:1015
+#: models.py:1028
msgid "Importer - Type"
msgstr "Importeur - Type"
-#: models.py:1016
+#: models.py:1029
msgid "Importer - Types"
msgstr "Importeur - Types"
-#: models.py:1085
+#: models.py:1098
msgid "Importer - Default"
msgstr "Importeur - Par défaut"
-#: models.py:1086
+#: models.py:1099
msgid "Importer - Defaults"
msgstr "Importeur - Par défaut"
-#: models.py:1112
+#: models.py:1125
msgid "Importer - Default value"
msgstr "Importeur - Valeur par défaut"
-#: models.py:1113
+#: models.py:1126
msgid "Importer - Default values"
msgstr "Importeur - Valeurs par défaut"
-#: models.py:1144
+#: models.py:1157
msgid "Column number"
msgstr "Numéro de colonne"
-#: models.py:1146
+#: models.py:1159
msgid "Required"
msgstr "Requis"
-#: models.py:1148
+#: models.py:1161
msgid "Importer - Column"
msgstr "Importeur - Colonne"
-#: models.py:1149
+#: models.py:1162
msgid "Importer - Columns"
msgstr "Importeur - Colonnes"
-#: models.py:1156
+#: models.py:1169
msgid "Field name"
msgstr "Nom du champ"
-#: models.py:1159
+#: models.py:1172
msgid "Importer - Duplicate field"
msgstr "Importeur - Champ dupliqué"
-#: models.py:1160
+#: models.py:1173
msgid "Importer - Duplicate fields"
msgstr "Importeur - Champs dupliqués"
-#: models.py:1166
+#: models.py:1179
msgid "Regular expression"
msgstr "Expression régulière"
-#: models.py:1168
+#: models.py:1181
msgid "Importer - Regular expression"
msgstr "Importeur - Expression régulière"
-#: models.py:1169
+#: models.py:1182
msgid "Importer - Regular expressions"
msgstr "Importeur - Expressions régulières"
-#: models.py:1183
+#: models.py:1196
msgid "Importer - Target"
msgstr "Importeur - Cible"
-#: models.py:1184
+#: models.py:1197
msgid "Importer - Targets"
msgstr "Importeur - Cibles"
-#: models.py:1209
+#: models.py:1222
msgid "Is set"
msgstr "Est défini"
-#: models.py:1245 models.py:1701 models.py:1711
+#: models.py:1258 models.py:1729 models.py:1739
msgid "Format"
msgstr "Format"
-#: models.py:1246
+#: models.py:1259
msgid "Operation type"
msgstr "Type d'opération"
-#: models.py:1247
+#: models.py:1260
msgid "Period"
msgstr "Périodes"
-#: models.py:1253
+#: models.py:1266
msgid "Integer"
msgstr "Entier"
-#: models.py:1254
+#: models.py:1267
msgid "Float"
msgstr "Nombre à virgule"
-#: models.py:1255
+#: models.py:1268
msgid "String"
msgstr "Chaine de caractères"
-#: models.py:1256 templates/sheet_ope.html:86
+#: models.py:1269 templates/sheet_ope.html:86
msgid "Date"
msgstr "Date"
-#: models.py:1258 templates/sheet_ope.html:61 templates/sheet_ope.html.py:83
+#: models.py:1271 templates/sheet_ope.html:61 templates/sheet_ope.html.py:83
#: templates/ishtar/sheet_person.html:39 templates/ishtar/sheet_person.html:68
#: templates/ishtar/sheet_person.html:93
#: templates/ishtar/dashboards/dashboard_main_detail.html:120
msgid "Year"
msgstr "Année"
-#: models.py:1271
+#: models.py:1284
msgid "4 digit year. e.g.: \"2015\""
msgstr "Année à 4 chiffres. Exemple : « 2015 »"
-#: models.py:1272
+#: models.py:1285
msgid "4 digit year/month/day. e.g.: \"2015/02/04\""
msgstr "Année à 4 chiffres/mois/jour. Exemple : « 2015/02/04 »"
-#: models.py:1273
+#: models.py:1286
msgid "Day/month/4 digit year. e.g.: \"04/02/2015\""
msgstr "Jour/mois/année à 4 chiffres. Exemple : « 04/02/2015 »"
-#: models.py:1282
+#: models.py:1295
msgid "Options"
msgstr "Options"
-#: models.py:1284
+#: models.py:1297
msgid "Split character(s)"
msgstr "Caractère de séparation"
-#: models.py:1287
+#: models.py:1300
msgid "Importer - Formater type"
msgstr "Importeur - Type de mise en forme"
-#: models.py:1288
+#: models.py:1301
msgid "Importer - Formater types"
msgstr "Importeur - Types de mise en forme"
-#: models.py:1327 templates/ishtar/dashboards/dashboard_main_detail.html:61
+#: models.py:1340 templates/ishtar/dashboards/dashboard_main_detail.html:61
msgid "Created"
msgstr "Créé"
-#: models.py:1328
+#: models.py:1341
msgid "Analyse in progress"
msgstr "Analyse en cours"
-#: models.py:1329
+#: models.py:1342
msgid "Analysed"
msgstr "Analysé"
-#: models.py:1330
+#: models.py:1343
msgid "Import pending"
msgstr "Import en attente"
-#: models.py:1331
+#: models.py:1344
msgid "Import in progress"
msgstr "Import en cours"
-#: models.py:1332
+#: models.py:1345
msgid "Finished with errors"
msgstr "Finis avec des erreurs"
-#: models.py:1333
+#: models.py:1346
msgid "Finished"
msgstr "Terminé"
-#: models.py:1334
+#: models.py:1347
msgid "Archived"
msgstr "Archivé"
-#: models.py:1342
+#: models.py:1355
msgid "Imported file"
msgstr "Fichier importé"
-#: models.py:1344
+#: models.py:1357
msgid "Skip lines"
msgstr "Nombre de lignes d'entête"
-#: models.py:1345 templates/ishtar/import_list.html:47
+#: models.py:1358 templates/ishtar/import_list.html:47
msgid "Error file"
msgstr "Fichier erreur"
-#: models.py:1348
+#: models.py:1361
msgid "Result file"
msgstr "Fichier résultant"
-#: models.py:1351
-msgid "State"
-msgstr "État"
-
-#: models.py:1355
+#: models.py:1368
msgid "End date"
msgstr "Date de fin"
-#: models.py:1357
+#: models.py:1370
msgid "Seconds remaining"
msgstr "Secondes restantes"
-#: models.py:1360
+#: models.py:1373
msgid "Import"
msgstr "Import"
-#: models.py:1377
+#: models.py:1390
msgid "Analyse"
msgstr "Analyser"
-#: models.py:1379
+#: models.py:1392
msgid "Re-analyse"
msgstr "Analyser de nouveau "
-#: models.py:1380
+#: models.py:1393
msgid "Launch import"
msgstr "Lancer l'import"
-#: models.py:1382
+#: models.py:1395
msgid "Archive"
msgstr "Archiver"
-#: models.py:1485
+#: models.py:1498
msgid "Organizations"
msgstr "Organisations"
-#: models.py:1487
+#: models.py:1500
msgid "Can view all Organization"
msgstr "Peut voir toutes les Organisations"
-#: models.py:1488
+#: models.py:1501
msgid "Can view own Organization"
msgstr "Peut voir sa propre Organisation"
-#: models.py:1489
+#: models.py:1502
msgid "Can add own Organization"
msgstr "Peut ajouter sa propre Organisation"
-#: models.py:1490
+#: models.py:1503
msgid "Can change own Organization"
msgstr "Peut changer sa propre Organisation"
-#: models.py:1491
+#: models.py:1504
msgid "Can delete own Organization"
msgstr "Peut supprimer sa propre Organisation"
-#: models.py:1514
+#: models.py:1527
msgid "Groups"
msgstr "Groupes"
-#: models.py:1518
+#: models.py:1531
msgid "Person types"
msgstr "Types d'individu"
-#: models.py:1524
+#: models.py:1537
msgid "Mr"
msgstr "M."
-#: models.py:1525
+#: models.py:1538
msgid "Miss"
msgstr "Mlle"
-#: models.py:1526
+#: models.py:1539
msgid "Mr and Miss"
msgstr "M. et Mme"
-#: models.py:1527
+#: models.py:1540
msgid "Mrs"
msgstr "Mme"
-#: models.py:1528
+#: models.py:1541
msgid "Doctor"
msgstr "Dr."
-#: models.py:1538
+#: models.py:1551
msgid "Raw name"
msgstr "Nom brut"
-#: models.py:1540 models.py:1577
+#: models.py:1553 models.py:1593
msgid "Types"
msgstr "Types"
-#: models.py:1543
+#: models.py:1556
msgid "Is attached to"
msgstr "Est rattaché à"
-#: models.py:1547
+#: models.py:1560
msgid "Persons"
msgstr "Individus"
-#: models.py:1549
+#: models.py:1562
msgid "Can view all Person"
msgstr "Peut voir toutes les Personnes"
-#: models.py:1550
+#: models.py:1563
msgid "Can view own Person"
msgstr "Peut voir sa propre Personne"
-#: models.py:1551
+#: models.py:1564
msgid "Can add own Person"
msgstr "Peut ajouter sa propre Personne"
-#: models.py:1552
+#: models.py:1565
msgid "Can change own Person"
msgstr "Peut changer sa propre Personne"
-#: models.py:1553
+#: models.py:1566
msgid "Can delete own Person"
msgstr "Peut supprimer sa propre Personne"
-#: models.py:1636
+#: models.py:1664
msgid "Ishtar user"
msgstr "Utilisateur d'Ishtar"
-#: models.py:1637
+#: models.py:1665
msgid "Ishtar users"
msgstr "Utilisateurs d'Ishtar"
-#: models.py:1669
+#: models.py:1697
msgid "Author types"
msgstr "Types d'auteur"
-#: models.py:1692
+#: models.py:1720
msgid "Source types"
msgstr "Types de source"
-#: models.py:1696
+#: models.py:1724
msgid "Support type"
msgstr "Type de support"
-#: models.py:1697
+#: models.py:1725
msgid "Support types"
msgstr "Types de support"
-#: models.py:1702
+#: models.py:1730
msgid "Formats"
msgstr "Formats"
-#: models.py:1706
+#: models.py:1734
msgid "External ID"
msgstr "Identifiant extern"
-#: models.py:1709
+#: models.py:1737
msgid "Support"
msgstr "Support"
-#: models.py:1713
+#: models.py:1741
msgid "Scale"
msgstr "Échelle"
-#: models.py:1723
+#: models.py:1751
msgid "Item number"
msgstr "Numéro d'élément"
-#: models.py:1724 templates/ishtar/sheet_person.html:40
+#: models.py:1752 templates/ishtar/sheet_person.html:40
#: templates/ishtar/sheet_person.html:67
msgid "Ref."
msgstr "Réf."
-#: models.py:1726
+#: models.py:1754
msgid "Internal reference"
msgstr "Référence interne"
-#: models.py:1730
+#: models.py:1758
msgid "Additional information"
msgstr "Informations supplémentaires"
-#: models.py:1757
+#: models.py:1785
msgid "Surface (m²)"
msgstr "Surface (m²)"
-#: models.py:1758 templates/sheet_ope.html:46 templates/sheet_ope.html.py:107
+#: models.py:1786 templates/sheet_ope.html:46 templates/sheet_ope.html.py:107
msgid "Localisation"
msgstr "Localisation"
@@ -941,90 +946,98 @@ msgstr "Localisation"
msgid " (...)"
msgstr " (...)"
-#: views.py:82
+#: views.py:87
msgid "New person"
msgstr "Nouvelle personne"
-#: views.py:90
+#: views.py:95
msgid "Person modification"
msgstr "Modification d'une personne"
-#: views.py:96
+#: views.py:101
msgid "Person deletion"
msgstr "Suppression de personne"
-#: views.py:102
+#: views.py:112
msgid "New organization"
msgstr "Nouvelle organisation"
-#: views.py:109
+#: views.py:119
msgid "Organization modification"
msgstr "Modification d'une organisation"
-#: views.py:115
+#: views.py:125
msgid "Organization deletion"
msgstr "Suppression d'une organisation"
-#: views.py:212
+#: views.py:261
msgid "True"
msgstr "Oui"
-#: views.py:214
+#: views.py:263
msgid "False"
msgstr "Non"
-#: views.py:437 templates/base.html:75
+#: views.py:486 templates/base.html:76
#: templates/ishtar/sheet_organization.html:35
#: templates/ishtar/sheet_person.html:57 templates/ishtar/sheet_person.html:83
msgid "Details"
msgstr "Détails"
-#: views.py:645 views.py:692
+#: views.py:697 views.py:744
msgid "Operation not permitted."
msgstr "Opération non permise."
-#: views.py:647
+#: views.py:699
#, python-format
msgid "New %s"
msgstr "Nouveau %s"
-#: views.py:710 views.py:769
+#: views.py:762 views.py:821
msgid "Operations"
msgstr "Opérations"
-#: views.py:714 views.py:779
+#: views.py:766 views.py:831
msgid "Finds"
msgstr "Mobilier"
-#: views.py:928 templates/ishtar/import_list.html:43
+#: views.py:994 templates/ishtar/import_list.html:43
msgid "Link unmatched items"
msgstr "Associer les éléments non rapprochés"
-#: views.py:942
+#: views.py:1008
msgid "Delete import"
msgstr "Suppression de l'import"
-#: widgets.py:352
+#: views.py:1056 views.py:1071
+msgid "Corporation manager"
+msgstr "Représentant de la personne morale"
+
+#: widgets.py:222 widgets.py:326 widgets.py:441
+msgid "Search..."
+msgstr "Recherche..."
+
+#: widgets.py:552
msgid "No results"
msgstr "Pas de résultats"
-#: widgets.py:353
+#: widgets.py:553
msgid "Loading..."
msgstr "Chargement..."
-#: widgets.py:354
+#: widgets.py:554
msgid "Remove"
msgstr "Enlever"
-#: wizards.py:227 templates/ishtar/import_delete.html:14
+#: wizards.py:230 templates/ishtar/import_delete.html:14
msgid "Yes"
msgstr "Oui"
-#: wizards.py:229
+#: wizards.py:232
msgid "No"
msgstr "Non"
-#: wizards.py:992
+#: wizards.py:1002
#, python-format
msgid "[%(app_name)s] Account creation/modification"
msgstr "[%(app_name)s] Ajout - modification du compte"
@@ -1063,38 +1076,38 @@ msgstr "Merci pour l'intérêt que vous portez au projet."
msgid "The %(app_name)s team"
msgstr "L'équipe %(app_name)s"
-#: templates/base.html:29
+#: templates/base.html:30
msgid "Logged in"
msgstr "Connecté"
-#: templates/base.html:30
+#: templates/base.html:31
msgid "Log out"
msgstr "Déconnexion"
-#: templates/base.html:31
+#: templates/base.html:32
msgid "Change password"
msgstr "Changement de mot de passe"
-#: templates/base.html:33 templates/registration/activate.html:10
+#: templates/base.html:34 templates/registration/activate.html:10
#: templates/registration/login.html:8 templates/registration/login.html:10
#: templates/registration/password_reset_complete.html:8
msgid "Log in"
msgstr "Connexion"
-#: templates/base.html:39
+#: templates/base.html:40
msgid "Lang"
msgstr "Langue"
-#: templates/base.html:39 templates/base.html.py:86
+#: templates/base.html:40 templates/base.html.py:87
#: templates/ishtar/import_delete.html:10
msgid ":"
msgstr " :"
-#: templates/base.html:64
+#: templates/base.html:65
msgid "Default selected items"
msgstr "Éléments sélectionnés par défaut"
-#: templates/base.html:84
+#: templates/base.html:85
msgid "Current items"
msgstr "Éléments courants"
@@ -1333,9 +1346,14 @@ msgstr "Ajout"
msgid "Ishtar administration"
msgstr "Administration d'Ishtar"
-#: templates/blocks/JQueryJqGrid.html:4
-msgid "Search"
-msgstr "Recherche"
+#: templates/blocks/JQueryAdvancedTown.html:3
+msgctxt "Région"
+msgid "State"
+msgstr "Région"
+
+#: templates/blocks/JQueryAdvancedTown.html:29
+msgid "Choose a state first"
+msgstr "Choisissez une région"
#: templates/blocks/JQueryJqGrid.html:10
msgid "Search and select an item"
@@ -1365,14 +1383,10 @@ msgstr "Aide"
#: templates/ishtar/form.html:10 templates/ishtar/formset.html:8
#: templates/ishtar/import_list.html:55 templates/ishtar/merge.html:31
-#: templates/ishtar/wizard/confirm_wizard.html:40
-#: templates/ishtar/wizard/default_wizard.html:28
-#: templates/ishtar/wizard/default_wizard.html:44
-#: templates/ishtar/wizard/parcels_wizard.html:12
-#: templates/ishtar/wizard/parcels_wizard.html:27
+#: templates/ishtar/wizard/confirm_wizard.html:41
+#: templates/ishtar/wizard/default_wizard.html:29
#: templates/ishtar/wizard/search.html:13
-#: templates/ishtar/wizard/towns_wizard.html:12
-#: templates/ishtar/wizard/towns_wizard.html:32
+#: templates/ishtar/wizard/validation_bar.html:4
msgid "Validate"
msgstr "Valider"
@@ -1445,6 +1459,36 @@ msgstr "A doublonne B"
msgid "Is not duplicate"
msgstr "N'est pas un doublon"
+#: templates/ishtar/organization_person_form.html:9
+#: templates/ishtar/person_form.html:9
+msgid "Identification"
+msgstr "Identification"
+
+#: templates/ishtar/organization_person_form.html:32
+#: templates/ishtar/person_form.html:43
+msgid "Modify"
+msgstr "Modifier"
+
+#: templates/ishtar/organization_person_form.html:33
+#: templates/ishtar/person_form.html:44
+msgid "New"
+msgstr "Nouveau"
+
+#: templates/ishtar/organization_person_form.html:34
+#: templates/ishtar/person_form.html:45
+msgid "Save"
+msgstr "Enregistrer"
+
+#: templates/ishtar/organization_person_form.html:35
+#: templates/ishtar/person_form.html:46
+#: templates/ishtar/wizard/validation_bar.html:6
+msgid "Cancel"
+msgstr "Annuler"
+
+#: templates/ishtar/person_form.html:24
+msgid "Contact informations"
+msgstr "Coordonnées"
+
#: templates/ishtar/sheet.html:21
msgid "Previous"
msgstr "Précédent"
@@ -1626,22 +1670,17 @@ msgstr "Type d'utilisateur"
msgid "You have entered the following informations:"
msgstr "Vous avez entré les informations suivantes :"
-#: templates/ishtar/wizard/confirm_wizard.html:39
+#: templates/ishtar/wizard/confirm_wizard.html:40
msgid "Would you like to save them?"
msgstr "Voulez-vous sauver ces informations ?"
-#: templates/ishtar/wizard/default_wizard.html:34
-#: templates/ishtar/wizard/parcels_wizard.html:24
+#: templates/ishtar/wizard/default_wizard.html:35
+#: templates/ishtar/wizard/parcels_wizard.html:23
#: templates/ishtar/wizard/search.html:20
-#: templates/ishtar/wizard/towns_wizard.html:20
+#: templates/ishtar/wizard/towns_wizard.html:19
msgid "Add/Modify"
msgstr "Ajouter-Modifier"
-#: templates/ishtar/wizard/default_wizard.html:45
-#: templates/ishtar/wizard/parcels_wizard.html:28
-msgid "Validate and end"
-msgstr "Valider et confirmer"
-
#: templates/ishtar/wizard/default_wizard.html:56
msgid ""
"The form has changed if you don't validate it all your changes will be lost."
@@ -1649,18 +1688,22 @@ msgstr ""
"Le formulaire a changé. Si vous ne le validez pas, tous vos changements "
"seront perdus."
-#: templates/ishtar/wizard/parcels_wizard.html:20
+#: templates/ishtar/wizard/parcels_wizard.html:19
msgid "all"
msgstr "tout"
-#: templates/ishtar/wizard/parcels_wizard.html:23
+#: templates/ishtar/wizard/parcels_wizard.html:22
msgid "Add all parcels from the archaeological file"
msgstr "Ajouter toutes les parcelles du dossier archéologique associé"
-#: templates/ishtar/wizard/towns_wizard.html:28
+#: templates/ishtar/wizard/towns_wizard.html:27
msgid "No town set in the associated file."
msgstr "Pas de commune dans le dossier associé."
+#: templates/ishtar/wizard/validation_bar.html:5
+msgid "Validate and end"
+msgstr "Valider et confirmer"
+
#: templates/ishtar/wizard/wizard_closing_done.html:4
msgid "Item successfully closed"
msgstr "Élément clos avec succès"
@@ -1946,9 +1989,6 @@ msgstr ""
#~ msgid "Activity:"
#~ msgstr "Activité :"
-#~ msgid "Identification:"
-#~ msgstr "Identification :"
-
#~ msgid "Interpretation:"
#~ msgstr "Interpretation :"
diff --git a/ishtar_common/management/commands/update_towns.py b/ishtar_common/management/commands/update_towns.py
new file mode 100644
index 000000000..fa201b677
--- /dev/null
+++ b/ishtar_common/management/commands/update_towns.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import csv
+import datetime, time
+
+from django.conf import settings
+from django.core.management.base import BaseCommand, CommandError
+
+from ishtar_common import tasks
+
+class Command(BaseCommand):
+ help = "Update department for french towns"
+
+ def handle(self, *args, **options):
+ self.stdout.write("* Loading towns\n")
+ self.stdout.flush()
+ created, updated = tasks.update_towns()
+ self.stdout.write("%d towns created, %s towns updated\n\n" % (created,
+ updated))
+ self.stdout.flush()
+
diff --git a/ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py b/ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py
new file mode 100644
index 000000000..3f7a2e498
--- /dev/null
+++ b/ishtar_common/migrations/0030_auto__add_state__chg_field_sourcetype_txt_idx__chg_field_authortype_tx.py
@@ -0,0 +1,371 @@
+# -*- 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 'State'
+ db.create_table('ishtar_common_state', (
+ ('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', ['State'])
+
+
+ # Changing field 'SourceType.txt_idx'
+ db.alter_column('ishtar_common_sourcetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'AuthorType.txt_idx'
+ db.alter_column('ishtar_common_authortype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'PersonType.txt_idx'
+ db.alter_column('ishtar_common_persontype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+ # Adding field 'Department.state'
+ db.add_column('ishtar_common_department', 'state',
+ self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.State'], null=True, blank=True),
+ keep_default=False)
+
+
+ # Changing field 'OrganizationType.txt_idx'
+ db.alter_column('ishtar_common_organizationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'SupportType.txt_idx'
+ db.alter_column('ishtar_common_supporttype', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ # Changing field 'Format.txt_idx'
+ db.alter_column('ishtar_common_format', 'txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=100))
+
+ def backwards(self, orm):
+ # Deleting model 'State'
+ db.delete_table('ishtar_common_state')
+
+
+ # Changing field 'SourceType.txt_idx'
+ db.alter_column('ishtar_common_sourcetype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'AuthorType.txt_idx'
+ db.alter_column('ishtar_common_authortype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'PersonType.txt_idx'
+ db.alter_column('ishtar_common_persontype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+ # Deleting field 'Department.state'
+ db.delete_column('ishtar_common_department', 'state_id')
+
+
+ # Changing field 'OrganizationType.txt_idx'
+ db.alter_column('ishtar_common_organizationtype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'SupportType.txt_idx'
+ db.alter_column('ishtar_common_supporttype', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ # Changing field 'Format.txt_idx'
+ db.alter_column('ishtar_common_format', 'txt_idx', self.gf('django.db.models.fields.CharField')(max_length=30, unique=True))
+
+ 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', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"})
+ },
+ 'ishtar_common.authortype': {
+ 'Meta': {'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'}),
+ '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': {'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': {'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'}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '70', 'null': 'True', 'blank': 'True'})
+ },
+ 'ishtar_common.import': {
+ 'Meta': {'object_name': 'Import'},
+ 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+ 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'imported_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
+ 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}),
+ 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', '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': {'object_name': 'ImporterColumn'},
+ 'col_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}),
+ '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']"}),
+ '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']"}),
+ 'field_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
+ },
+ 'ishtar_common.importertype': {
+ 'Meta': {'object_name': 'ImporterType'},
+ 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ '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'}),
+ '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']"}),
+ '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.ishtaruser': {
+ 'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']},
+ '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.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'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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': '300'}),
+ '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': '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'}),
+ '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']"}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', '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.CharField', [], {'max_length': '300', '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'}),
+ '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'}),
+ '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'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2', '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': {'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.targetkey': {
+ 'Meta': {'unique_together': "(('target', 'value'),)", 'object_name': 'TargetKey'},
+ '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.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'})
+ }
+ }
+
+ complete_apps = ['ishtar_common'] \ No newline at end of file
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index d8321e04d..984e9048b 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -238,7 +238,7 @@ class GeneralType(models.Model):
"""
label = models.CharField(_(u"Label"), max_length=100)
txt_idx = models.CharField(_(u"Textual ID"),
- validators=[validate_slug], max_length=30, unique=True)
+ validators=[validate_slug], max_length=100, unique=True)
comment = models.TextField(_(u"Comment"), blank=True, null=True)
available = models.BooleanField(_(u"Available"), default=True)
HELP_TEXT = u""
@@ -365,7 +365,7 @@ class GeneralType(models.Model):
self.label = u" ".join(u" ".join(self.txt_idx.split('-')
).split('_')).title()
if not self.txt_idx:
- self.txt_idx = slugify(self.label)
+ self.txt_idx = slugify(self.label)[:100]
# clean old keys
if self.pk:
@@ -880,9 +880,22 @@ class DocumentTemplate(models.Model):
missing = ooo_replace(self.template, output_name, values)
return output_name
+class State(models.Model):
+ label = models.CharField(_(u"Label"), max_length=30)
+ number = models.CharField(_(u"Number"), unique=True, max_length=3)
+
+ class Meta:
+ verbose_name = _(u"State")
+ ordering = ['number']
+
+ def __unicode__(self):
+ return self.label
+
class Department(models.Model):
label = models.CharField(_(u"Label"), max_length=30)
number = models.CharField(_(u"Number"), unique=True, max_length=3)
+ state = models.ForeignKey('State', verbose_name=_(u"State"), blank=True,
+ null=True)
class Meta:
verbose_name = _(u"Department")
@@ -890,7 +903,7 @@ class Department(models.Model):
ordering = ['number']
def __unicode__(self):
- return u"%s (%s)" % (self.label, self.number)
+ return self.label
class Address(BaseHistorizedItem):
address = models.TextField(_(u"Address"), null=True, blank=True)
@@ -1557,10 +1570,13 @@ class Person(Address, Merge, OwnPerms, ValueGetter) :
values = [unicode(getattr(self, attr))
for attr in ('surname', 'name')
if getattr(self, attr)]
- if not values:
- values = [self.raw_name or ""]
+ if not values and self.raw_name:
+ values = [self.raw_name]
if self.attached_to:
- values.append(u"- " + unicode(self.attached_to))
+ attached_to = unicode(self.attached_to)
+ if values:
+ values.append(u'-')
+ values.append(attached_to)
return u" ".join(values)
def get_values(self, prefix=''):
@@ -1594,6 +1610,9 @@ class Person(Address, Merge, OwnPerms, ValueGetter) :
self.merge_key += "-" + self.attached_to.merge_key
self.merge_key = self.merge_key[:300]
+ def is_natural(self):
+ return not self.attached_to
+
def has_right(self, right_name):
if '.' in right_name:
right_name = right_name.split('.')[-1]
@@ -1628,6 +1647,15 @@ class Person(Address, Merge, OwnPerms, ValueGetter) :
if getattr(self, attr)]
return slugify(u"-".join(values))
+ def save(self, *args, **kwargs):
+ super(Person, self).save(*args, **kwargs)
+ if hasattr(self, 'responsible_town_planning_service'):
+ for fle in self.responsible_town_planning_service.all():
+ fle.save() # force update of raw_town_planning_service
+ if hasattr(self, 'general_contractor'):
+ for fle in self.general_contractor.all():
+ fle.save() # force update of raw_general_contractor
+
class IshtarUser(User):
person = models.ForeignKey(Person, verbose_name=_(u"Person"), unique=True,
related_name='ishtaruser')
diff --git a/ishtar_common/ooo_replace.py b/ishtar_common/ooo_replace.py
index 4c487dd17..54ecfced4 100644
--- a/ishtar_common/ooo_replace.py
+++ b/ishtar_common/ooo_replace.py
@@ -23,6 +23,18 @@ from cStringIO import StringIO
from xml.etree.cElementTree import ElementTree, fromstring
from django.conf import settings
+from ooo_translation import ooo_translation
+
+def translate_context(context, locale):
+ if locale not in ooo_translation:
+ return context
+ new_context = {}
+ for k in context:
+ new_key = k
+ if k in ooo_translation[locale]:
+ new_key = ooo_translation[locale][k]
+ new_context[new_key] = context[k]
+ return new_context
OOO_NS = "{urn:oasis:names:tc:opendocument:xmlns:text:1.0}"
@@ -135,13 +147,9 @@ def _custom_parsing(context, value, default_value=''):
value = re.sub(sub_exp % (pre_tag, base_key), v, value)
return value
-def ooo_replace(infile, outfile, context, default_value=''):
- inzip = ZipFile(infile, 'r', ZIP_DEFLATED)
- outzip = ZipFile(outfile, 'w', ZIP_DEFLATED)
+def _ooo_replace(content, context, missing_keys, default_value=''):
# regular ooo parsing
- content = ElementTree(fromstring(inzip.read('content.xml')))
- missing_keys = set()
for xp in ('variable-set', 'variable-get'):
for p in content.findall(".//"+OOO_NS+xp):
name = p.get(OOO_NS+"name")
@@ -167,12 +175,25 @@ def ooo_replace(infile, outfile, context, default_value=''):
content.write(str_io)
value = str_io.getvalue()
value = _custom_parsing(context, value, default_value).encode('utf-8')
+ return value
+
+def ooo_replace(infile, outfile, context, default_value=''):
+ inzip = ZipFile(infile, 'r', ZIP_DEFLATED)
+ outzip = ZipFile(outfile, 'w', ZIP_DEFLATED)
+
+ values = {}
+ missing_keys = set()
+ for xml_file in ('content.xml', 'styles.xml'):
+ content = ElementTree(fromstring(inzip.read(xml_file)))
+ values[xml_file] = _ooo_replace(content, context, missing_keys,
+ default_value)
for f in inzip.infolist():
- if f.filename == 'content.xml':
- outzip.writestr('content.xml', value)
+ if f.filename in values:
+ outzip.writestr(f.filename, values[f.filename])
else:
outzip.writestr(f, inzip.read(f.filename))
+
inzip.close()
outzip.close()
return missing_keys
diff --git a/ishtar_common/ooo_translation.py b/ishtar_common/ooo_translation.py
new file mode 100644
index 000000000..a93a916ae
--- /dev/null
+++ b/ishtar_common/ooo_translation.py
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2013-2015 É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.conf import settings
+from django.utils import translation
+from django.utils.translation import pgettext_lazy
+
+# [('study', pgettext_lazy('ooo key', u'study')),]
+TRANSLATION_STRINGS = []
+
+ooo_translation = {}
+cur_language = translation.get_language()
+
+try:
+ for language, lbl in settings.LANGUAGES:
+ translation.activate(language)
+ ooo_translation[language] = {}
+ for k, v in TRANSLATION_STRINGS:
+ ooo_translation[language][k] = unicode(v)
+finally:
+ translation.activate(cur_language)
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css
index 5168cba6e..0505e21a5 100644
--- a/ishtar_common/static/media/style.css
+++ b/ishtar_common/static/media/style.css
@@ -3,7 +3,7 @@
background-color:#ff6e6e;
}
-a.add-button, a.remove,
+a.remove,
#progress-content{
background-color:#fff;
}
@@ -16,16 +16,19 @@ div.form {
background-color: #922;
}
+a.add-button, #reset_wizards{
+ background-color: #D14;
+}
+
/* color */
+#window hr,
#context_menu .red,
a, a.remove {
color:#D14;
}
-a.add-button{
- color:#61615C;
-}
-
+a.add-button,
+#reset_wizards,
#window h1{
color:#fff;
}
@@ -49,6 +52,11 @@ div.form {
border:0 solid #CCC;
}
+#window hr{
+ border:0;
+ border-bottom:1px solid #D14;
+}
+
/* shadows */
#progress-content,
.sheet{
@@ -58,6 +66,7 @@ div.form {
}
/* radius */
+a.button,
a.add-button, a.remove,
.sheet,
#progress-content,
@@ -96,6 +105,10 @@ h3{
margin:1em 0 0.5em 0;
}
+h4{
+ margin:10px 0;
+}
+
select{
max-width:550px;
}
@@ -120,6 +133,15 @@ td{
text-align:left;
}
+div.selected{
+ border:1px solid #922;
+}
+
+textarea:disabled,
+input[type="text"]:disabled{
+ background-color: #eee;
+}
+
button{
background-color:#f1f2f6;
border:1px solid #AAA;
@@ -197,8 +219,7 @@ div#header{
width:100%;
text-align:left;
font-size: 0.9em;
- background-color: #f1f2f6;
- border-bottom:1px solid #CCC;
+ background-color: #CCC;
margin-bottom:10px;
line-height:30px;
padding:0 20px;
@@ -218,6 +239,26 @@ div#logo{
background-repeat:no-repeat;
}
+div#validation-bar p{
+ margin:0;
+}
+
+div#validation-bar input{
+ margin:0 30px;
+}
+
+div#validation-bar.big{
+ height:60px;
+}
+
+a.button{
+ padding:0.5em;
+}
+
+#reset_wizards{
+ color: white;
+}
+
.display_details_inline,
.display_details{
display:inline-block;
@@ -348,7 +389,7 @@ div#main_menu > ul > li{
div#content{
clear:both;
- margin:0 200px;
+ margin:0 200px 70px 200px;
text-align:center;
}
@@ -843,6 +884,7 @@ td.submit_button{
a.add-button, a.remove{
padding:0 4px;
+ font-weight:bold;
}
a.remove{
@@ -897,6 +939,10 @@ a.remove{
width:60px;
}
+.small, .small input{
+ width:60px;
+}
+
#progress{
display:none;
position:fixed;
diff --git a/ishtar_common/tasks.py b/ishtar_common/tasks.py
index a9db26087..a8db97bb1 100644
--- a/ishtar_common/tasks.py
+++ b/ishtar_common/tasks.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2013-2014 É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,15 @@
# See the file COPYING for details.
+import sys
+
from django.conf import settings
from django.db.models import Q
-from geodjangofla.models import Commune
-from ishtar_common.models import Town
+from ishtar_common.models import Town, Department
def load_towns():
+ from geodjangofla.models import Commune
q = None
for dpt_number in settings.ISHTAR_DPTS:
query = Q(insee_com__istartswith=dpt_number)
@@ -51,3 +53,30 @@ def load_towns():
setattr(town, k, defaults[k])
town.save()
return nb, updated
+
+def update_towns():
+ nb, updated = 0, 0
+ dpts = dict([(dpt.number, dpt) for dpt in Department.objects.all()])
+ q = Town.objects.filter(numero_insee__isnull=False)
+ total = q.count()
+ for idx, town in enumerate(q.all()):
+ sys.stdout.write('\rProcessing... %s/%d' % (
+ str(idx+1).zfill(len(str(total))), total))
+ if len(town.numero_insee) < 2:
+ continue
+ dpt_code = town.numero_insee[:2]
+ if dpt_code.startswith('9') and int(dpt_code) > 95:
+ dpt_code = town.numero_insee[:3]
+ if dpt_code not in dpts:
+ sys.stdout.write('Missing department with INSEE code: %s' % dpt_code)
+ continue
+ if town.departement == dpts[dpt_code]:
+ continue
+ if town.departement:
+ updated += 1
+ else:
+ nb += 1
+ town.departement = dpts[dpt_code]
+ town.save()
+ sys.stdout.write('\n')
+ return nb, updated
diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html
index 1ebebd815..92e61493b 100644
--- a/ishtar_common/templates/base.html
+++ b/ishtar_common/templates/base.html
@@ -19,6 +19,7 @@
<link type="text/css" href="{{JQUERY_UI_URL}}css/smoothness/jquery-ui.css" rel="stylesheet" />
<link rel="stylesheet" href="{{STATIC_URL}}/js/prettyPhoto/css/prettyPhoto.css" />
<link rel="stylesheet" href="{{STATIC_URL}}/media/style.css" />
+ {% include "blocks/extra_head.html" %}
{% block extra_head %}
{% endblock %}
</head>
diff --git a/ishtar_common/templates/blocks/JQueryAdvancedTown.html b/ishtar_common/templates/blocks/JQueryAdvancedTown.html
new file mode 100644
index 000000000..78d2d7831
--- /dev/null
+++ b/ishtar_common/templates/blocks/JQueryAdvancedTown.html
@@ -0,0 +1,99 @@
+{% load i18n %}{% load url from future %}</td></tr>
+<tr>
+ <td>{% trans "State" context "Région" %}</td>
+ <td>
+ <select id='current-state'>
+ <option value=''>--------</option>{% for state in states %}
+ <option value='{{state.number}}'{% if state.number == selected_state %}selected='selected'{% endif %}>{{state}}</option>
+ {% endfor %}</select>
+ </td>
+</tr>
+<tr>
+ <td>{% trans "Department" %}</td>
+ <td>
+ <select id='current-department'>
+ </select>
+ </td>
+</tr>
+<tr class='required'>
+ <th><label>{% trans "Town" %}</label></th>
+ <td><input{{attrs_select}}/>
+<input type="hidden"{{attrs_hidden}}/>
+<script type="text/javascript"><!--//
+ selected_department = "{{selected_department}}";
+ var empty_select = "<option value=''>--------</option>";
+
+ function update_department_field(){
+ var selected_state = $("#current-state").val();
+ if (!selected_state){
+ $("#current-department").html("<option value=''>"+"{% trans 'Choose a state first' %}"+"</option>");
+ $("#current-department").prop('disabled', true);
+ $('#id_select_{{field_id}}').prop('disabled', true);
+ return;
+ }
+ $.ajax({
+ url: "{% url 'department-by-state' %}" + selected_state,
+ type: 'get',
+ dataType: 'json',
+ success: function(data) {
+ var html = "";
+ for (idx in data){
+ dpt = data[idx];
+ html += "<option value='" + dpt.number + "'";
+ if (String(dpt.number) == String(selected_department)){
+ html += " selected='selected'";
+ }
+ html += ">" + dpt.value + "</option>";
+ }
+ $("#current-department").html(html);
+ $("#current-department").prop('disabled', false);
+ update_search_town();
+ }
+ });
+ }
+
+ function update_search_town(){
+ selected_department = $("#current-department").val();
+ if (selected_department){
+ $("#id_select_{{field_id}}").autocomplete( "option", "source", {{source}}+selected_department);
+ $('#id_select_{{field_id}}').prop('disabled', false);
+ } else {
+ $('#id_select_{{field_id}}').prop('disabled', true);
+ }
+ }
+
+ function empty_town(){
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+ }
+
+ $(function() {
+ update_department_field();
+
+ $("#current-state").change(function(){
+ empty_town();
+ update_department_field();
+ });
+
+ $("#current-department").change(function(){
+ empty_town();
+ update_search_town();
+ });
+
+ $("#id_select_{{field_id}}").autocomplete({
+ source: {{source}},
+ select: function( event, ui ) {
+ if(ui.item){
+ $('#id_{{field_id}}').val(ui.item.id);
+ } else {
+ $('#id_{{field_id}}').val(null);
+ }
+ },
+ minLength: 2{% if options %},
+ {{options}}
+ {% endif %}
+ });
+
+ $('#id_select_{{field_id}}').live('click', empty_town);
+
+});//--></script>
diff --git a/ishtar_common/templates/blocks/JQueryAdvancedTown.js b/ishtar_common/templates/blocks/JQueryAdvancedTown.js
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/ishtar_common/templates/blocks/JQueryAdvancedTown.js
@@ -0,0 +1 @@
+
diff --git a/ishtar_common/templates/blocks/JQueryPersonOrganization.js b/ishtar_common/templates/blocks/JQueryPersonOrganization.js
new file mode 100644
index 000000000..b13a2c28e
--- /dev/null
+++ b/ishtar_common/templates/blocks/JQueryPersonOrganization.js
@@ -0,0 +1,50 @@
+
+$("#id_select_{{field_id}}").autocomplete({
+ source: {{source}},
+ select: function( event, ui ) {
+ var url = {{edit_source}};
+ if(ui.item){
+ url = {{edit_source}}+ui.item.id;
+ $('#id_{{field_id}}').val(ui.item.id);
+ } else {
+ $('#id_{{field_id}}').val(null);
+ }
+ $.get(url , function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+ },
+ minLength: 2{% if options %},
+ {{options}}
+ {% endif %}
+});
+
+$.get( {{edit_source}}{% if selected %}+'{{selected}}'{% endif %}, function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+});
+
+$('#id_select_{{field_id}}').live('click', function(){
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+ $.get( {{edit_source}}, function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+});
+
+person_save_callback = function(item_id, lbl){
+ var url = {{edit_source}};
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(lbl);
+ if (item_id){
+ url = {{edit_source}}+item_id;
+ $('#id_{{field_id}}').val(item_id);
+ }
+ $("#id_select_{{field_id}}").trigger('autocompletechange');
+ $.get(url , function( data ) {
+ $( "#div-{{field_id}}" ).html( data );
+ });
+};
+person_new_callback = function(){
+ var url = {{edit_source}};
+ $('#id_{{field_id}}').val(null);
+ $('#id_select_{{field_id}}').val(null);
+}
diff --git a/ishtar_common/templates/blocks/PersonOrganization.html b/ishtar_common/templates/blocks/PersonOrganization.html
new file mode 100644
index 000000000..6e7264c8e
--- /dev/null
+++ b/ishtar_common/templates/blocks/PersonOrganization.html
@@ -0,0 +1,9 @@
+{% load i18n %}<input{{attrs_select}}/>
+</table>
+
+<div id='div-{{name}}'></div>
+
+<input type="hidden"{{attrs_hidden}}/>
+<script type="text/javascript"><!--//
+{{js}}
+//--></script>
diff --git a/ishtar_common/templates/blocks/extra_head.html b/ishtar_common/templates/blocks/extra_head.html
new file mode 100644
index 000000000..139597f9c
--- /dev/null
+++ b/ishtar_common/templates/blocks/extra_head.html
@@ -0,0 +1,2 @@
+
+
diff --git a/ishtar_common/templates/ishtar/organization_form.html b/ishtar_common/templates/ishtar/organization_form.html
new file mode 100644
index 000000000..207116c21
--- /dev/null
+++ b/ishtar_common/templates/ishtar/organization_form.html
@@ -0,0 +1,30 @@
+{% load i18n %}<table class='organization'>
+<tr>
+ <th><label>{{form.name.label}}</label></th>
+ <td>{{form.name}}</td>
+</tr>
+</table>
+{% for hidden in form.hidden_fields %}{{hidden}}{% endfor %}
+<table class='organization-address'>
+<tr>
+ <th><label>{{form.organization_type.label}}</label></th>
+ <td>{{form.organization_type}}</td>
+</tr>
+<tr>
+ <th><label>{{form.address.label}}</label></th>
+ <td>{{form.address}}</td>
+</tr>
+<tr>
+ <th><label>{{form.address_complement.label}}</label></th>
+ <td>{{form.address_complement}}</td>
+</tr>
+<tr>
+ <th><label>{{form.postal_code.label}}</label></th>
+ <td>{{form.postal_code}}</td>
+</tr>
+<tr>
+ <th><label>{{form.town.label}}</label></th>
+ <td>{{form.town}}</td>
+</tr>
+</table>
+
diff --git a/ishtar_common/templates/ishtar/organization_person_form.html b/ishtar_common/templates/ishtar/organization_person_form.html
new file mode 100644
index 000000000..46f2cdc15
--- /dev/null
+++ b/ishtar_common/templates/ishtar/organization_person_form.html
@@ -0,0 +1,131 @@
+{% load i18n %}{% load url from future %}
+<div id='orga-person-form'>
+<form id='dyn-form-person' method='post'>
+{% csrf_token %}
+{% for hidden_field in form.hidden_fields %}{{hidden_field}}{% endfor %}
+<input type='hidden' name='hidden_person_pk' id='hidden_person_pk' value='{{object.pk}}'/>
+<input type='hidden' name='hidden_person_lbl' id='hidden_person_lbl' value="{{object}}"/>
+<table class='organization'>
+<caption>{% trans "Identification" %}</caption>
+<tr>
+ <th>&nbsp;</th>
+ <td>{{form.attached_to}}</td>
+</tr>
+</table>
+
+<table class='person'>
+<caption>{{relative_label}}</caption>
+<tr>
+ <th><label>{{form.title.label}}</label></th>
+ <td>{{form.title}}</td>
+</tr>
+<tr>
+ <th><label>{{form.name.label}}</label></th>
+ <td>{{form.name}}</td>
+</tr>
+<tr>
+ <th><label>{{form.surname.label}}</label></th>
+ <td>{{form.surname}}</td>
+</tr>
+</table>
+<div>
+<input type='submit' id='btn-modify-person' value="{% trans "Modify"%}"/>
+<input type='submit' id='btn-new-person' value="{% trans "New"%}"/>
+<input type='submit' id='btn-save-person' value="{% trans "Save"%}"/>
+<input type='submit' id='btn-cancel-person' value="{% trans "Cancel"%}"/>
+</div>
+</form>
+</div>
+<script type="text/javascript"><!--//
+
+function checkPendingRequest(todo) {
+ window.setTimeout(function () {
+ if ($.active > 0) {
+ window.setTimeout(checkPendingRequest(todo), 250);
+ } else {
+ todo();
+ }
+ }, 250);
+};
+
+person_save_callback = function(){
+ var item_id = $('#hidden_person_pk').val();
+
+ var url = edit_url;
+ $('#id_' + parent_id).val(null);
+ if (item_id){
+ url = edit_url+item_id;
+ $('#id_'+parent_id).val(item_id);
+ }
+ $("#id_select_"+parent_id).trigger('autocompletechange');
+ $.get(url , function( data ) {
+ $( "#div-"+parent_id ).html( data );
+ var lbl = $('#hidden_person_lbl').val();
+ $('#id_select_' + parent_id).val(lbl);
+ });
+};
+
+person_new_callback = function(){
+ var url = edit_url;
+ $('#id_'+parent_id).val(null);
+ $('#id_select_'+parent_id).val(null);
+}
+$(function() {
+ disable_person = function(){
+ $("#orga-person-form :input[type='text'], #orga-person-form textarea, #orga-person-form select").prop("disabled", true);
+ $("#btn-save-person").hide();
+ $("#btn-cancel-person").hide();
+ $("#btn-modify-person").show();
+ $("#btn-new-person").show();
+ $("#orga-person-form").removeClass('selected');
+ }
+ enable_person = function(){
+ $("#orga-person-form :input[type='text'], #orga-person-form textarea, #orga-person-form select").prop("disabled", false);
+ $("#btn-save-person").show();
+ $("#btn-cancel-person").show();
+ $("#btn-modify-person").hide();
+ $("#btn-new-person").hide();
+ $("#orga-person-form").addClass('selected');
+ }
+
+ checkPendingRequest(disable_person);
+
+ $("#btn-modify-person").on('click', function(){
+ {% if object %}submit_url = "{% url 'organization_person_edit' object.pk %}";
+ {% else %}submit_url = "{% url 'organization_person_create' %}";{% endif %}
+ enable_person();
+ return false;
+ });
+ $("#btn-new-person").on('click', function(){
+ submit_url = "{% url 'organization_person_create' %}";
+ $("#orga-person-form").find("input[type=text], textarea, input[type=hidden]").val("");
+ enable_person();
+ person_new_callback();
+ return false;
+ });
+ $("#btn-cancel-person").on('click', function(){
+ person_save_callback();
+ disable_person();
+ return false;
+ });
+ $("#btn-save-person").on('click', function(){
+ var form = $("#dyn-form-person");
+ $.ajax({
+ url: submit_url,
+ type: 'post',
+ data: form.serialize(),
+ dataType: 'html',
+ success: function(data) {
+ $("#orga-person-form").parent().html(data);
+ person_save_callback();
+ disable_person();
+ return false;
+ }
+ });
+ return false;
+ });
+
+
+});
+//--></script>
+
diff --git a/ishtar_common/templates/ishtar/person_form.html b/ishtar_common/templates/ishtar/person_form.html
new file mode 100644
index 000000000..555aa1a5f
--- /dev/null
+++ b/ishtar_common/templates/ishtar/person_form.html
@@ -0,0 +1,113 @@
+{% load i18n %}{% load url from future %}
+<div id='person-form'>
+<form id='dyn-form-person' method='post'>
+{% csrf_token %}
+{% for hidden_field in form.hidden_fields %}{{hidden_field}}{% endfor %}
+<input type='hidden' name='hidden_person_pk' id='hidden_person_pk' value='{{object.pk}}'/>
+<input type='hidden' name='hidden_person_lbl' id='hidden_person_lbl' value="{{object}}"/>
+<table class='person'>
+<caption>{% trans "Identification" %}</caption>
+<tr>
+ <th><label>{{form.title.label}}</label></th>
+ <td>{{form.title}}</td>
+</tr>
+<tr>
+ <th><label>{{form.name.label}}</label></th>
+ <td>{{form.name}}</td>
+</tr>
+<tr>
+ <th><label>{{form.surname.label}}</label></th>
+ <td>{{form.surname}}</td>
+</tr>
+</table>
+<table class='person-address'>
+<caption>{% trans "Contact informations" %}</caption>
+<tr>
+ <th><label>{{form.address.label}}</label></th>
+ <td>{{form.address}}</td>
+</tr>
+<tr>
+ <th><label>{{form.address_complement.label}}</label></th>
+ <td>{{form.address_complement}}</td>
+</tr>
+<tr>
+ <th><label>{{form.postal_code.label}}</label></th>
+ <td>{{form.postal_code}}</td>
+</tr>
+<tr>
+ <th><label>{{form.town.label}}</label></th>
+ <td>{{form.town}}</td>
+</tr>
+</table>
+<div>
+<input type='submit' id='btn-modify-person' value="{% trans "Modify"%}"/>
+<input type='submit' id='btn-new-person' value="{% trans "New"%}"/>
+<input type='submit' id='btn-save-person' value="{% trans "Save"%}"/>
+<input type='submit' id='btn-cancel-person' value="{% trans "Cancel"%}"/>
+</div>
+</form>
+</div>
+<script type="text/javascript"><!--//
+$(function() {
+ // person_save_callback and person_new_callback must have been defined
+ disable_person = function(){
+ $("#person-form :input[type='text'], #person-form textarea, #person-form select").prop("disabled", true);
+ $("#btn-save-person").hide();
+ $("#btn-cancel-person").hide();
+ $("#btn-modify-person").show();
+ $("#btn-new-person").show();
+ $("#person-form").removeClass('selected');
+ }
+
+ enable_person = function(){
+ $("#person-form :input[type='text'], #person-form textarea, #person-form select").prop("disabled", false);
+ $("#btn-save-person").show();
+ $("#btn-cancel-person").show();
+ $("#btn-modify-person").hide();
+ $("#btn-new-person").hide();
+ $("#person-form").addClass('selected');
+ }
+
+ disable_person();
+
+ var submit_url;
+ $("#btn-modify-person").on('click', function(){
+ {% if object %}submit_url = "{% url 'person_edit' object.pk %}";
+ {% else %}submit_url = "{% url 'person_create' %}";{% endif %}
+ enable_person();
+ return false;
+ });
+ $("#btn-new-person").on('click', function(){
+ submit_url = "{% url 'person_create' %}";
+ $("#person-form").find("input[type=text], textarea").val("");
+ enable_person();
+ person_new_callback();
+ return false;
+ });
+ $("#btn-cancel-person").on('click', function(){
+ person_save_callback($('#hidden_person_pk').val(),
+ $('#hidden_person_lbl').val());
+ disable_person();
+ return false;
+ });
+ $("#btn-save-person").on('click', function(){
+ var form = $("#dyn-form-person");
+ $.ajax({
+ url: submit_url,
+ type: 'post',
+ data: form.serialize(),
+ dataType: 'html',
+ success: function(data) {
+ $("#person-form").parent().html(data);
+ person_save_callback($('#hidden_person_pk').val(),
+ $('#hidden_person_lbl').val());
+ disable_person();
+ return false;
+ }
+ });
+ return false;
+ });
+
+
+});
+//--></script>
diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html
index 0dd1f6f12..15bb9e9bd 100644
--- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html
@@ -36,8 +36,10 @@
</table>
{% endif %}
{% block "extra_informations" %}{% endblock %}
+<div id='validation-bar' class='big'>
<p>{%if confirm_end_msg %}{{confirm_end_msg|safe}}{%else%}{% trans "Would you like to save them?" %}{%endif%}</p>
<input type="submit" value="{% trans "Validate" %}"/>
</div>
+</div>
</form>
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/wizard/default_wizard.html b/ishtar_common/templates/ishtar/wizard/default_wizard.html
index 3f2f3943e..a39037d10 100644
--- a/ishtar_common/templates/ishtar/wizard/default_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/default_wizard.html
@@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load i18n range table_form %}
+{% load url from future %}
{% block extra_head %}
{{form.media}}
{% endblock %}
@@ -40,10 +41,9 @@
{% endif %}
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
-<div id='validation-bar'>
- <input type="submit" id="submit_form" name='validate' value="{% trans "Validate" %}"/>
- {% if next_steps %}<input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans "Validate and end" %}"/>{% endif %}
-</div>
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
</div>
</form>
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
index b550cf6c4..ce2bc9780 100644
--- a/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/parcels_wizard.html
@@ -9,7 +9,6 @@
{{ wizard.form.media }}
{{ wizard.management_form }}
{{ wizard.form.management_form }}
-<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div>
{%if wizard.form.non_form_errors%}
<table class='formset'>
<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>
@@ -24,8 +23,9 @@
<p><button name="formset_modify" value="{{wizard.steps.current}}">{% trans "Add/Modify" %}</button></p>
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
-<input type="submit" id="submit_form" name='validate' value="{% trans "Validate" %}"/>
-{% if next_steps %}<input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans "Validate and end" %}"/>{% endif %}
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
</div>
</form>
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/wizard/towns_wizard.html b/ishtar_common/templates/ishtar/wizard/towns_wizard.html
index 8e0b3551f..4f9ff6c5f 100644
--- a/ishtar_common/templates/ishtar/wizard/towns_wizard.html
+++ b/ishtar_common/templates/ishtar/wizard/towns_wizard.html
@@ -9,7 +9,6 @@
<div class='form'>
{% if TOWNS %}
{% if wizard.form.forms %}
-<div class='top_button'><input type="submit" id="submit_form" value="{% trans "Validate" %}"/></div>
<table class='formset'>
{{ wizard.management_form }}
{%if wizard.form.non_form_errors%}<tr class='error'><th colspan='2'>{{wizard.form.non_form_errors}}</th></tr>{%endif%}
@@ -29,7 +28,9 @@
{% endif %}
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" />
{{ previous_fields|safe }}
-<input type="submit" id="submit_form" value="{% trans "Validate" %}"/>
+{% block "validation_bar" %}
+{% include 'ishtar/wizard/validation_bar.html' %}
+{% endblock %}
</div>
</form>
{% endblock %}
diff --git a/ishtar_common/templates/ishtar/wizard/validation_bar.html b/ishtar_common/templates/ishtar/wizard/validation_bar.html
new file mode 100644
index 000000000..09907af67
--- /dev/null
+++ b/ishtar_common/templates/ishtar/wizard/validation_bar.html
@@ -0,0 +1,7 @@
+{% load i18n %}
+{% load url from future %}
+<div id='validation-bar'>
+ <input type="submit" id="submit_form" name='validate' value="{% trans "Validate" %}"/>
+ {% if next_steps %}<input type="submit" id="submit_end_form" name='validate_and_end' value="{% trans "Validate and end" %}"/>{% endif %}
+ <a href='{% url 'reset_wizards' %}' id="reset_wizards" class='button'>{% trans "Cancel" %}</a>
+</div>
diff --git a/ishtar_common/urls.py b/ishtar_common/urls.py
index 97fe4f81a..13c19096e 100644
--- a/ishtar_common/urls.py
+++ b/ishtar_common/urls.py
@@ -33,12 +33,20 @@ urlpatterns = patterns('',
# internationalization
url(r'^i18n/', include('django.conf.urls.i18n')),
# General
+ url(r'person_search/(?P<step>.+)?$',
+ views.person_search_wizard, name='person_search'),
url(r'person_creation/(?P<step>.+)?$',
views.person_creation_wizard, name='person_creation'),
url(r'person_modification/(?P<step>.+)?$',
views.person_modification_wizard, name='person_modification'),
url(r'person_deletion/(?P<step>.+)?$',
views.person_deletion_wizard, name='person_deletion'),
+ url(r'^person-edit/$',
+ views.PersonCreate.as_view(), name='person_create'),
+ url(r'^person-edit/(?P<pk>\d+)$',
+ views.PersonEdit.as_view(), name='person_edit'),
+ url(r'organization_search/(?P<step>.+)?$',
+ views.organization_search_wizard, name='organization_search'),
url(r'organization_creation/(?P<step>.+)?$',
views.organization_creation_wizard, name='organization_creation'),
url(r'organization_modification/(?P<step>.+)?$',
@@ -46,6 +54,16 @@ urlpatterns = patterns('',
name='organization_modification'),
url(r'organization_deletion/(?P<step>.+)?$',
views.organization_deletion_wizard, name='organization_deletion'),
+ url(r'organization-edit/$',
+ views.OrganizationCreate.as_view(), name='organization_create'),
+ url(r'organization-edit/(?P<pk>\d+)$',
+ views.OrganizationEdit.as_view(), name='organization_edit'),
+ url(r'organization-person-edit/$',
+ views.OrganizationPersonCreate.as_view(),
+ name='organization_person_create'),
+ url(r'organization-person-edit/(?P<pk>\d+)$',
+ views.OrganizationPersonEdit.as_view(),
+ name='organization_person_edit'),
url(r'account_management/(?P<step>.+)?$',
views.account_management_wizard, name='account_management'),
url(r'import/$', views.NewImportView.as_view(), name='new_import'),
@@ -84,8 +102,12 @@ urlpatterns += patterns('ishtar_common.views',
name='get-person'),
url(r'show-person(?:/(?P<pk>.+))?/(?P<type>.+)?$',
'show_person', name='show-person'),
+ url(r'department-by-state/(?P<state_id>.+)?$', 'department_by_state',
+ name='department-by-state'),
url(r'autocomplete-town/?$', 'autocomplete_town',
name='autocomplete-town'),
+ url(r'autocomplete-advanced-town/(?P<department_id>[0-9]+[ABab]?)?$',
+ 'autocomplete_advanced_town', name='autocomplete-advanced-town'),
url(r'autocomplete-department/?$', 'autocomplete_department',
name='autocomplete-department'),
url(r'new-author/(?:(?P<parent_name>[^/]+)/)?(?:(?P<limits>[^/]+)/)?$',
@@ -105,6 +127,7 @@ urlpatterns += patterns('ishtar_common.views',
url(r'person_merge/(?:(?P<page>\d+)/)?$', 'person_merge', name='person_merge'),
url(r'organization_merge/(?:(?P<page>\d+)/)?$', 'organization_merge',
name='organization_merge'),
+ url(r'reset/$', 'reset_wizards', name='reset_wizards'),
url(r'(?P<action_slug>' + actions + r')/$', 'action', name='action'),
)
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 1b27bcf43..519332222 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -44,7 +44,7 @@ from django.shortcuts import render_to_response, redirect
from django.template import RequestContext, loader
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext, ugettext_lazy as _
-from django.views.generic import ListView
+from django.views.generic import ListView, UpdateView, CreateView
from django.views.generic.edit import CreateView, DeleteView
from xhtml2odt import xhtml2odt
@@ -75,6 +75,11 @@ def index(request):
return render_to_response('index.html', dct,
context_instance=RequestContext(request))
+person_search_wizard = wizards.SearchWizard.as_view([
+ ('general-person_search', forms.PersonFormSelection)],
+ label=_(u"Person search"),
+ url_name='person_search',)
+
person_creation_wizard = wizards.PersonWizard.as_view([
('identity-person_creation', forms.SimplePersonForm),
('person_type-person_creation', forms.PersonTypeForm),
@@ -96,6 +101,11 @@ person_deletion_wizard = wizards.PersonDeletionWizard.as_view([
label=_(u"Person deletion"),
url_name='person_deletion',)
+organization_search_wizard = wizards.SearchWizard.as_view([
+ ('general-organization_search', forms.OrganizationFormSelection)],
+ label=_(u"Organization search"),
+ url_name='organization_search',)
+
organization_creation_wizard = wizards.OrganizationWizard.as_view([
('identity-organization_creation', forms.OrganizationForm),
('final-organization_creation', FinalForm)],
@@ -202,6 +212,45 @@ def autocomplete_town(request):
for town in towns])
return HttpResponse(data, mimetype='text/plain')
+def autocomplete_advanced_town(request, department_id=None, state_id=None):
+ if not request.GET.get('term'):
+ return HttpResponse(mimetype='text/plain')
+ q = request.GET.get('term')
+ q = unicodedata.normalize("NFKD", q).encode('ascii','ignore')
+ query = Q()
+ for q in q.split(' '):
+ extra = Q(name__icontains=q)
+ if settings.COUNTRY == 'fr':
+ extra = extra | Q(numero_insee__istartswith=q)
+ if not department_id:
+ extra = extra | Q(departement__label__istartswith=q)
+ query = query & extra
+ if department_id:
+ query = query & Q(departement__number__iexact=department_id)
+ if state_id:
+ query = query & Q(departement__state__number__iexact=state_id)
+ limit = 20
+ towns = models.Town.objects.filter(query)[:limit]
+ result = []
+ for town in towns:
+ val = town.name
+ if hasattr(town, 'numero_insee'):
+ val += " (%s)" % town.numero_insee
+ result.append({'id':town.pk, 'value':val})
+ data = json.dumps(result)
+ return HttpResponse(data, mimetype='text/plain')
+
+def department_by_state(request, state_id=''):
+ if not state_id:
+ data = []
+ else:
+ departments = models.Department.objects.filter(state__number=state_id)
+ data = json.dumps([{'id':department.pk, 'number':department.number,
+ 'value':unicode(department)}
+ for department in departments])
+ return HttpResponse(data, mimetype='text/plain')
+
+
from types import NoneType
def format_val(val):
@@ -480,7 +529,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[],
return func
-def show_item(model, name):
+def show_item(model, name, extra_dct=None):
def func(request, pk, **dct):
try:
item = model.objects.get(pk=pk)
@@ -511,6 +560,9 @@ def show_item(model, name):
if len(historized) > 1:
dct['previous'] = historized[1].history_date
dct['item'], dct['item_name'] = item, name
+ # add context
+ if extra_dct:
+ dct.update(extra_dct(request, item))
context_instance = RequestContext(request)
context_instance.update(dct)
n = datetime.datetime.now()
@@ -790,6 +842,20 @@ def dashboard_main_detail(request, item_name):
return render_to_response('ishtar/dashboards/dashboard_main_detail.html',
dct, context_instance=RequestContext(request))
+def reset_wizards(request):
+ # dynamicaly execute each reset_wizards of each ishtar app
+ for app in settings.INSTALLED_APPS:
+ if app == 'ishtar_common':
+ # no need for infinite recursion
+ continue
+ try:
+ module = __import__(app)
+ except ImportError:
+ continue
+ if hasattr(module, 'views') and hasattr(module.views, 'reset_wizards'):
+ module.views.reset_wizards(request)
+ return redirect(reverse('start'))
+
ITEM_PER_PAGE = 20
def merge_action(model, form, key):
def merge(request, page=1):
@@ -943,3 +1009,72 @@ class ImportDeleteView(IshtarMixin, LoginRequiredMixin, DeleteView):
def get_success_url(self):
return reverse('current_imports')
+
+class PersonCreate(LoginRequiredMixin, CreateView):
+ model = models.Person
+ form_class = forms.BasePersonForm
+ template_name = 'ishtar/person_form.html'
+
+ def get_success_url(self):
+ return reverse('person_edit', args=[self.object.pk])
+
+class PersonEdit(LoginRequiredMixin, UpdateView):
+ model = models.Person
+ form_class = forms.BasePersonForm
+ template_name = 'ishtar/person_form.html'
+
+ def get_success_url(self):
+ return reverse('person_edit', args=[self.object.pk])
+
+class OrganizationCreate(LoginRequiredMixin, CreateView):
+ model = models.Organization
+ form_class = forms.BaseOrganizationForm
+ template_name = 'ishtar/organization_form.html'
+ form_prefix = "orga"
+
+ def get_form_kwargs(self):
+ kwargs = super(OrganizationCreate, self).get_form_kwargs()
+ if hasattr(self.form_class, 'form_prefix'):
+ kwargs.update({'prefix': self.form_class.form_prefix})
+ return kwargs
+
+class OrganizationEdit(LoginRequiredMixin, UpdateView):
+ model = models.Organization
+ form_class = forms.BaseOrganizationForm
+ template_name = 'ishtar/organization_form.html'
+
+ def get_form_kwargs(self):
+ kwargs = super(OrganizationEdit, self).get_form_kwargs()
+ if hasattr(self.form_class, 'form_prefix'):
+ kwargs.update({'prefix': self.form_class.form_prefix})
+ return kwargs
+
+class OrganizationPersonCreate(LoginRequiredMixin, CreateView):
+ model = models.Person
+ form_class = forms.BaseOrganizationPersonForm
+ template_name = 'ishtar/organization_person_form.html'
+ relative_label = _("Corporation manager")
+
+ def get_context_data(self, *args, **kwargs):
+ data = super(OrganizationPersonCreate, self).get_context_data(*args,
+ **kwargs)
+ data['relative_label'] = self.relative_label
+ return data
+
+ def get_success_url(self):
+ return reverse('organization_person_edit', args=[self.object.pk])
+
+class OrganizationPersonEdit(LoginRequiredMixin, UpdateView):
+ model = models.Person
+ form_class = forms.BaseOrganizationPersonForm
+ template_name = 'ishtar/organization_person_form.html'
+ relative_label = _("Corporation manager")
+
+ def get_context_data(self, *args, **kwargs):
+ data = super(OrganizationPersonEdit, self).get_context_data(*args,
+ **kwargs)
+ data['relative_label'] = self.relative_label
+ return data
+
+ def get_success_url(self):
+ return reverse('organization_person_edit', args=[self.object.pk])
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 0ba4061a8..ba7e61e46 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -26,6 +26,7 @@ from django.db.models import fields
from django.forms import ClearableFileInput
from django.forms.widgets import flatatt
from django.template import Context, loader
+from django.template.defaultfilters import slugify
from django.utils.encoding import smart_unicode
from django.utils.functional import lazy
from django.utils.html import escape
@@ -33,7 +34,7 @@ from django.utils.safestring import mark_safe
from django.utils.simplejson import JSONEncoder
from django.utils.translation import ugettext_lazy as _
-import models
+from ishtar_common import models
reverse_lazy = lazy(reverse, unicode)
@@ -203,7 +204,7 @@ class JQueryAutoComplete(forms.TextInput):
except:
raise ValueError('source type is not valid')
dct = {'source':mark_safe(source),
- 'field_id':field_id}
+ 'field_id':field_id,}
if self.options:
dct['options'] = mark_safe('%s' % self.options)
@@ -218,6 +219,7 @@ class JQueryAutoComplete(forms.TextInput):
def render(self, name, value=None, attrs=None):
attrs_hidden = self.build_attrs(attrs, name=name)
attrs_select = self.build_attrs(attrs)
+ attrs_select['placeholder'] = _(u"Search...")
if value:
hiddens = []
selects = []
@@ -281,6 +283,204 @@ class JQueryAutoComplete(forms.TextInput):
}
return html
+class JQueryTown(forms.TextInput):
+ """
+ Town fields whith state and department pre-selections
+ """
+
+ def __init__(self, source, options={},
+ attrs={}, new=False, limit={}):
+ self.options = None
+ self.attrs = {}
+ self.source = source
+ if len(options) > 0:
+ self.options = JSONEncoder().encode(options)
+ self.attrs.update(attrs)
+ self.new = new
+ self.limit = limit
+
+ @classmethod
+ def encode_source(cls, source):
+ encoded_src = ''
+ if isinstance(source, list):
+ encoded_src = JSONEncoder().encode(source)
+ elif isinstance(source, str) \
+ or isinstance(source, unicode):
+ src = escape(source)
+ if not src.endswith('/'):
+ src += "/"
+ encoded_src = "'%s'" % src
+ else:
+ try:
+ src = unicode(source)
+ if not src.endswith('/'):
+ src += "/"
+ encoded_src = "'%s'" % src
+ except:
+ raise ValueError('source type is not valid')
+ return encoded_src
+
+ def render(self, name, value=None, attrs=None):
+ attrs_hidden = self.build_attrs(attrs, name=name)
+ attrs_select = self.build_attrs(attrs)
+ attrs_select['placeholder'] = _(u"Search...")
+ selected = ''
+ selected_state = ''
+ selected_department = ''
+ if value:
+ hiddens = []
+ selects = []
+ if type(value) not in (list, tuple):
+ values = unicode(escape(smart_unicode(value)))
+ values = values.replace('[', '').replace(']', '')
+ values = values.split(',')
+ else:
+ values = []
+ for v in value:
+ values += v.split(',')
+ for v in values:
+ if not v:
+ continue
+ hiddens.append(v)
+ selects.append(v)
+ try:
+ item = models.Town.objects.get(pk=v)
+ selects[-1] = unicode(item)
+ if item.departement:
+ selected_department = item.departement.number
+ if item.departement.state:
+ selected_state = item.departement.state.number
+ selected = item.pk
+ except (models.Town.DoesNotExist, ValueError):
+ selects.pop()
+ hiddens.pop()
+ if hiddens and selects:
+ attrs_hidden['value'] = hiddens[0]
+ attrs_select['value'] = selects[0]
+ if not self.attrs.has_key('id'):
+ attrs_hidden['id'] = 'id_%s' % name
+ attrs_select['id'] = 'id_select_%s' % name
+ if 'class' not in attrs_select:
+ attrs_select['class'] = 'autocomplete'
+
+ source = self.encode_source(self.source)
+ dct = {'source':mark_safe(source),
+ 'selected':selected,
+ 'safe_field_id':slugify(name).replace('-', '_'),
+ 'field_id':name}
+ if self.options:
+ dct['options'] = mark_safe('%s' % self.options)
+
+ dct.update({'attrs_select':mark_safe(flatatt(attrs_select)),
+ 'attrs_hidden':mark_safe(flatatt(attrs_hidden)),
+ 'name':name,
+ 'states':models.State.objects.all().order_by('label'),
+ 'selected_department':selected_department,
+ 'selected_state':selected_state
+ })
+ html = loader.get_template('blocks/JQueryAdvancedTown.html').render(
+ Context(dct))
+ return html
+
+class JQueryPersonOrganization(forms.TextInput):
+ """
+ Complex widget which manage:
+ * link between person and organization
+ * display addresses of the person and of the organization
+ * create new person and new organization
+ """
+
+ def __init__(self, source, edit_source, model, options={},
+ attrs={}, new=False, limit={},
+ html_template = 'blocks/PersonOrganization.html',
+ js_template='blocks/JQueryPersonOrganization.js'):
+ self.options = None
+ self.attrs = {}
+ self.model = model
+ self.source = source
+ self.edit_source = edit_source
+ if len(options) > 0:
+ self.options = JSONEncoder().encode(options)
+ self.attrs.update(attrs)
+ self.new = new
+ self.limit = limit
+ self.js_template = js_template
+ self.html_template = html_template
+
+ @classmethod
+ def encode_source(cls, source):
+ encoded_src = ''
+ if isinstance(source, list):
+ encoded_src = JSONEncoder().encode(source)
+ elif isinstance(source, str) \
+ or isinstance(source, unicode):
+ encoded_src = "'%s'" % escape(source)
+ else:
+ try:
+ encoded_src = "'" + unicode(source) + "'"
+ except:
+ raise ValueError('source type is not valid')
+ return encoded_src
+
+ def render_js(self, field_id, selected=''):
+ source = self.encode_source(self.source)
+ edit_source = self.encode_source(self.edit_source)
+ dct = {'source':mark_safe(source),
+ 'edit_source':mark_safe(edit_source),
+ 'selected':selected,
+ 'safe_field_id':slugify(field_id).replace('-', '_'),
+ 'field_id':field_id}
+ if self.options:
+ dct['options'] = mark_safe('%s' % self.options)
+ js = loader.get_template(self.js_template).render(Context(dct))
+ return js
+
+ def render(self, name, value=None, attrs=None):
+ attrs_hidden = self.build_attrs(attrs, name=name)
+ attrs_select = self.build_attrs(attrs)
+ attrs_select['placeholder'] = _(u"Search...")
+ selected = ''
+ if value:
+ hiddens = []
+ selects = []
+ if type(value) not in (list, tuple):
+ values = unicode(escape(smart_unicode(value)))
+ values = values.replace('[', '').replace(']', '')
+ values = values.split(',')
+ else:
+ values = []
+ for v in value:
+ values += v.split(',')
+ for v in values:
+ if not v:
+ continue
+ hiddens.append(v)
+ selects.append(v)
+ if self.model:
+ try:
+ item = self.model.objects.get(pk=v)
+ selects[-1] = unicode(item)
+ selected = item.pk
+ except (self.model.DoesNotExist, ValueError):
+ selects.pop()
+ hiddens.pop()
+ if hiddens and selects:
+ attrs_hidden['value'] = hiddens[0]
+ attrs_select['value'] = selects[0]
+ if not self.attrs.has_key('id'):
+ attrs_hidden['id'] = 'id_%s' % name
+ attrs_select['id'] = 'id_select_%s' % name
+ if 'class' not in attrs_select:
+ attrs_select['class'] = 'autocomplete'
+ new = ''
+ dct = {'attrs_select':mark_safe(flatatt(attrs_select)),
+ 'attrs_hidden':mark_safe(flatatt(attrs_hidden)),
+ 'name':name,
+ 'js':self.render_js(name, selected),
+ 'new':mark_safe(new)}
+ html = loader.get_template(self.html_template).render(Context(dct))
+ return html
+
class JQueryJqGrid(forms.RadioSelect):
COL_TPL = "{name:'%(idx)s', index:'%(idx)s', sortable:true}"
class Media:
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 190a7fc86..1e515d13e 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -95,8 +95,11 @@ class Wizard(NamedUrlWizardView):
def get_template_names(self):
templates = ['ishtar/wizard/default_wizard.html']
current_step = self.steps.current
- if current_step in self.wizard_templates:
- templates = [self.wizard_templates[current_step]] + templates
+ wizard_templates = dict([
+ (key % {'url_name':self.url_name}, self.wizard_templates[key])
+ for key in self.wizard_templates])
+ if current_step in wizard_templates:
+ templates = [wizard_templates[current_step]] + templates
elif current_step == self.steps.last:
templates = ['ishtar/wizard/confirm_wizard.html'] + templates
return templates
@@ -617,6 +620,13 @@ class Wizard(NamedUrlWizardView):
return key in request.session[storage.prefix]['step_data'][form_key]
@classmethod
+ def session_reset(cls, request, url_name):
+ prefix = url_name + normalize_name(cls.__name__)
+ storage = get_storage(cls.storage_name, prefix, request,
+ getattr(cls, 'file_storage', None))
+ storage.reset()
+
+ @classmethod
def session_set_value(cls, request, form_key, key, value, reset=False):
prefix = form_key.split('-')[1] + normalize_name(cls.__name__)
storage = get_storage(cls.storage_name, prefix, request,
diff --git a/ishtar_pdl/__init__.py b/ishtar_pdl/__init__.py
new file mode 100644
index 000000000..8d1c8b69c
--- /dev/null
+++ b/ishtar_pdl/__init__.py
@@ -0,0 +1 @@
+
diff --git a/ishtar_pdl/models.py b/ishtar_pdl/models.py
new file mode 100644
index 000000000..8d1c8b69c
--- /dev/null
+++ b/ishtar_pdl/models.py
@@ -0,0 +1 @@
+
diff --git a/ishtar_pdl/static/pdl/JQueryCorporation.js b/ishtar_pdl/static/pdl/JQueryCorporation.js
new file mode 100644
index 000000000..e65001506
--- /dev/null
+++ b/ishtar_pdl/static/pdl/JQueryCorporation.js
@@ -0,0 +1,14 @@
+var current_status = 'corporation';
+
+$(function() {
+ var $radios = $('input:radio[name=person_type]');
+ if($radios.is(':checked') === false) {
+ $radios.filter('[value='+ current_status +']').prop('checked', true);
+ }
+
+ $radios.change(function(){
+ var loc = window.location;
+ window.location = loc.protocol + '//' + loc.host + loc.pathname + "?status=" + $('input:radio[name=person_type]:checked').val();
+ });
+ $("#corporation_div").show();
+});
diff --git a/ishtar_pdl/static/pdl/styles.css b/ishtar_pdl/static/pdl/styles.css
new file mode 100644
index 000000000..f7a73f8eb
--- /dev/null
+++ b/ishtar_pdl/static/pdl/styles.css
@@ -0,0 +1,14 @@
+div#validation-bar{
+ position: fixed;
+ bottom: 0px;
+ background-color: #CCC;
+ width: 100%;
+ left: 0px;
+ height: 40px;
+ padding: 5px;
+}
+
+#reset_wizards{
+ right:50px;
+ position:absolute;
+}
diff --git a/ishtar_pdl/templates/blocks/extra_head.html b/ishtar_pdl/templates/blocks/extra_head.html
new file mode 100644
index 000000000..5a75d0728
--- /dev/null
+++ b/ishtar_pdl/templates/blocks/extra_head.html
@@ -0,0 +1 @@
+ <link rel="stylesheet" href="{{STATIC_URL}}/pdl/styles.css" />