summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-10-19 22:10:20 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-10-19 22:10:20 +0200
commit029d08540f66524c371ae87ede5c1281fbe2c568 (patch)
tree3fa5ef50970a84f5499b6a2ad8629ab3623ef2b5 /archaeological_context_records
parentc3a22e06e4a1d50e90854194e786effc7d49f3e6 (diff)
downloadIshtar-029d08540f66524c371ae87ede5c1281fbe2c568.tar.bz2
Ishtar-029d08540f66524c371ae87ede5c1281fbe2c568.zip
Djangoization - Major refactoring (step 2) models reorganization in django apps
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/__init__.py0
-rw-r--r--archaeological_context_records/migrations/0001_initial.py629
-rw-r--r--archaeological_context_records/migrations/__init__.py0
-rw-r--r--archaeological_context_records/models.py243
4 files changed, 872 insertions, 0 deletions
diff --git a/archaeological_context_records/__init__.py b/archaeological_context_records/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/archaeological_context_records/__init__.py
diff --git a/archaeological_context_records/migrations/0001_initial.py b/archaeological_context_records/migrations/0001_initial.py
new file mode 100644
index 000000000..09ee30efe
--- /dev/null
+++ b/archaeological_context_records/migrations/0001_initial.py
@@ -0,0 +1,629 @@
+# -*- 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 'Parcel'
+ db.create_table('archaeological_context_records_parcel', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])),
+ ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
+ ('associated_file', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='parcels', null=True, to=orm['archaeological_files.File'])),
+ ('operation', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='parcels', null=True, to=orm['archaeological_operations.Operation'])),
+ ('year', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('town', self.gf('django.db.models.fields.related.ForeignKey')(related_name='parcels', to=orm['ishtar_common.Town'])),
+ ('section', self.gf('django.db.models.fields.CharField')(max_length=4)),
+ ('parcel_number', self.gf('django.db.models.fields.CharField')(max_length=6)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['Parcel'])
+
+ # Adding model 'ParcelOwner'
+ db.create_table('archaeological_context_records_parcelowner', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])),
+ ('history_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now)),
+ ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.Person'])),
+ ('parcel', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.Parcel'])),
+ ('start_date', self.gf('django.db.models.fields.DateField')()),
+ ('end_date', self.gf('django.db.models.fields.DateField')()),
+ ))
+ db.send_create_signal('archaeological_context_records', ['ParcelOwner'])
+
+ # Adding model 'DatingType'
+ db.create_table('archaeological_context_records_datingtype', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
+ ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('available', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['DatingType'])
+
+ # Adding model 'DatingQuality'
+ db.create_table('archaeological_context_records_datingquality', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
+ ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('available', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['DatingQuality'])
+
+ # Adding model 'Dating'
+ db.create_table('archaeological_context_records_dating', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('period', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_operations.Period'])),
+ ('start_date', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('end_date', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('dating_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.DatingType'], null=True, blank=True)),
+ ('quality', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.DatingQuality'], null=True, blank=True)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['Dating'])
+
+ # Adding model 'Unit'
+ db.create_table('archaeological_context_records_unit', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
+ ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('available', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('order', self.gf('django.db.models.fields.IntegerField')()),
+ ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.Unit'], null=True, blank=True)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['Unit'])
+
+ # Adding model 'ActivityType'
+ db.create_table('archaeological_context_records_activitytype', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
+ ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('available', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('order', self.gf('django.db.models.fields.IntegerField')()),
+ ))
+ db.send_create_signal('archaeological_context_records', ['ActivityType'])
+
+ # Adding model 'IdentificationType'
+ db.create_table('archaeological_context_records_identificationtype', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=100)),
+ ('txt_idx', self.gf('django.db.models.fields.CharField')(unique=True, max_length=30)),
+ ('comment', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('available', self.gf('django.db.models.fields.BooleanField')(default=False)),
+ ('order', self.gf('django.db.models.fields.IntegerField')()),
+ ))
+ db.send_create_signal('archaeological_context_records', ['IdentificationType'])
+
+ # Adding model 'HistoricalContextRecord'
+ db.create_table('archaeological_context_records_historicalcontextrecord', (
+ ('id', self.gf('django.db.models.fields.IntegerField')(db_index=True, blank=True)),
+ ('history_modifier_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)),
+ ('parcel_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)),
+ ('operation_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=200)),
+ ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('thickness', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('depth', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('location', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)),
+ ('unit_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)),
+ ('has_furniture', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)),
+ ('filling', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('interpretation', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('taq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('taq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('tpq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('tpq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('identification_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)),
+ ('activity_id', self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True)),
+ ('history_id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('history_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
+ ('history_user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)),
+ ('history_type', self.gf('django.db.models.fields.CharField')(max_length=1)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['HistoricalContextRecord'])
+
+ # Adding model 'ContextRecord'
+ db.create_table('archaeological_context_records_contextrecord', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('history_modifier', self.gf('django.db.models.fields.related.ForeignKey')(related_name='+', to=orm['auth.User'])),
+ ('parcel', self.gf('django.db.models.fields.related.ForeignKey')(related_name='context_record', to=orm['archaeological_context_records.Parcel'])),
+ ('operation', self.gf('django.db.models.fields.related.ForeignKey')(related_name='context_record', to=orm['archaeological_operations.Operation'])),
+ ('label', self.gf('django.db.models.fields.CharField')(max_length=200)),
+ ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('length', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('width', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('thickness', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('depth', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('location', self.gf('django.db.models.fields.CharField')(max_length=200, null=True, blank=True)),
+ ('unit', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='+', null=True, to=orm['archaeological_context_records.Unit'])),
+ ('has_furniture', self.gf('django.db.models.fields.NullBooleanField')(null=True, blank=True)),
+ ('filling', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('interpretation', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+ ('taq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('taq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('tpq', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('tpq_estimated', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
+ ('identification', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.IdentificationType'], null=True, blank=True)),
+ ('activity', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['archaeological_context_records.ActivityType'], null=True, blank=True)),
+ ))
+ db.send_create_signal('archaeological_context_records', ['ContextRecord'])
+
+ # Adding M2M table for field datings on 'ContextRecord'
+ db.create_table('archaeological_context_records_contextrecord_datings', (
+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+ ('contextrecord', models.ForeignKey(orm['archaeological_context_records.contextrecord'], null=False)),
+ ('dating', models.ForeignKey(orm['archaeological_context_records.dating'], null=False))
+ ))
+ db.create_unique('archaeological_context_records_contextrecord_datings', ['contextrecord_id', 'dating_id'])
+
+ # Adding model 'ContextRecordSource'
+ db.create_table('archaeological_context_records_contextrecordsource', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('title', self.gf('django.db.models.fields.CharField')(max_length=200)),
+ ('source_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['ishtar_common.SourceType'])),
+ ('associated_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)),
+ ('receipt_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
+ ('creation_date', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
+ ('context_record', self.gf('django.db.models.fields.related.ForeignKey')(related_name='source', to=orm['archaeological_context_records.ContextRecord'])),
+ ))
+ db.send_create_signal('archaeological_context_records', ['ContextRecordSource'])
+
+ # Adding M2M table for field authors on 'ContextRecordSource'
+ db.create_table('archaeological_context_records_contextrecordsource_authors', (
+ ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+ ('contextrecordsource', models.ForeignKey(orm['archaeological_context_records.contextrecordsource'], null=False)),
+ ('author', models.ForeignKey(orm['ishtar_common.author'], null=False))
+ ))
+ db.create_unique('archaeological_context_records_contextrecordsource_authors', ['contextrecordsource_id', 'author_id'])
+
+
+ def backwards(self, orm):
+ # Deleting model 'Parcel'
+ db.delete_table('archaeological_context_records_parcel')
+
+ # Deleting model 'ParcelOwner'
+ db.delete_table('archaeological_context_records_parcelowner')
+
+ # Deleting model 'DatingType'
+ db.delete_table('archaeological_context_records_datingtype')
+
+ # Deleting model 'DatingQuality'
+ db.delete_table('archaeological_context_records_datingquality')
+
+ # Deleting model 'Dating'
+ db.delete_table('archaeological_context_records_dating')
+
+ # Deleting model 'Unit'
+ db.delete_table('archaeological_context_records_unit')
+
+ # Deleting model 'ActivityType'
+ db.delete_table('archaeological_context_records_activitytype')
+
+ # Deleting model 'IdentificationType'
+ db.delete_table('archaeological_context_records_identificationtype')
+
+ # Deleting model 'HistoricalContextRecord'
+ db.delete_table('archaeological_context_records_historicalcontextrecord')
+
+ # Deleting model 'ContextRecord'
+ db.delete_table('archaeological_context_records_contextrecord')
+
+ # Removing M2M table for field datings on 'ContextRecord'
+ db.delete_table('archaeological_context_records_contextrecord_datings')
+
+ # Deleting model 'ContextRecordSource'
+ db.delete_table('archaeological_context_records_contextrecordsource')
+
+ # Removing M2M table for field authors on 'ContextRecordSource'
+ db.delete_table('archaeological_context_records_contextrecordsource_authors')
+
+
+ models = {
+ 'archaeological_context_records.activitytype': {
+ 'Meta': {'object_name': 'ActivityType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_context_records.contextrecord': {
+ 'Meta': {'object_name': 'ContextRecord'},
+ 'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.ActivityType']", 'null': 'True', 'blank': 'True'}),
+ 'datings': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_context_records.Dating']", 'symmetrical': 'False'}),
+ 'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'identification': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.IdentificationType']", 'null': 'True', 'blank': 'True'}),
+ 'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ 'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_operations.Operation']"}),
+ 'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'context_record'", 'to': "orm['archaeological_context_records.Parcel']"}),
+ 'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'unit': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['archaeological_context_records.Unit']"}),
+ 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_context_records.contextrecordsource': {
+ 'Meta': {'object_name': 'ContextRecordSource'},
+ 'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Author']", 'symmetrical': 'False'}),
+ 'context_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_context_records.ContextRecord']"}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '200'})
+ },
+ 'archaeological_context_records.dating': {
+ 'Meta': {'object_name': 'Dating'},
+ 'dating_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingType']", 'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']"}),
+ 'quality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.DatingQuality']", 'null': 'True', 'blank': 'True'}),
+ 'start_date': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_context_records.datingquality': {
+ 'Meta': {'object_name': 'DatingQuality'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_context_records.datingtype': {
+ 'Meta': {'object_name': 'DatingType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_context_records.historicalcontextrecord': {
+ 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalContextRecord'},
+ 'activity_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'depth': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'filling': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'has_furniture': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+ 'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}),
+ 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}),
+ 'identification_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'interpretation': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
+ 'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'location': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'parcel_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'taq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'taq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'thickness': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'tpq': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'tpq_estimated': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'unit_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+ 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_context_records.identificationtype': {
+ 'Meta': {'object_name': 'IdentificationType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_context_records.parcel': {
+ 'Meta': {'object_name': 'Parcel'},
+ 'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}),
+ 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}),
+ 'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6'}),
+ 'section': ('django.db.models.fields.CharField', [], {'max_length': '4'}),
+ 'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}),
+ 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_context_records.parcelowner': {
+ 'Meta': {'object_name': 'ParcelOwner'},
+ 'end_date': ('django.db.models.fields.DateField', [], {}),
+ 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"}),
+ 'parcel': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Parcel']"}),
+ 'start_date': ('django.db.models.fields.DateField', [], {})
+ },
+ 'archaeological_context_records.unit': {
+ 'Meta': {'object_name': 'Unit'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_context_records.Unit']", 'null': 'True', 'blank': 'True'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_files.file': {
+ 'Meta': {'ordering': "['-year', '-numeric_reference']", 'object_name': 'File'},
+ 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
+ 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}),
+ 'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.Person']"}),
+ 'internal_reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '60'}),
+ 'numeric_reference': ('django.db.models.fields.IntegerField', [], {}),
+ 'permit_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}),
+ 'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}),
+ 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'reference_number': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}),
+ 'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}),
+ 'total_developed_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'total_surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}),
+ 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}),
+ 'year': ('django.db.models.fields.IntegerField', [], {'default': '2012'})
+ },
+ 'archaeological_files.filetype': {
+ 'Meta': {'object_name': 'FileType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_files.permittype': {
+ 'Meta': {'object_name': 'PermitType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_files.saisinetype': {
+ 'Meta': {'object_name': 'SaisineType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'delay': ('django.db.models.fields.IntegerField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_operations.operation': {
+ 'Meta': {'object_name': 'Operation'},
+ 'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}),
+ 'code_dracar': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'code_patriarche': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'common_name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}),
+ 'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
+ 'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}),
+ 'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}),
+ 'operation_code': ('django.db.models.fields.IntegerField', [], {}),
+ 'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['archaeological_operations.OperationType']"}),
+ 'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}),
+ 'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'periods': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.Period']", 'symmetrical': 'False'}),
+ 'remains': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_operations.RemainType']", 'symmetrical': 'False'}),
+ 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+ 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.Town']", 'symmetrical': 'False'}),
+ 'year': ('django.db.models.fields.IntegerField', [], {}),
+ 'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'archaeological_operations.operationtype': {
+ 'Meta': {'object_name': 'OperationType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_operations.period': {
+ 'Meta': {'object_name': 'Period'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'end_date': ('django.db.models.fields.IntegerField', [], {}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}),
+ 'start_date': ('django.db.models.fields.IntegerField', [], {}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'archaeological_operations.remaintype': {
+ 'Meta': {'object_name': 'RemainType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'ishtar_common.arrondissement': {
+ 'Meta': {'object_name': 'Arrondissement'},
+ 'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'})
+ },
+ 'ishtar_common.author': {
+ 'Meta': {'object_name': 'Author'},
+ 'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Person']"})
+ },
+ 'ishtar_common.authortype': {
+ 'Meta': {'object_name': 'AuthorType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'ishtar_common.canton': {
+ 'Meta': {'object_name': 'Canton'},
+ 'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'})
+ },
+ 'ishtar_common.department': {
+ 'Meta': {'ordering': "['number']", 'object_name': 'Department'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'})
+ },
+ 'ishtar_common.organization': {
+ 'Meta': {'object_name': 'Organization'},
+ 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}),
+ 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}),
+ 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'})
+ },
+ 'ishtar_common.organizationtype': {
+ 'Meta': {'object_name': 'OrganizationType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'ishtar_common.person': {
+ 'Meta': {'object_name': 'Person'},
+ 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Organization']", 'null': 'True', 'blank': 'True'}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
+ 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['auth.User']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'person_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.PersonType']"}),
+ 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}),
+ 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}),
+ 'surname': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
+ 'town': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'})
+ },
+ 'ishtar_common.persontype': {
+ 'Meta': {'object_name': 'PersonType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'rights': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.WizardStep']", 'symmetrical': 'False'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'ishtar_common.sourcetype': {
+ 'Meta': {'object_name': 'SourceType'},
+ 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'ishtar_common.town': {
+ 'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'},
+ 'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}),
+ 'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}),
+ 'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}),
+ 'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
+ },
+ 'ishtar_common.wizard': {
+ 'Meta': {'ordering': "['url_name']", 'object_name': 'Wizard'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'url_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
+ },
+ 'ishtar_common.wizardstep': {
+ 'Meta': {'ordering': "['wizard', 'order']", 'object_name': 'WizardStep'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'order': ('django.db.models.fields.IntegerField', [], {}),
+ 'url_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'wizard': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Wizard']"})
+ }
+ }
+
+ complete_apps = ['archaeological_context_records'] \ No newline at end of file
diff --git a/archaeological_context_records/migrations/__init__.py b/archaeological_context_records/migrations/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/archaeological_context_records/migrations/__init__.py
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
new file mode 100644
index 000000000..c47fd3354
--- /dev/null
+++ b/archaeological_context_records/models.py
@@ -0,0 +1,243 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2012 É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.contrib.gis.db import models
+from django.utils.translation import ugettext_lazy as _, ugettext
+
+from ishtar_common.models import GeneralType, BaseHistorizedItem, \
+ LightHistorizedItem, HistoricalRecords, OwnPerms, Town, Person, Source
+FILES_AVAILABLE = 'archaeological_files' in settings.INSTALLED_APPS
+if FILES_AVAILABLE:
+ from archaeological_files.models import File
+from archaeological_operations.models import Operation, Period
+
+class Parcel(LightHistorizedItem):
+ if FILES_AVAILABLE:
+ associated_file = models.ForeignKey(File, related_name='parcels',
+ blank=True, null=True, verbose_name=_(u"File"))
+ operation = models.ForeignKey(Operation, related_name='parcels', blank=True,
+ null=True, verbose_name=_(u"Operation"))
+ year = models.IntegerField(_(u"Year"), blank=True, null=True)
+ 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)
+
+ class Meta:
+ verbose_name = _(u"Parcel")
+ verbose_name_plural = _(u"Parcels")
+
+ def short_label(self):
+ return JOINT.join([unicode(item) for item in [self.section,
+ self.parcel_number] if item])
+
+ def __unicode__(self):
+ return self.short_label()
+
+ def long_label(self):
+ items = [unicode(self.operation or self.associated_file)]
+ items += [unicode(item) for item in [self.section, self.parcel_number]
+ if item]
+ return JOINT.join(items)
+
+class ParcelOwner(LightHistorizedItem):
+ owner = models.ForeignKey(Person, verbose_name=_(u"Owner"))
+ parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"))
+ start_date = models.DateField(_(u"Start date"))
+ end_date = models.DateField(_(u"End date"))
+
+ class Meta:
+ verbose_name = _(u"Parcel owner")
+ verbose_name_plural = _(u"Parcel owners")
+
+ def __unicode__(self):
+ return self.owner + JOINT + self.parcel
+
+class DatingType(GeneralType):
+ class Meta:
+ verbose_name = _(u"Dating type")
+ verbose_name_plural = _(u"Dating types")
+
+class DatingQuality(GeneralType):
+ class Meta:
+ verbose_name = _(u"Dating quality")
+ verbose_name_plural = _(u"Dating qualities")
+
+class Dating(models.Model):
+ period = models.ForeignKey(Period, verbose_name=_(u"Period"))
+ start_date = models.IntegerField(_(u"Start date"), blank=True, null=True)
+ end_date = models.IntegerField(_(u"End date"), blank=True, null=True)
+ dating_type = models.ForeignKey(DatingType, verbose_name=_(u"Dating type"),
+ blank=True, null=True)
+ quality = models.ForeignKey(DatingQuality, verbose_name=_(u"Quality"),
+ blank=True, null=True)
+
+ class Meta:
+ verbose_name = _(u"Dating")
+ verbose_name_plural = _(u"Datings")
+
+ def __unicode__(self):
+ start_date = self.start_date and unicode(self.start_date) or u""
+ end_date = self.end_date and unicode(self.end_date) or u""
+ if not start_date and not end_date:
+ return unicode(self.period)
+ return u"%s (%s-%s)" % (self.period, start_date, end_date)
+
+class Unit(GeneralType):
+ order = models.IntegerField(_(u"Order"))
+ parent = models.ForeignKey("Unit", verbose_name=_(u"Parent unit"),
+ blank=True, null=True)
+
+ class Meta:
+ verbose_name = _(u"Type Unit")
+ verbose_name_plural = _(u"Types Unit")
+
+ def __unicode__(self):
+ return self.label
+
+class ActivityType(GeneralType):
+ order = models.IntegerField(_(u"Order"))
+
+ class Meta:
+ verbose_name = _(u"Type Activity")
+ verbose_name_plural = _(u"Types Activity")
+
+ def __unicode__(self):
+ return self.label
+
+class IdentificationType(GeneralType):
+ order = models.IntegerField(_(u"Order"))
+ class Meta:
+ verbose_name = _(u"Type Identification")
+ verbose_name_plural = _(u"Types Identification")
+
+ def __unicode__(self):
+ return self.label
+
+class ContextRecord(BaseHistorizedItem, OwnPerms):
+ TABLE_COLS = ['parcel.town', 'operation.year',
+ 'operation.operation_code',
+ 'label', 'unit']
+ if settings.COUNTRY == 'fr':
+ TABLE_COLS.insert(1, 'parcel.operation.code_patriarche')
+ parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"),
+ related_name='context_record')
+ operation = models.ForeignKey(Operation, verbose_name=_(u"Operation"),
+ related_name='context_record')
+ label = models.CharField(_(u"ID"), max_length=200)
+ description = models.TextField(_(u"Description"), blank=True, null=True)
+ length = models.IntegerField(_(u"Length (cm)"), blank=True, null=True)
+ width = models.IntegerField(_(u"Width (cm)"), blank=True, null=True)
+ thickness = models.IntegerField(_(u"Thickness (cm)"), blank=True, null=True)
+ depth = models.IntegerField(_(u"Depth (cm)"), blank=True, null=True)
+ location = models.CharField(_(u"Location"), blank=True, null=True,
+ max_length=200,
+ help_text=_(u"A short description of the location of the context record"))
+ datings = models.ManyToManyField(Dating)
+ unit = models.ForeignKey(Unit, verbose_name=_(u"Unit"), related_name='+',
+ blank=True, null=True)
+ has_furniture = models.NullBooleanField(u"Has furniture?", blank=True,
+ null=True)
+ filling = models.TextField(_(u"Filling"), blank=True, null=True)
+ interpretation = models.TextField(_(u"Interpretation"), blank=True,
+ null=True)
+ taq = models.IntegerField(_(u"TAQ"), blank=True, null=True,
+ help_text=_(u"\"Terminus Ante Quem\" the context record can't have been "
+ "created after this date"))
+ taq_estimated = models.IntegerField(_(u"Estimated TAQ"), blank=True,
+ null=True, help_text=_(u"Estimation of a \"Terminus Ante Quem\""))
+ tpq = models.IntegerField(_(u"TPQ"), blank=True, null=True,
+ help_text=_(u"\"Terminus Post Quem\" the context record can't have been "
+ " created before this date"))
+ tpq_estimated = models.IntegerField(_(u"Estimated TPQ"), blank=True,
+ null=True, help_text=_(u"Estimation of a \"Terminus Post Quem\""))
+ identification = models.ForeignKey(IdentificationType, blank=True,
+ null=True, verbose_name=_(u"Identification"),)
+ activity = models.ForeignKey(ActivityType,blank=True, null=True,
+ verbose_name=_(u"Activity"),)
+ history = HistoricalRecords()
+
+ class Meta:
+ verbose_name = _(u"Context Record")
+ verbose_name_plural = _(u"Context Record")
+ permissions = (
+ ("view_own_contextrecord", ugettext(u"Can view own Context Record")),
+ ("add_own_contextrecord", ugettext(u"Can add own Context Record")),
+ ("change_own_contextrecord", ugettext(u"Can change own Context Record")),
+ ("delete_own_contextrecord", ugettext(u"Can delete own Context Record")),
+ )
+
+ def __unicode__(self):
+ return self.short_label()
+
+ def short_label(self):
+ return JOINT.join([unicode(item) for item in [self.parcel,
+ self.label] if item])
+
+ def full_label(self):
+ if not self.parcel.operation:
+ return unicode(self)
+ return self._real_label() or self._temp_label()
+
+ def _real_label(self):
+ if not self.parcel.operation.code_patriarche:
+ return
+ return JOINT.join((self.parcel.operation.code_patriarche,
+ self.label))
+
+ def _temp_label(self):
+ if self.parcel.operation.code_patriarche:
+ return
+ return JOINT.join([unicode(lbl) for lbl in [self.parcel.operation.year,
+ self.parcel.operation.operation_code,
+ self.label] if lbl])
+
+ @classmethod
+ def get_years(cls):
+ years = set()
+ for res in list(cls.objects.values('operation__start_date')):
+ yr = res['operation__start_date'].year
+ years.add(yr)
+ return list(years)
+
+ @classmethod
+ def get_by_year(cls, year):
+ return cls.objects.filter(operation__start_date__year=year)
+
+ @classmethod
+ def get_operations(cls):
+ return [dct['operation__pk']
+ for dct in cls.objects.values('operation__pk').distinct()]
+
+ @classmethod
+ def get_by_operation(cls, operation_id):
+ return cls.objects.filter(operation__pk=operation_id)
+
+ @classmethod
+ def get_total_number(cls):
+ return cls.objects.filter(operation__start_date__isnull=False).count()
+
+class ContextRecordSource(Source):
+ class Meta:
+ verbose_name = _(u"Context record documentation")
+ verbose_name_plural = _(u"Context record documentations")
+ context_record = models.ForeignKey(ContextRecord,
+ verbose_name=_(u"Context record"), related_name="source")
+