diff options
Diffstat (limited to 'ishtar_common')
4 files changed, 822 insertions, 10 deletions
| diff --git a/ishtar_common/fixtures/initial_importtypes-fr.json b/ishtar_common/fixtures/initial_importtypes-fr.json index a848b945f..77935731f 100644 --- a/ishtar_common/fixtures/initial_importtypes-fr.json +++ b/ishtar_common/fixtures/initial_importtypes-fr.json @@ -11,6 +11,28 @@          }      },       { +        "pk": 2,  +        "model": "ishtar_common.importertype",  +        "fields": { +            "users": [],  +            "is_template": true,  +            "name": "Bibracte - Parcelles",  +            "associated_models": "archaeological_operations.models.Parcel",  +            "description": "" +        } +    },  +    { +        "pk": 3,  +        "model": "ishtar_common.importertype",  +        "fields": { +            "users": [],  +            "is_template": true,  +            "name": "Bibracte - Documentation",  +            "associated_models": "archaeological_operations.models.OperationSource",  +            "description": "" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importerdefault",           "fields": { @@ -19,6 +41,14 @@          }      },       { +        "pk": 2,  +        "model": "ishtar_common.importerdefault",  +        "fields": { +            "importer_type": 3,  +            "target": "authors" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importerdefaultvalues",           "fields": { @@ -28,6 +58,15 @@          }      },       { +        "pk": 2,  +        "model": "ishtar_common.importerdefaultvalues",  +        "fields": { +            "default_target": 2,  +            "target": "author_type",  +            "value": "main_author" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importercolumn",           "fields": { @@ -108,6 +147,176 @@          }      },       { +        "pk": 9,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 1,  +            "required": true,  +            "importer_type": 2,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 10,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 2,  +            "required": true,  +            "importer_type": 2,  +            "regexp_pre_filter": 1 +        } +    },  +    { +        "pk": 11,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 5,  +            "required": false,  +            "importer_type": 2,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 12,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 7,  +            "required": false,  +            "importer_type": 2,  +            "regexp_pre_filter": 2 +        } +    },  +    { +        "pk": 13,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 9,  +            "required": false,  +            "importer_type": 2,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 14,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 1,  +            "required": true,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 15,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 2,  +            "required": true,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 16,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 3,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 17,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 4,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 18,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 5,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 19,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 6,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 20,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 7,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 21,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 8,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 22,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 9,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 23,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 12,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 24,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 13,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    { +        "pk": 25,  +        "model": "ishtar_common.importercolumn",  +        "fields": { +            "col_number": 16,  +            "required": false,  +            "importer_type": 3,  +            "regexp_pre_filter": null +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.importtarget",           "fields": { @@ -188,6 +397,195 @@          }      },       { +        "pk": 9,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 9,  +            "formater_type": 1,  +            "target": "operation__operation_code",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 10,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 10,  +            "formater_type": 7,  +            "target": "section",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 11,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 10,  +            "formater_type": 8,  +            "target": "parcel_number",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 12,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 11,  +            "formater_type": 9,  +            "target": "year",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 13,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 12,  +            "formater_type": 8,  +            "target": "town__numero_insee",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 14,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 13,  +            "formater_type": 10,  +            "target": "address",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 15,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 14,  +            "formater_type": 1,  +            "target": "operation__operation_code",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 16,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 15,  +            "formater_type": 11,  +            "target": "external_id",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 17,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 16,  +            "formater_type": 12,  +            "target": "source_type",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 18,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 17,  +            "formater_type": 13,  +            "target": "support_type",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 19,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 18,  +            "formater_type": 1,  +            "target": "item_number",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 20,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 19,  +            "formater_type": 4,  +            "target": "authors__person__raw_name",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 21,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 20,  +            "formater_type": 14,  +            "target": "creation_date",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 22,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 21,  +            "formater_type": 15,  +            "target": "format_type",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 23,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 22,  +            "formater_type": 16,  +            "target": "description",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 24,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 23,  +            "formater_type": 16,  +            "target": "comment",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 25,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 24,  +            "formater_type": 17,  +            "target": "scale",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 26,  +        "model": "ishtar_common.importtarget",  +        "fields": { +            "column": 25,  +            "formater_type": 16,  +            "target": "additional_information",  +            "regexp_filter": null +        } +    },  +    { +        "pk": 5,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "DateFormater",  +            "many_split": "",  +            "options": "%Y/%m/%d" +        } +    },  +    {          "pk": 1,           "model": "ishtar_common.formatertype",           "fields": { @@ -206,6 +604,60 @@          }      },       { +        "pk": 6,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "&",  +            "options": "archaeological_operations.models.Period" +        } +    },  +    { +        "pk": 15,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "",  +            "options": "Format" +        } +    },  +    { +        "pk": 12,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "",  +            "options": "SourceType" +        } +    },  +    { +        "pk": 13,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "TypeFormater",  +            "many_split": "",  +            "options": "SupportType" +        } +    },  +    { +        "pk": 16,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "1000" +        } +    },  +    { +        "pk": 11,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "12" +        } +    },  +    {          "pk": 3,           "model": "ishtar_common.formatertype",           "fields": { @@ -215,6 +667,15 @@          }      },       { +        "pk": 17,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "30" +        } +    },  +    {          "pk": 4,           "model": "ishtar_common.formatertype",           "fields": { @@ -224,21 +685,48 @@          }      },       { -        "pk": 5,  +        "pk": 7,           "model": "ishtar_common.formatertype",           "fields": { -            "formater_type": "DateFormater",  +            "formater_type": "UnicodeFormater",               "many_split": "",  -            "options": "%Y/%m/%d" +            "options": "4"          }      },       { -        "pk": 6,  +        "pk": 10,           "model": "ishtar_common.formatertype",           "fields": { -            "formater_type": "TypeFormater",  -            "many_split": "&",  -            "options": "archaeological_operations.models.Period" +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "500" +        } +    },  +    { +        "pk": 8,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "UnicodeFormater",  +            "many_split": "",  +            "options": "6" +        } +    },  +    { +        "pk": 9,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "YearFormater",  +            "many_split": "",  +            "options": "" +        } +    },  +    { +        "pk": 14,  +        "model": "ishtar_common.formatertype",  +        "fields": { +            "formater_type": "YearFormater",  +            "many_split": "",  +            "options": "%Y"          }      }  ]
\ No newline at end of file diff --git a/ishtar_common/migrations/0030_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py b/ishtar_common/migrations/0030_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py new file mode 100644 index 000000000..7fddc0fca --- /dev/null +++ b/ishtar_common/migrations/0030_auto__del_unique_targetkey_target_value__add_unique_targetkey_target_k.py @@ -0,0 +1,321 @@ +# -*- 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): +        # Removing unique constraint on 'TargetKey', fields ['target', 'value'] +        db.delete_unique('ishtar_common_targetkey', ['target_id', 'value']) + +        # Adding unique constraint on 'TargetKey', fields ['target', 'key'] +        db.create_unique('ishtar_common_targetkey', ['target_id', 'key']) + + +    def backwards(self, orm): +        # Removing unique constraint on 'TargetKey', fields ['target', 'key'] +        db.delete_unique('ishtar_common_targetkey', ['target_id', 'key']) + +        # Adding unique constraint on 'TargetKey', fields ['target', 'value'] +        db.create_unique('ishtar_common_targetkey', ['target_id', 'value']) + + +    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': '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.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': '30'}) +        }, +        'ishtar_common.formatertype': { +            'Meta': {'ordering': "('formater_type', 'options')", 'unique_together': "(('formater_type', 'options', 'many_split'),)", 'object_name': 'FormaterType'}, +            'formater_type': ('django.db.models.fields.CharField', [], {'max_length': '20'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'many_split': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), +            'options': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.globalvar': { +            'Meta': {'ordering': "['slug']", 'object_name': 'GlobalVar'}, +            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), +            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), +            'value': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) +        }, +        'ishtar_common.historicalorganization': { +            'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOrganization'}, +            'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), +            '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': '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', [], {'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': '30'}) +        }, +        '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': '30'}) +        }, +        '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': '30'}) +        }, +        'ishtar_common.targetkey': { +            'Meta': {'unique_together': "(('target', 'key'),)", '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 2ed6b28c5..89e56a312 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1002,6 +1002,8 @@ def get_model_fields(model):  def import_class(full_path_classname):      mods = full_path_classname.split('.') +    if len(mods) == 1: +        mods = ['ishtar_common', 'models', mods[0]]      module = import_module('.'.join(mods[:-1]))      return getattr(module, mods[-1]) @@ -1210,7 +1212,7 @@ class TargetKey(models.Model):      is_set = models.BooleanField(_(u"Is set"), default=False)      class Meta: -        unique_together = ('target', 'value') +        unique_together = ('target', 'key')      def __unicode__(self):          return u" - ".join([unicode(self.target), self.key[:50]]) diff --git a/ishtar_common/templates/blocks/inline_formset.html b/ishtar_common/templates/blocks/inline_formset.html index c33da051e..3affb7bf3 100644 --- a/ishtar_common/templates/blocks/inline_formset.html +++ b/ishtar_common/templates/blocks/inline_formset.html @@ -8,8 +8,9 @@      </tr>      </thead>{% endif %}{% for frm in formset%}      {% if forloop.first and not skip %}<tbody>{%endif%} -    {% if not skip or not forloop.first %}<tr>{% endif %}{% for field in frm.visible_fields %} -        <td> +    {% if not skip or not forloop.first %} +    {% if frm.errors %}<tr><td colspan='3'><ul>{% for error in frm.errors.values %}<li>{{error}}</li>{% endfor%}</ul></td></tr>{% endif %} +        <tr>{% endif %}{% for field in frm.visible_fields %}<td>          {% if field.errors %}<div class='errors'>{{ field.errors.as_ul }}</div>{% endif %}          {{ field }}          {# Include the hidden fields in the form #} | 
