From 8b666443667f92e014d70a4247c7885375bba610 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 30 Nov 2016 13:20:53 +0100 Subject: Simple treatment form. Treatment listing. (refs #3365) --- ishtar_common/widgets.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 1183836bc..be22bd3cb 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -581,6 +581,8 @@ class JQueryJqGrid(forms.RadioSelect): field_name += "__" field_name += f_name field_verbose_names.append(unicode(field_verbose_name)) + if not field_name: + field_name = "__".join(col_names) if field_name in col_labels: jq_col_names.append(unicode(col_labels[field_name])) elif col_names and col_names[0] in col_labels: -- cgit v1.2.3 From e7d4d95a64a3f80941197b8eb015ebdd1ecc8245 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 4 Dec 2016 22:44:58 +0100 Subject: Find table: force label for associated periods --- archaeological_finds/models.py | 5 ++++- ishtar_common/widgets.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index fc231a16a..d142a22b3 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -307,10 +307,13 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'base_finds__cache_short_id', 'base_finds__cache_complete_id', 'previous_id', 'label', 'material_types', - 'datings__period', 'find_number', 'object_types', + 'datings__period__label', 'find_number', 'object_types', 'description', 'base_finds__context_record__parcel__town', 'base_finds__context_record__parcel', ] + TABLE_COLS_FOR_OPE_LBL = { + 'datings__period__label': _(u"Periods"), + } EXTRA_FULL_FIELDS = [ 'base_finds__cache_short_id', 'base_finds__cache_complete_id', diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index be22bd3cb..e21ce7a2a 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -322,7 +322,6 @@ class JQueryTown(forms.TextInput): @classmethod def encode_source(cls, source): - encoded_src = '' if isinstance(source, list): encoded_src = JSONEncoder().encode(source) elif isinstance(source, str) \ -- cgit v1.2.3 From fcf63a61bdcab906aad45c69eb95167850e2c40a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 5 Dec 2016 18:11:39 +0100 Subject: Fix bad initialization of multiple checkbox field --- archaeological_finds/forms.py | 10 +++++----- ishtar_common/forms.py | 4 ++-- ishtar_common/widgets.py | 17 ++++++++++++++++- 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index a37d6b5f6..3fc8d7c01 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -117,13 +117,13 @@ class FindForm(ManageOldType, forms.Form): model=models.ObjectType, label=_(u"Object types"), required=False) preservation_to_consider = forms.MultipleChoiceField( label=_(u"Preservation type"), choices=[], - widget=forms.CheckboxSelectMultiple, required=False) + widget=widgets.CheckboxSelectMultiple, required=False) integritie = forms.MultipleChoiceField( label=_(u"Integrity / interest"), choices=[], - widget=forms.CheckboxSelectMultiple, required=False) + widget=widgets.CheckboxSelectMultiple, required=False) remarkabilitie = forms.MultipleChoiceField( label=_(u"Remarkability"), choices=[], - widget=forms.CheckboxSelectMultiple, required=False) + widget=widgets.CheckboxSelectMultiple, required=False) topographic_reference_point = forms.CharField( label=_(u"Point of topographic reference"), required=False, max_length=20 @@ -246,7 +246,7 @@ class FindSelect(TableSelect): validators=[valid_id(ArchaeologicalSite)]) ope_relation_types = forms.MultipleChoiceField( label=_(u"Search within related operations"), choices=[], - widget=forms.CheckboxSelectMultiple) + widget=widgets.CheckboxSelectMultiple) datings__period = forms.ChoiceField(label=_(u"Period"), choices=[]) # TODO search by warehouse material_types = forms.ChoiceField(label=_(u"Material type"), choices=[]) @@ -654,7 +654,7 @@ class BaseTreatmentForm(ManageOldType, forms.Form): validators.MaxValueValidator(2100)]) treatment_type = forms.MultipleChoiceField( label=_(u"Treatment type"), choices=[], - widget=forms.CheckboxSelectMultiple) + widget=widgets.CheckboxSelectMultiple) target_is_basket = forms.NullBooleanField(label=_(u"Target")) person = forms.IntegerField( label=_(u"Responsible"), diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 043b03f61..42d74f9ef 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -33,6 +33,7 @@ from django.utils.translation import ugettext_lazy as _ import models import widgets +from wizards import MultiValueDict # from formwizard.forms import NamedUrlSessionFormWizard @@ -224,7 +225,6 @@ class ManageOldType(object): if prefix not in k: continue new_k = k[len(prefix) + 1:] - items = [] if hasattr(kwargs['data'], 'getlist'): items = kwargs['data'].getlist(k) else: @@ -238,7 +238,6 @@ class ManageOldType(object): if 'initial' in kwargs and kwargs['initial']: for k in kwargs['initial']: if k not in self.init_data or not self.init_data[k]: - items = [] if hasattr(kwargs['initial'], 'getlist'): items = kwargs['initial'].getlist(k) else: @@ -249,6 +248,7 @@ class ManageOldType(object): if k not in self.init_data: self.init_data[k] = [] self.init_data[k].append(val) + self.init_data = MultiValueDict(self.init_data) super(ManageOldType, self).__init__(*args, **kwargs) diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index e21ce7a2a..7696d67da 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -24,7 +24,8 @@ from django.conf import settings from django.core.urlresolvers import reverse from django.db.models import fields from django.forms import ClearableFileInput -from django.forms.widgets import flatatt +from django.forms.widgets import flatatt, \ + CheckboxSelectMultiple as CheckboxSelectMultipleBase from django.template import Context, loader from django.template.defaultfilters import slugify from django.utils.encoding import smart_unicode @@ -56,6 +57,20 @@ class Select2Multiple(forms.SelectMultiple): return super(Select2Multiple, self).render(name, value, attrs, choices) +class CheckboxSelectMultiple(CheckboxSelectMultipleBase): + """ + Fix initialization bug. + Should be corrected on recent Django version. + TODO: test and remove (test case: treatment type not keep on modif) + """ + def render(self, name, value, attrs=None, choices=()): + if type(value) in (str, unicode): + value = value.split(',') + if type(value) not in (list, tuple): + value = [value] + return super(CheckboxSelectMultiple, self).render(name, value, attrs, + choices) + class MultipleAutocompleteField(forms.MultipleChoiceField): def __init__(self, *args, **kwargs): -- cgit v1.2.3 From 349fd863a1850e7e342a71c3ca38c96593609a5f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 8 Dec 2016 20:40:25 +0100 Subject: Improve JQtables when dealing with multiple foreign keys --- ishtar_common/models.py | 2 +- ishtar_common/templatetags/window_tables.py | 10 +++++++--- ishtar_common/views.py | 4 ++-- ishtar_common/widgets.py | 15 ++++++++++----- 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 2bb96d11d..69bb9b935 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -416,7 +416,7 @@ class GeneralType(Cached, models.Model): for value in initial: try: pk = int(value) - except ValueError: + except (ValueError, TypeError): continue if pk in type_pks: continue diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index 566d1dfbc..377b6e435 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -17,7 +17,7 @@ from archaeological_operations.models import OperationSource, Operation from archaeological_context_records.models import ContextRecord, \ ContextRecordSource, RecordRelations as CRRecordRelations from archaeological_finds.models import Find, FindSource, \ - FindUpstreamTreatments, FindDownstreamTreatments + FindUpstreamTreatments, FindDownstreamTreatments, FindTreatments register = template.Library() @@ -53,16 +53,20 @@ ASSOCIATED_MODELS['finds_upstreamtreatments'] = ( FindUpstreamTreatments, 'get-upstreamtreatment', '') ASSOCIATED_MODELS['finds_downstreamtreatments'] = ( FindDownstreamTreatments, 'get-downstreamtreatment', '') +ASSOCIATED_MODELS['treatments'] = ( + FindTreatments, 'get-treatment', '') @register.simple_tag(takes_context=True) def dynamic_table_document( context, caption, associated_model, key, value, - table_cols='TABLE_COLS', output='html', large=False): + table_cols='TABLE_COLS', output='html', large=False, + col_prefix=''): if not table_cols: table_cols = 'TABLE_COLS' model, url, url_full = ASSOCIATED_MODELS[associated_model] - grid = JQueryJqGrid(None, None, model, table_cols=table_cols) + grid = JQueryJqGrid(None, None, model, table_cols=table_cols, + col_prefix=col_prefix) source = unicode(reverse_lazy(url)) source_full = unicode(reverse_lazy(url_full)) if url_full else '' source_attrs = mark_safe('?submited=1&{}={}'.format(key, value)) diff --git a/ishtar_common/views.py b/ishtar_common/views.py index c2bfd9bda..6426fef8f 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1009,9 +1009,9 @@ def get_item(model, func_name, default_name, extra_request_keys=[], # foreign key may be divided by "." or "__" for tc in table_col: if '.' in tc: - tab_cols.append(tc.split('.')[-1]) + tab_cols += tc.split('.') elif '__' in tc: - tab_cols.append(tc.split('__')[-1]) + tab_cols += tc.split('__') else: tab_cols.append(tc) k = "__".join(tab_cols) diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 7696d67da..7611a08df 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -529,7 +529,8 @@ class JQueryJqGrid(forms.RadioSelect): def __init__(self, source, form, associated_model, attrs={}, table_cols='TABLE_COLS', multiple=False, multiple_cols=[2], new=False, new_message="", source_full=None, - multiple_select=False, sortname="__default__"): + multiple_select=False, sortname="__default__", + col_prefix=''): """ JQueryJqGrid widget init. @@ -545,6 +546,7 @@ class JQueryJqGrid(forms.RadioSelect): :param source_full: url to get full listing :param multiple_select: :param sortname: column name (model attribute) to use to sort + :param col_prefix: prefix to remove to col_names """ super(JQueryJqGrid, self).__init__(attrs=attrs) self.source = source @@ -560,6 +562,9 @@ class JQueryJqGrid(forms.RadioSelect): self.new, self.new_message = new, new_message self.source_full = source_full self.sortname = sortname + self.col_prefix = col_prefix + if self.col_prefix and not self.col_prefix.endswith('__'): + self.col_prefix += "__" def get_cols(self, python=False): jq_col_names, extra_cols = [], [] @@ -577,23 +582,23 @@ class JQueryJqGrid(forms.RadioSelect): keys = col_name.split('__') if '.' in col_name: keys = col_name.split('.') - f_name = '' for key in keys: if hasattr(field, 'rel') and field.rel: field = field.rel.to try: field = field._meta.get_field(key) field_verbose_name = field.verbose_name - f_name = field.name except (fields.FieldDoesNotExist, AttributeError): if hasattr(field, key + '_lbl'): - f_name = key field_verbose_name = getattr(field, key + '_lbl') else: continue if field_name: field_name += "__" - field_name += f_name + if col_name.startswith(self.col_prefix): + field_name += col_name[len(self.col_prefix):] + else: + field_name += col_name field_verbose_names.append(unicode(field_verbose_name)) if not field_name: field_name = "__".join(col_names) -- cgit v1.2.3 From 35897953208aa60ee306aba73963dda34a553cb0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 11 Dec 2016 17:46:46 +0100 Subject: Administrative act for treatment and treatment files --- archaeological_files/urls.py | 8 +- archaeological_files/wizards.py | 1 + archaeological_finds/forms.py | 341 +-------- archaeological_finds/forms_treatments.py | 472 ++++++++++++ archaeological_finds/ishtar_menu.py | 95 ++- archaeological_finds/urls.py | 56 +- archaeological_finds/views.py | 121 ++- archaeological_finds/wizards.py | 60 ++ archaeological_operations/admin.py | 10 +- ...tiveact_treatment_file__add_field_administra.py | 822 +++++++++++++++++++++ archaeological_operations/models.py | 14 +- .../templates/ishtar/sheet_administrativeact.html | 48 +- archaeological_operations/urls.py | 6 +- archaeological_operations/wizards.py | 11 +- archaeological_warehouse/ishtar_menu.py | 2 +- ishtar_common/models.py | 7 +- ishtar_common/widgets.py | 12 +- 17 files changed, 1724 insertions(+), 362 deletions(-) create mode 100644 archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py (limited to 'ishtar_common/widgets.py') diff --git a/archaeological_files/urls.py b/archaeological_files/urls.py index b762a54b3..91d106f78 100644 --- a/archaeological_files/urls.py +++ b/archaeological_files/urls.py @@ -50,14 +50,14 @@ urlpatterns = patterns( check_rights(['view_file', 'view_own_file'])( views.file_search_wizard), name='file_search'), - url(r'file_creation/(?P.+)?$', + url(r'^file_creation/(?P.+)?$', check_rights(['add_file'])( views.file_creation_wizard), name='file_creation'), - url(r'file_modification/(?P.+)?$', + url(r'^file_modification/(?P.+)?$', check_rights(['change_file', 'change_own_file'])( views.file_modification_wizard), name='file_modification'), - url(r'file_modify/(?P.+)/$', views.file_modify, name='file_modify'), - url(r'file_closing/(?P.+)?$', + url(r'^file_modify/(?P.+)/$', views.file_modify, name='file_modify'), + url(r'^file_closing/(?P.+)?$', check_rights(['change_file'])( views.file_closing_wizard), name='file_closing'), diff --git a/archaeological_files/wizards.py b/archaeological_files/wizards.py index 4c3a13ee2..1558cd46e 100644 --- a/archaeological_files/wizards.py +++ b/archaeological_files/wizards.py @@ -142,6 +142,7 @@ class FileDeletionWizard(FileClosingWizard): class FileAdministrativeActWizard(OperationAdministrativeActWizard): model = models.File current_obj_slug = 'administrativeactfile' + ref_object_key = 'associated_file' def get_reminder(self): form_key = 'selec-' + self.url_name diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 541778d5c..78a415abf 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -21,7 +21,6 @@ Finds forms definitions """ -import datetime import logging from django import forms @@ -32,21 +31,53 @@ from django.forms.formsets import formset_factory from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ -from ishtar_common.models import Person, valid_id, valid_ids, \ - get_current_profile, Organization +from ishtar_common.models import valid_id, valid_ids, get_current_profile from archaeological_operations.models import Period, ArchaeologicalSite, \ RelationType as OpeRelationType from archaeological_context_records.models import DatingType, DatingQuality, \ ContextRecord -from archaeological_warehouse.models import Warehouse, Container import models -from ishtar_common import widgets -from archaeological_operations.widgets import OAWidget from ishtar_common.forms import FormSet, FloatField, \ get_form_selection, reverse_lazy, TableSelect, get_now, FinalForm, \ ManageOldType + from ishtar_common.forms_common import get_town_field, SourceSelect +from ishtar_common import widgets +from archaeological_operations.widgets import OAWidget + +from archaeological_finds.forms_treatments import TreatmentSelect, \ + TreatmentFormSelection, BaseTreatmentForm, ModifyTreatmentForm, \ + AdministrativeActTreatmentForm, TreatmentFormFileChoice, \ + TreatmentDeletionForm, TreatmentFileSelect, TreatmentFileFormSelection, \ + TreatmentFileForm, ModifyTreatmentFileForm, TreatmentFileDeletionForm, \ + AdministrativeActTreatmentFormSelection, \ + AdministrativeActTreatmentModifForm, \ + AdministrativeActTreatmentFileForm, \ + AdministrativeActTreatmentFileFormSelection, \ + AdministrativeActTreatmentFileModifForm + +__all__ = ['TreatmentSelect', 'TreatmentFormSelection', 'BaseTreatmentForm', + 'ModifyTreatmentForm', 'AdministrativeActTreatmentForm', + 'TreatmentFormFileChoice', 'TreatmentDeletionForm', + 'AdministrativeActTreatmentModifForm', + 'TreatmentFileSelect', 'TreatmentFileFormSelection', + 'TreatmentFileForm', 'ModifyTreatmentFileForm', + 'TreatmentFileDeletionForm', 'AdministrativeActTreatmentFileForm', + 'AdministrativeActTreatmentFileFormSelection', + 'AdministrativeActTreatmentFormSelection', + 'AdministrativeActTreatmentFileModifForm', + 'RecordFormSelection', + 'FindForm', 'DateForm', 'DatingFormSet', 'FindSelect', + 'FindFormSelection', 'MultipleFindFormSelection', + 'FindMultipleFormSelection', 'check_form', 'check_exist', + 'check_not_exist', 'check_value', 'check_type_field', + 'check_type_not_field', 'check_treatment', 'ResultFindForm', + 'ResultFindFormSet', 'FindDeletionForm', + 'UpstreamFindFormSelection', 'SourceFindFormSelection', + 'FindSourceSelect', 'FindSourceFormSelection', + 'NewFindBasketForm', 'SelectFindBasketForm', 'DeleteFindBasketForm', + 'FindBasketAddItemForm'] logger = logging.getLogger(__name__) @@ -604,304 +635,6 @@ class FindBasketAddItemForm(forms.Form): return basket -class TreatmentSelect(TableSelect): - label = forms.CharField(label=_(u"Label")) - other_reference = forms.CharField(label=_(u"Other ref.")) - year = forms.IntegerField(label=_(u"Year")) - index = forms.IntegerField(label=_(u"Index")) - treatment_types = forms.ChoiceField(label=_(u"Treatment type"), choices=[]) - image = forms.NullBooleanField(label=_(u"Has an image?")) - - def __init__(self, *args, **kwargs): - super(TreatmentSelect, self).__init__(*args, **kwargs) - self.fields['treatment_types'].choices = \ - models.TreatmentType.get_types() - self.fields['treatment_types'].help_text = \ - models.TreatmentType.get_help() - - -class TreatmentFormSelection(forms.Form): - form_label = _("Treatment search") - associated_models = {'pk': models.Treatment} - currents = {'pk': models.Treatment} - pk = forms.IntegerField( - label="", required=False, - widget=widgets.JQueryJqGrid( - reverse_lazy('get-treatment'), - TreatmentSelect, models.Treatment), - validators=[valid_id(models.Treatment)]) - - -class BaseTreatmentForm(ManageOldType, forms.Form): - form_label = _(u"Base treatment") - base_models = ['treatment_type'] - associated_models = {'treatment_type': models.TreatmentType, - 'person': Person, - 'location': Warehouse, - 'organization': Organization, - 'container': Container, - } - file_upload = True - need_user_for_initialization = True - - label = forms.CharField(label=_(u"Label"), - max_length=200, required=False) - other_reference = forms.CharField( - label=_(u"Other ref."), max_length=200, required=False) - year = forms.IntegerField(label=_("Year"), - initial=lambda: datetime.datetime.now().year, - validators=[validators.MinValueValidator(1900), - validators.MaxValueValidator(2100)]) - treatment_type = forms.MultipleChoiceField( - label=_(u"Treatment type"), choices=[], - widget=widgets.CheckboxSelectMultiple) - target_is_basket = forms.NullBooleanField(label=_(u"Target")) - person = forms.IntegerField( - label=_(u"Responsible"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-person'), associated_model=Person, - new=True), - validators=[valid_id(Person)], required=False) - organization = forms.IntegerField( - label=_(u"Organization"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-organization'), - associated_model=Organization, new=True), - validators=[valid_id(Organization)], required=False) - location = forms.IntegerField( - label=_(u"Location"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-warehouse'), associated_model=Warehouse, - new=True), - validators=[valid_id(Warehouse)]) - container = forms.IntegerField( - label=_(u"Container (relevant for packaging)"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-container'), - associated_model=Container, new=True), - validators=[valid_id(Container)], required=False) - external_id = forms.CharField( - label=_(u"External ref."), max_length=200, required=False) - comment = forms.CharField(label=_(u"Comment"), - widget=forms.Textarea, required=False) - description = forms.CharField(label=_(u"Description"), - widget=forms.Textarea, required=False) - goal = forms.CharField(label=_(u"Goal"), - widget=forms.Textarea, required=False) - start_date = forms.DateField(label=_(u"Start date"), required=False, - widget=widgets.JQueryDate) - end_date = forms.DateField(label=_(u"End date"), required=False, - widget=widgets.JQueryDate) - image = forms.ImageField( - label=_(u"Image"), help_text=mark_safe( - _(u"

Heavy images are resized to: %(width)dx%(height)d " - u"(ratio is preserved).

") % { - 'width': settings.IMAGE_MAX_SIZE[0], - 'height': settings.IMAGE_MAX_SIZE[1]}), - max_length=255, required=False, widget=widgets.ImageFileInput()) - - def __init__(self, *args, **kwargs): - user = kwargs.pop('user') - super(BaseTreatmentForm, self).__init__(*args, **kwargs) - q = Person.objects.filter(ishtaruser__pk=user.pk) - if q.count(): - person = q.all()[0] - self.fields['person'].initial = person.pk - if person.attached_to: - self.fields['organization'].initial = person.attached_to.pk - self.fields['target_is_basket'].widget.choices = \ - ((False, _(u"Single find")), (True, _(u"Basket"))) - self.fields['treatment_type'].choices = models.TreatmentType.get_types( - initial=self.init_data.get('treatment_type'), - dct={'upstream_is_many': False, 'downstream_is_many': False}, - empty_first=False - ) - self.fields['treatment_type'].help_text = \ - models.TreatmentType.get_help( - dct={'upstream_is_many': False, 'downstream_is_many': False}) - # TODO - """ - self.fields['basket'].required = False - self.fields['basket'].help_text = \ - _(u"Leave it blank if you want to select a single item") - self.fields.keyOrder.pop(self.fields.keyOrder.index('basket')) - self.fields.keyOrder.insert(self.fields.keyOrder.index('description'), - 'basket') - """ - - def clean(self, *args, **kwargs): - data = self.cleaned_data - packaging = models.TreatmentType.get_cache('packaging') - if not packaging: - logger.warning("No 'packaging' treatment type defined") - return - if data.get('container', None) \ - and str(packaging.pk) not in data.get('treatment_type', []): - raise forms.ValidationError( - _(u"The container field is attached to the treatment. If " - u"no packaging treatment is done it is not relevant.")) - if not data.get('container', None) \ - and str(packaging.pk) in data.get('treatment_type', []): - raise forms.ValidationError( - _(u"If a packaging treatment is done, the container field " - u"must be filled.")) - if not data.get('person', None) and not data.get('organization', None): - raise forms.ValidationError( - _(u"A responsible or an organization must be defined.")) - return data - # TODO - """ - for treatment_type in self.cleaned_data.get('treatment_type', []): - try: - treatment = models.TreatmentType.objects.get( - pk=treatment_type, available=True) - except models.TreatmentType.DoesNotExist: - raise forms.ValidationError(_(u"This treatment type is not " - u"available.")) - if treatment.upstream_is_many and \ - not self.cleaned_data.get('basket'): - raise forms.ValidationError(_(u"This treatment needs a " - u"basket.")) - """ - - -class ModifyTreatmentForm(BaseTreatmentForm): - index = forms.IntegerField(_(u"Index")) - id = forms.IntegerField(' ', widget=forms.HiddenInput, required=False) - - def clean(self, *args, **kwargs): - super(ModifyTreatmentForm, self).clean(*args, **kwargs) - cleaned_data = self.cleaned_data - year = cleaned_data.get('year') - pk = cleaned_data.get('id') - index = cleaned_data.get('index') - q = models.Treatment.objects\ - .filter(year=year, index=index).exclude(pk=pk) - if index and q.count(): - raise forms.ValidationError( - _(u"Another treatment with this index exists for {}." - ).format(year)) - return cleaned_data - - -class TreatmentFormFileChoice(forms.Form): - form_label = _(u"Associated file") - associated_models = {'file': models.TreatmentFile, } - currents = {'file': models.TreatmentFile} - file = forms.IntegerField( - label=_(u"Treatment file"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-treatmentfile'), - associated_model=models.TreatmentFile), - validators=[valid_id(models.TreatmentFile)], required=False) - - -class TreatmentDeletionForm(FinalForm): - confirm_msg = _( - u"Are you sure you want to delete this treatment? All modification " - u"made to the associated finds since this treatment record will be " - u"lost!") - confirm_end_msg = _(u"Would you like to delete this treatment?") - - -class TreatmentFileSelect(TableSelect): - name = forms.CharField(label=_(u"Name")) - internal_reference = forms.CharField(label=_(u"Internal ref.")) - year = forms.IntegerField(label=_(u"Year")) - index = forms.IntegerField(label=_(u"Index")) - type = forms.ChoiceField(label=_(u"Treatment file type"), choices=[]) - - def __init__(self, *args, **kwargs): - super(TreatmentFileSelect, self).__init__(*args, **kwargs) - self.fields['type'].choices = models.TreatmentFileType.get_types() - self.fields['type'].help_text = models.TreatmentFileType.get_help() - - -class TreatmentFileFormSelection(forms.Form): - form_label = _("Treatment file search") - associated_models = {'pk': models.TreatmentFile} - currents = {'pk': models.TreatmentFile} - pk = forms.IntegerField( - label="", required=False, - widget=widgets.JQueryJqGrid( - reverse_lazy('get-treatmentfile'), - TreatmentFileSelect, models.TreatmentFile), - validators=[valid_id(models.Treatment)]) - - -class TreatmentFileForm(ManageOldType, forms.Form): - form_label = _(u"Treatment file") - base_models = ['treatment_type_type'] - associated_models = {'type': models.TreatmentFileType, - 'in_charge': Person} - need_user_for_initialization = True - - name = forms.CharField(label=_(u"Name"), - max_length=1000, required=False) - internal_reference = forms.CharField( - label=_(u"Internal ref."), max_length=60, required=False) - year = forms.IntegerField(label=_("Year"), - initial=lambda: datetime.datetime.now().year, - validators=[validators.MinValueValidator(1900), - validators.MaxValueValidator(2100)]) - type = forms.ChoiceField( - label=_(u"Treatment file type"), choices=[]) - in_charge = forms.IntegerField( - label=_(u"Responsible"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-person'), associated_model=Person, - new=True), - validators=[valid_id(Person)]) - external_id = forms.CharField( - label=_(u"External ref."), max_length=200, required=False) - comment = forms.CharField(label=_(u"Comment"), - widget=forms.Textarea, required=False) - creation_date = forms.DateField(label=_(u"Start date"), required=False, - widget=widgets.JQueryDate, - initial=lambda: datetime.datetime.now()) - reception_date = forms.DateField(label=_(u"Reception date"), required=False, - widget=widgets.JQueryDate, - initial=lambda: datetime.datetime.now()) - end_date = forms.DateField(label=_(u"Closing date"), required=False, - widget=widgets.JQueryDate) - - def __init__(self, *args, **kwargs): - user = kwargs.pop('user') - super(TreatmentFileForm, self).__init__(*args, **kwargs) - q = Person.objects.filter(ishtaruser__pk=user.pk) - if q.count(): - person = q.all()[0] - self.fields['in_charge'].initial = person.pk - self.fields['type'].choices = models.TreatmentFileType.get_types( - initial=[self.init_data.get('type')], empty_first=False - ) - self.fields['type'].help_text = models.TreatmentFileType.get_help() - - -class ModifyTreatmentFileForm(TreatmentFileForm): - index = forms.IntegerField(_(u"Index")) - id = forms.IntegerField(' ', widget=forms.HiddenInput, required=False) - - def clean(self, *args, **kwargs): - super(ModifyTreatmentFileForm, self).clean(*args, **kwargs) - cleaned_data = self.cleaned_data - year = cleaned_data.get('year') - pk = cleaned_data.get('id') - index = cleaned_data.get('index') - q = models.TreatmentFile.objects\ - .filter(year=year, index=index).exclude(pk=pk) - if index and q.count(): - raise forms.ValidationError( - _(u"Another treatment file with this index exists for {}." - ).format(year)) - return cleaned_data - - -class TreatmentFileDeletionForm(FinalForm): - confirm_msg = _(u"Are you sure you want to delete this treatment file?") - confirm_end_msg = _(u"Would you like to delete this treatment file?") - - """ #################################### # Source management for treatments # diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index e69de29bb..4f5bbac07 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -0,0 +1,472 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2016 Étienne Loks + +# 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 . + +# See the file COPYING for details. + +import datetime +import logging + +from django import forms +from django.conf import settings +from django.core import validators +from django.utils.safestring import mark_safe +from django.utils.translation import ugettext_lazy as _ + +from ishtar_common.models import Person, valid_id, Organization +from archaeological_operations.models import ActType, AdministrativeAct +from archaeological_warehouse.models import Warehouse, Container +import models + +from archaeological_operations.forms import AdministrativeActOpeForm, \ + AdministrativeActOpeFormSelection, AdministrativeActModifForm + +from ishtar_common.forms import reverse_lazy, TableSelect, FinalForm, \ + ManageOldType + +from ishtar_common import widgets + +logger = logging.getLogger(__name__) + +# Treatment + + +class TreatmentSelect(TableSelect): + label = forms.CharField(label=_(u"Label")) + other_reference = forms.CharField(label=_(u"Other ref.")) + year = forms.IntegerField(label=_(u"Year")) + index = forms.IntegerField(label=_(u"Index")) + treatment_types = forms.ChoiceField(label=_(u"Treatment type"), choices=[]) + image = forms.NullBooleanField(label=_(u"Has an image?")) + + def __init__(self, *args, **kwargs): + super(TreatmentSelect, self).__init__(*args, **kwargs) + self.fields['treatment_types'].choices = \ + models.TreatmentType.get_types() + self.fields['treatment_types'].help_text = \ + models.TreatmentType.get_help() + + +class TreatmentFormSelection(forms.Form): + form_label = _("Treatment search") + associated_models = {'pk': models.Treatment} + currents = {'pk': models.Treatment} + pk = forms.IntegerField( + label="", required=False, + widget=widgets.JQueryJqGrid( + reverse_lazy('get-treatment'), + TreatmentSelect, models.Treatment), + validators=[valid_id(models.Treatment)]) + + +class BaseTreatmentForm(ManageOldType, forms.Form): + form_label = _(u"Base treatment") + base_models = ['treatment_type'] + associated_models = {'treatment_type': models.TreatmentType, + 'person': Person, + 'location': Warehouse, + 'organization': Organization, + 'container': Container, + } + file_upload = True + need_user_for_initialization = True + + label = forms.CharField(label=_(u"Label"), + max_length=200, required=False) + other_reference = forms.CharField( + label=_(u"Other ref."), max_length=200, required=False) + year = forms.IntegerField(label=_("Year"), + initial=lambda: datetime.datetime.now().year, + validators=[validators.MinValueValidator(1900), + validators.MaxValueValidator(2100)]) + treatment_type = forms.MultipleChoiceField( + label=_(u"Treatment type"), choices=[], + widget=widgets.CheckboxSelectMultiple) + target_is_basket = forms.NullBooleanField(label=_(u"Target")) + person = forms.IntegerField( + label=_(u"Responsible"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person'), associated_model=Person, + new=True), + validators=[valid_id(Person)], required=False) + organization = forms.IntegerField( + label=_(u"Organization"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-organization'), + associated_model=Organization, new=True), + validators=[valid_id(Organization)], required=False) + location = forms.IntegerField( + label=_(u"Location"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-warehouse'), associated_model=Warehouse, + new=True), + validators=[valid_id(Warehouse)]) + container = forms.IntegerField( + label=_(u"Container (relevant for packaging)"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-container'), + associated_model=Container, new=True), + validators=[valid_id(Container)], required=False) + external_id = forms.CharField( + label=_(u"External ref."), max_length=200, required=False) + comment = forms.CharField(label=_(u"Comment"), + widget=forms.Textarea, required=False) + description = forms.CharField(label=_(u"Description"), + widget=forms.Textarea, required=False) + goal = forms.CharField(label=_(u"Goal"), + widget=forms.Textarea, required=False) + start_date = forms.DateField(label=_(u"Start date"), required=False, + widget=widgets.JQueryDate) + end_date = forms.DateField(label=_(u"End date"), required=False, + widget=widgets.JQueryDate) + image = forms.ImageField( + label=_(u"Image"), help_text=mark_safe( + _(u"

Heavy images are resized to: %(width)dx%(height)d " + u"(ratio is preserved).

") % { + 'width': settings.IMAGE_MAX_SIZE[0], + 'height': settings.IMAGE_MAX_SIZE[1]}), + max_length=255, required=False, widget=widgets.ImageFileInput()) + + def __init__(self, *args, **kwargs): + user = kwargs.pop('user') + super(BaseTreatmentForm, self).__init__(*args, **kwargs) + q = Person.objects.filter(ishtaruser__pk=user.pk) + if q.count(): + person = q.all()[0] + self.fields['person'].initial = person.pk + if person.attached_to: + self.fields['organization'].initial = person.attached_to.pk + self.fields['target_is_basket'].widget.choices = \ + ((False, _(u"Single find")), (True, _(u"Basket"))) + self.fields['treatment_type'].choices = models.TreatmentType.get_types( + initial=self.init_data.get('treatment_type'), + dct={'upstream_is_many': False, 'downstream_is_many': False}, + empty_first=False + ) + self.fields['treatment_type'].help_text = \ + models.TreatmentType.get_help( + dct={'upstream_is_many': False, 'downstream_is_many': False}) + # TODO + """ + self.fields['basket'].required = False + self.fields['basket'].help_text = \ + _(u"Leave it blank if you want to select a single item") + self.fields.keyOrder.pop(self.fields.keyOrder.index('basket')) + self.fields.keyOrder.insert(self.fields.keyOrder.index('description'), + 'basket') + """ + + def clean(self, *args, **kwargs): + data = self.cleaned_data + packaging = models.TreatmentType.get_cache('packaging') + if not packaging: + logger.warning("No 'packaging' treatment type defined") + return + if data.get('container', None) \ + and str(packaging.pk) not in data.get('treatment_type', []): + raise forms.ValidationError( + _(u"The container field is attached to the treatment. If " + u"no packaging treatment is done it is not relevant.")) + if not data.get('container', None) \ + and str(packaging.pk) in data.get('treatment_type', []): + raise forms.ValidationError( + _(u"If a packaging treatment is done, the container field " + u"must be filled.")) + if not data.get('person', None) and not data.get('organization', None): + raise forms.ValidationError( + _(u"A responsible or an organization must be defined.")) + return data + # TODO + """ + for treatment_type in self.cleaned_data.get('treatment_type', []): + try: + treatment = models.TreatmentType.objects.get( + pk=treatment_type, available=True) + except models.TreatmentType.DoesNotExist: + raise forms.ValidationError(_(u"This treatment type is not " + u"available.")) + if treatment.upstream_is_many and \ + not self.cleaned_data.get('basket'): + raise forms.ValidationError(_(u"This treatment needs a " + u"basket.")) + """ + + +class ModifyTreatmentForm(BaseTreatmentForm): + index = forms.IntegerField(_(u"Index")) + id = forms.IntegerField(' ', widget=forms.HiddenInput, required=False) + + def clean(self, *args, **kwargs): + super(ModifyTreatmentForm, self).clean(*args, **kwargs) + cleaned_data = self.cleaned_data + year = cleaned_data.get('year') + pk = cleaned_data.get('id') + index = cleaned_data.get('index') + q = models.Treatment.objects \ + .filter(year=year, index=index).exclude(pk=pk) + if index and q.count(): + raise forms.ValidationError( + _(u"Another treatment with this index exists for {}." + ).format(year)) + return cleaned_data + + +class TreatmentFormFileChoice(forms.Form): + form_label = _(u"Associated file") + associated_models = {'file': models.TreatmentFile, } + currents = {'file': models.TreatmentFile} + file = forms.IntegerField( + label=_(u"Treatment file"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-treatmentfile'), + associated_model=models.TreatmentFile), + validators=[valid_id(models.TreatmentFile)], required=False) + + +class TreatmentDeletionForm(FinalForm): + confirm_msg = _( + u"Are you sure you want to delete this treatment? All modification " + u"made to the associated finds since this treatment record will be " + u"lost!") + confirm_end_msg = _(u"Would you like to delete this treatment?") + +# administrative act treatment + + +class AdministrativeActTreatmentSelect(TableSelect): + year = forms.IntegerField(label=_("Year")) + index = forms.IntegerField(label=_("Index")) + act_type = forms.ChoiceField(label=_("Act type"), choices=[]) + indexed = forms.NullBooleanField(label=_(u"Indexed?")) + act_object = forms.CharField(label=_(u"Object"), + max_length=300) + + signature_date_after = forms.DateField( + label=_(u"Signature date after"), widget=widgets.JQueryDate) + signature_date_before = forms.DateField( + label=_(u"Signature date before"), widget=widgets.JQueryDate) + treatment__name = forms.CharField( + label=_(u"Treatment name"), max_length=200) + treatment__year = forms.IntegerField(label=_(u"Treatment year")) + treatment__index = forms.IntegerField(label=_(u"Treatment index")) + treatment__internal_reference = forms.CharField( + max_length=200, label=_(u"Treatment internal reference")) + history_modifier = forms.IntegerField( + label=_(u"Modified by"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person', + args=['0', 'user']), + associated_model=Person), + validators=[valid_id(Person)]) + + def __init__(self, *args, **kwargs): + super(AdministrativeActTreatmentSelect, self).__init__(*args, **kwargs) + self.fields['act_type'].choices = ActType.get_types( + dct={'intented_to': 'T'}) + self.fields['act_type'].help_text = ActType.get_help( + dct={'intented_to': 'T'}) + + +class AdministrativeActTreatmentFormSelection( + AdministrativeActOpeFormSelection): + pk = forms.IntegerField( + label="", required=False, + widget=widgets.JQueryJqGrid( + reverse_lazy('get-administrativeacttreatment'), + AdministrativeActTreatmentSelect, AdministrativeAct), + validators=[valid_id(AdministrativeAct)]) + + +class AdministrativeActTreatmentForm(AdministrativeActOpeForm): + act_type = forms.ChoiceField(label=_(u"Act type"), choices=[]) + + def __init__(self, *args, **kwargs): + super(AdministrativeActTreatmentForm, self).__init__(*args, **kwargs) + self.fields['act_type'].choices = ActType.get_types( + initial=self.init_data.get('act_type'), + dct={'intented_to': 'T'}) + self.fields['act_type'].help_text = ActType.get_help( + dct={'intented_to': 'T'}) + + +class AdministrativeActTreatmentModifForm( + AdministrativeActModifForm, AdministrativeActTreatmentForm): + pk = forms.IntegerField(required=False, widget=forms.HiddenInput) + index = forms.IntegerField(label=_("Index"), required=False) + +# treatment files + + +class TreatmentFileSelect(TableSelect): + name = forms.CharField(label=_(u"Name")) + internal_reference = forms.CharField(label=_(u"Internal ref.")) + year = forms.IntegerField(label=_(u"Year")) + index = forms.IntegerField(label=_(u"Index")) + type = forms.ChoiceField(label=_(u"Treatment file type"), choices=[]) + + def __init__(self, *args, **kwargs): + super(TreatmentFileSelect, self).__init__(*args, **kwargs) + self.fields['type'].choices = models.TreatmentFileType.get_types() + self.fields['type'].help_text = models.TreatmentFileType.get_help() + + +class TreatmentFileFormSelection(forms.Form): + form_label = _("Treatment file search") + associated_models = {'pk': models.TreatmentFile} + currents = {'pk': models.TreatmentFile} + pk = forms.IntegerField( + label="", required=False, + widget=widgets.JQueryJqGrid( + reverse_lazy('get-treatmentfile'), + TreatmentFileSelect, models.TreatmentFile), + validators=[valid_id(models.Treatment)]) + + +class TreatmentFileForm(ManageOldType, forms.Form): + form_label = _(u"Treatment file") + base_models = ['treatment_type_type'] + associated_models = {'type': models.TreatmentFileType, + 'in_charge': Person} + need_user_for_initialization = True + + name = forms.CharField(label=_(u"Name"), + max_length=1000, required=False) + internal_reference = forms.CharField( + label=_(u"Internal ref."), max_length=60, required=False) + year = forms.IntegerField(label=_("Year"), + initial=lambda: datetime.datetime.now().year, + validators=[validators.MinValueValidator(1900), + validators.MaxValueValidator(2100)]) + type = forms.ChoiceField( + label=_(u"Treatment file type"), choices=[]) + in_charge = forms.IntegerField( + label=_(u"Responsible"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person'), associated_model=Person, + new=True), + validators=[valid_id(Person)]) + external_id = forms.CharField( + label=_(u"External ref."), max_length=200, required=False) + comment = forms.CharField(label=_(u"Comment"), + widget=forms.Textarea, required=False) + creation_date = forms.DateField(label=_(u"Start date"), required=False, + widget=widgets.JQueryDate, + initial=lambda: datetime.datetime.now()) + reception_date = forms.DateField(label=_(u"Reception date"), required=False, + widget=widgets.JQueryDate, + initial=lambda: datetime.datetime.now()) + end_date = forms.DateField(label=_(u"Closing date"), required=False, + widget=widgets.JQueryDate) + + def __init__(self, *args, **kwargs): + user = kwargs.pop('user') + super(TreatmentFileForm, self).__init__(*args, **kwargs) + q = Person.objects.filter(ishtaruser__pk=user.pk) + if q.count(): + person = q.all()[0] + self.fields['in_charge'].initial = person.pk + self.fields['type'].choices = models.TreatmentFileType.get_types( + initial=[self.init_data.get('type')], empty_first=False + ) + self.fields['type'].help_text = models.TreatmentFileType.get_help() + + +class ModifyTreatmentFileForm(TreatmentFileForm): + index = forms.IntegerField(_(u"Index")) + id = forms.IntegerField(' ', widget=forms.HiddenInput, required=False) + + def clean(self, *args, **kwargs): + super(ModifyTreatmentFileForm, self).clean(*args, **kwargs) + cleaned_data = self.cleaned_data + year = cleaned_data.get('year') + pk = cleaned_data.get('id') + index = cleaned_data.get('index') + q = models.TreatmentFile.objects \ + .filter(year=year, index=index).exclude(pk=pk) + if index and q.count(): + raise forms.ValidationError( + _(u"Another treatment file with this index exists for {}." + ).format(year)) + return cleaned_data + + +class TreatmentFileDeletionForm(FinalForm): + confirm_msg = _(u"Are you sure you want to delete this treatment file?") + confirm_end_msg = _(u"Would you like to delete this treatment file?") + + +class AdministrativeActTreatmentFileSelect(TableSelect): + year = forms.IntegerField(label=_("Year")) + index = forms.IntegerField(label=_("Index")) + act_type = forms.ChoiceField(label=_("Act type"), choices=[]) + indexed = forms.NullBooleanField(label=_(u"Indexed?")) + act_object = forms.CharField(label=_(u"Object"), + max_length=300) + + signature_date_after = forms.DateField( + label=_(u"Signature date after"), widget=widgets.JQueryDate) + signature_date_before = forms.DateField( + label=_(u"Signature date before"), widget=widgets.JQueryDate) + treatment_file__name = forms.CharField( + label=_(u"Treatment file name"), max_length=200) + treatment_file__year = forms.IntegerField(label=_(u"Treatment file year")) + treatment_file__index = forms.IntegerField(label=_(u"Treatment file index")) + treatment_file__internal_reference = forms.CharField( + max_length=200, label=_(u"Treatment file internal reference")) + history_modifier = forms.IntegerField( + label=_(u"Modified by"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-person', + args=['0', 'user']), + associated_model=Person), + validators=[valid_id(Person)]) + + def __init__(self, *args, **kwargs): + super(AdministrativeActTreatmentFileSelect, self).__init__(*args, + **kwargs) + self.fields['act_type'].choices = ActType.get_types( + dct={'intented_to': 'TF'}) + self.fields['act_type'].help_text = ActType.get_help( + dct={'intented_to': 'TF'}) + + +class AdministrativeActTreatmentFileFormSelection( + AdministrativeActOpeFormSelection): + pk = forms.IntegerField( + label="", required=False, + widget=widgets.JQueryJqGrid( + reverse_lazy('get-administrativeacttreatmentfile'), + AdministrativeActTreatmentFileSelect, AdministrativeAct), + validators=[valid_id(AdministrativeAct)]) + + +class AdministrativeActTreatmentFileForm(AdministrativeActOpeForm): + act_type = forms.ChoiceField(label=_(u"Act type"), choices=[]) + + def __init__(self, *args, **kwargs): + super(AdministrativeActTreatmentFileForm, self).__init__(*args, + **kwargs) + self.fields['act_type'].choices = ActType.get_types( + initial=self.init_data.get('act_type'), + dct={'intented_to': 'TF'}) + self.fields['act_type'].help_text = ActType.get_help( + dct={'intented_to': 'TF'}) + + +class AdministrativeActTreatmentFileModifForm( + AdministrativeActModifForm, AdministrativeActTreatmentFileForm): + pk = forms.IntegerField(required=False, widget=forms.HiddenInput) + index = forms.IntegerField(label=_("Index"), required=False) diff --git a/archaeological_finds/ishtar_menu.py b/archaeological_finds/ishtar_menu.py index 7824c94fe..39cc5d910 100644 --- a/archaeological_finds/ishtar_menu.py +++ b/archaeological_finds/ishtar_menu.py @@ -21,6 +21,7 @@ from django.utils.translation import ugettext_lazy as _ from ishtar_common.menu_base import SectionItem, MenuItem +from archaeological_operations.models import AdministrativeAct import models # be carreful: each access_controls must be relevant with check_rights in urls @@ -103,33 +104,60 @@ MENU_SECTIONS = [ ])), (60, SectionItem( - 'treatment_management', _(u"Treatment"), + 'treatmentfle_management', _(u"Treatment file"), profile_restriction='warehouse', childs=[ + MenuItem('treatmentfle_search', + _(u"Search"), + model=models.TreatmentFile, + access_controls=['view_find', + 'view_own_find']), + MenuItem('treatmentfle_creation', + _(u"Creation"), + model=models.TreatmentFile, + access_controls=['change_find', + 'change_own_find']), + MenuItem('treatmentfle_modification', + _(u"Modification"), + model=models.TreatmentFile, + access_controls=['change_find', + 'change_own_find']), + MenuItem('treatmentfle_deletion', + _(u"Deletion"), + model=models.TreatmentFile, + access_controls=['change_find', + 'change_own_find']), SectionItem( - 'find_treatmentfiles', _(u"Treatment Files"), + 'admin_act_fletreatments', _(u"Administrative act"), childs=[ - MenuItem('treatmentfle_search', + MenuItem('treatmentfle_admacttreatmentfle_search', _(u"Search"), - model=models.TreatmentFile, - access_controls=['view_find', - 'view_own_find']), - MenuItem('treatmentfle_creation', + model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatmentfle_admacttreatmentfle', _(u"Creation"), - model=models.TreatmentFile, - access_controls=['change_find', - 'change_own_find']), - MenuItem('treatmentfle_modification', - _(u"Modification"), - model=models.TreatmentFile, - access_controls=['change_find', - 'change_own_find']), - MenuItem('treatmentfle_deletion', + model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatmentfle_admacttreatmentfle_modification', + _(u"Modification"), model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatmentfle_admacttreatmentfle_deletion', _(u"Deletion"), - model=models.TreatmentFile, - access_controls=['change_find', - 'change_own_find']), - ]), + model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatmentfle_administrativeact_document', + _(u"Documents"), + model=AdministrativeAct, + access_controls=['change_administrativeact']), + ] + ) + ] + )), + (70, + SectionItem( + 'treatment_management', _(u"Treatment"), + profile_restriction='warehouse', + childs=[ SectionItem( 'find_treatments', _(u"Simple treatments"), childs=[ @@ -154,6 +182,31 @@ MENU_SECTIONS = [ access_controls=['change_find', 'change_own_find']), ]), - ] + SectionItem( + 'admin_act_treatments', _(u"Administrative act"), + childs=[ + MenuItem('treatment_admacttreatment_search', + _(u"Search"), + model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatment_admacttreatment', + _(u"Creation"), + model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem( + 'treatment_admacttreatment_modification', + _(u"Modification"), model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatment_admacttreatment_deletion', + _(u"Deletion"), + model=AdministrativeAct, + access_controls=['change_administrativeact']), + MenuItem('treatment_admacttreatment_document', + _(u"Documents"), + model=AdministrativeAct, + access_controls=['change_administrativeact']), + ] + ) + ] )), ] diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index c780b14fb..120fa1ed0 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -88,20 +88,65 @@ urlpatterns = patterns( url(r'^find_basket_deletion/$', check_rights(['change_find', 'change_own_find'])( views.DeleteFindBasketView.as_view()), name='delete_findbasket'), - url(r'treatment_creation/(?P.+)?$', + url(r'^treatment_creation/(?P.+)?$', check_rights(['change_find', 'change_own_find'])( views.treatment_creation_wizard), name='treatment_creation'), - url(r'treatment_modification/(?P.+)?$', + url(r'^treatment_modification/(?P.+)?$', check_rights(['change_find', 'change_own_find'])( views.treatment_modification_wizard), name='treatment_modification'), - url(r'treatment_search/(?P.+)?$', + url(r'^treatment_search/(?P.+)?$', check_rights(['view_find', 'view_own_find'])( views.treatment_search_wizard), name='treatment_search'), url(r'^treatment_deletion/(?P.+)?$', check_rights(['change_find', 'change_own_find'])( views.treatment_deletion_wizard), name='treatment_deletion'), - url(r'treatmentfle_search/(?P.+)?$', + + url(r'^treatment_admacttreatment_search/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatment_administrativeact_search_wizard), + name='treatment_admacttreatment_search'), + url(r'^treatment_admacttreatment/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatment_administrativeact_wizard), + name='treatment_admacttreatment'), + url(r'^treatment_admacttreatment_modification/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatment_administrativeact_modification_wizard), + name='treatment_admacttreatment_modification'), + url(r'^treatment_administrativeacttreatment_modify/(?P.+)/$', + views.treatment_administrativeacttreatment_modify, + name='treatment_administrativeacttreatment_modify'), + url(r'^treatment_admacttreatment_deletion/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatment_admacttreatment_deletion_wizard), + name='treatment_admacttreatment_deletion'), + url(r'^get-administrativeacttreatment/(?P.+)?$', + views.get_administrativeacttreatment, + name='get-administrativeacttreatment'), + + url(r'^treatmentfle_admacttreatmentfle_search/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatmentfile_admacttreatmentfile_search_wizard), + name='treatmentfle_admacttreatmentfle_search'), + url(r'^treatmentfle_admacttreatmentfle_modification/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatmentfile_admacttreatmentfile_modification_wizard), + name='treatmentfle_admacttreatmentfle_modification'), + url(r'^treatmentfle_admacttreatmentfle/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatmentfile_admacttreatmentfile_wizard), + name='treatmentfle_admacttreatmentfle'), + url(r'^treatmentfile_administrativeacttreatmentfile_modify/(?P.+)/$', + views.treatmentfile_administrativeacttreatmentfile_modify, + name='treatmentfile_administrativeacttreatmentfile_modify'), + url(r'^treatmentfle_admacttreatmentfle_deletion/(?P.+)?$', + check_rights(['change_administrativeact'])( + views.treatmentfile_admacttreatmentfile_deletion_wizard), + name='treatmentfle_admacttreatmentfle_deletion'), + + + url(r'^treatmentfle_search/(?P.+)?$', check_rights(['change_find', 'change_own_find'])( views.treatmentfile_search_wizard), name='treatmentfile_search'), @@ -117,6 +162,9 @@ urlpatterns = patterns( check_rights(['change_find', 'change_own_find'])( views.treatmentfile_deletion_wizard), name='treatmentfile_deletion'), + url(r'get-administrativeacttreatmentfile/(?P.+)?$', + views.get_administrativeacttreatmentfile, + name='get-administrativeacttreatmentfile'), url(r'get-upstreamtreatment/(?P.+)?$', views.get_upstreamtreatment, name='get-upstreamtreatment'), url(r'get-downstreamtreatment/(?P.+)?$', diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 1b08e9853..35c7d5976 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -28,16 +28,21 @@ from django.utils.translation import ugettext_lazy as _ from django.views.generic import TemplateView from django.views.generic.edit import CreateView, FormView +from ishtar_common.models import IshtarUser +from archaeological_operations.models import AdministrativeAct + from ishtar_common.forms import FinalForm from ishtar_common.forms_common import SourceForm, AuthorFormset, \ SourceDeletionForm -from ishtar_common.models import IshtarUser +from archaeological_operations.forms import FinalAdministrativeActDeleteForm from archaeological_context_records.forms \ import RecordFormSelection as RecordFormSelectionTable from ishtar_common.views import get_item, show_item, revert_item, \ get_autocomplete_generic, IshtarMixin, LoginRequiredMixin + from ishtar_common.wizards import SearchWizard +from archaeological_operations.wizards import AdministrativeActDeletionWizard from wizards import * from forms import * @@ -55,10 +60,20 @@ get_find_for_treatment = get_item( show_treatment = show_item(models.Treatment, 'treatment') get_treatment = get_item(models.Treatment, 'get_treatement', 'treatment') +get_administrativeacttreatment = get_item( + AdministrativeAct, 'get_administrativeacttreatment', + 'administrativeacttreatment', + base_request={"treatment__pk__isnull": False}) + show_treatmentfile = show_item(models.TreatmentFile, 'treatmentfile') get_treatmentfile = get_item(models.TreatmentFile, 'get_treatementfile', 'treatmentfile') +get_administrativeacttreatmentfile = get_item( + AdministrativeAct, 'get_administrativeacttreatmentfile', + 'administrativeacttreatmentfile', + base_request={"treatment_file__pk__isnull": False}) + def autocomplete_treatmentfile(request): if not request.user.has_perm('ishtar_common.view_treatment', @@ -375,6 +390,59 @@ treatment_deletion_wizard = TreatmentDeletionWizard.as_view([ label=_(u"Treatment deletion"), url_name='treatment_deletion',) +treatment_administrativeact_search_wizard = \ + SearchWizard.as_view([ + ('selec-treatment_admacttreatment_search', + AdministrativeActTreatmentFormSelection)], + label=_(u"Treatment: search administrative act"), + url_name='treatment_admacttreatment_search',) + +treatment_administrativeact_wizard = \ + TreatmentAdministrativeActWizard.as_view([ + ('selec-treatment_admacttreatment', TreatmentFormSelection), + ('administrativeact-treatment_admacttreatment', + AdministrativeActTreatmentForm), + ('final-treatment_admacttreatment', FinalForm)], + label=_(u"Treatment: new administrative act"), + url_name='treatment_admacttreatment',) + +treatment_administrativeact_modification_wizard = \ + TreatmentEditAdministrativeActWizard.as_view([ + ('selec-treatment_admacttreatment_modification', + AdministrativeActTreatmentFormSelection), + ('administrativeact-treatment_admacttreatment_modification', + AdministrativeActTreatmentModifForm), + ('final-treatment_admacttreatment_modification', FinalForm)], + label=_(u"Treatment: administrative act modification"), + url_name='treatment_admacttreatment_modification',) + +treatment_admacttreatment_deletion_wizard = \ + AdministrativeActDeletionWizard.as_view([ + ('selec-treatment_admacttreatment_deletion', + AdministrativeActTreatmentFormSelection), + ('final-treatment_admacttreatment_deletion', + FinalAdministrativeActDeleteForm)], + label=_(u"Treatment: administrative act deletion"), + url_name='treatment_admacttreatment_deletion',) + + +def treatment_administrativeacttreatment_modify(request, pk): + treatment_administrativeact_modification_wizard(request) + TreatmentEditAdministrativeActWizard.session_set_value( + request, + 'selec-treatment_admacttreatment_modification', + 'pk', pk, reset=True) + return redirect( + reverse( + 'treatment_admacttreatment_modification', + kwargs={ + 'step': + 'administrativeact-treatment_admacttreatment_modification' + })) + + +# treatment file + treatmentfile_search_wizard = SearchWizard.as_view([ ('general-treatmentfile_search', TreatmentFileFormSelection)], label=_(u"Treatment file search"), @@ -404,6 +472,57 @@ treatmentfile_deletion_wizard = TreatmentFileDeletionWizard.as_view([ label=_(u"Treatment file deletion"), url_name='treatmentfile_deletion',) +treatmentfile_admacttreatmentfile_search_wizard = \ + SearchWizard.as_view([ + ('selec-treatmentfle_admacttreatmentfle_search', + AdministrativeActTreatmentFileFormSelection)], + label=_(u"Treatment file: search administrative act"), + url_name='treatmentfle_admacttreatmentfle_search',) + + +treatmentfile_admacttreatmentfile_wizard = \ + TreatmentFileAdministrativeActWizard.as_view([ + ('selec-treatmentfle_admacttreatmentfle', TreatmentFileFormSelection), + ('admact-treatmentfle_admacttreatmentfle', + AdministrativeActTreatmentFileForm), + ('final-treatmentfle_admacttreatmentfle', FinalForm)], + label=_(u"Treatment file: new administrative act"), + url_name='treatmentfle_admacttreatmentfle',) + +treatmentfile_admacttreatmentfile_modification_wizard = \ + TreatmentFileEditAdministrativeActWizard.as_view([ + ('selec-treatmentfle_admacttreatmentfle_modification', + AdministrativeActTreatmentFileFormSelection), + ('admact-treatmentfle_admacttreatmentfle_modification', + AdministrativeActTreatmentFileModifForm), + ('final-treatmentfle_admacttreatmentfle_modification', FinalForm)], + label=_(u"Treatment file: administrative act modification"), + url_name='treatmentfle_admacttreatmentfle_modification',) + +treatmentfile_admacttreatmentfile_deletion_wizard = \ + AdministrativeActDeletionWizard.as_view([ + ('selec-treatmentfle_admacttreatmentfle_deletion', + AdministrativeActTreatmentFileFormSelection), + ('final-treatmentfle_admacttreatmentfle_deletion', + FinalAdministrativeActDeleteForm)], + label=_(u"Treatment file: administrative act deletion"), + url_name='treatmentfle_admacttreatmentfle_deletion',) + + +def treatmentfile_administrativeacttreatmentfile_modify(request, pk): + treatmentfile_admacttreatmentfile_modification_wizard(request) + TreatmentFileEditAdministrativeActWizard.session_set_value( + request, + 'selec-treatmentfle_admacttreatmentfle_modification', + 'pk', pk, reset=True) + return redirect( + reverse( + 'treatmentfle_admacttreatmentfle_modification', + kwargs={ + 'step': + 'admact-treatmentfle_admacttreatmentfle_modification' + })) + """ treatment_source_creation_wizard = TreatmentSourceWizard.as_view([ ('selec-treatment_source_creation', SourceTreatmentFormSelection), diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py index eb838eb66..f5f43f1e6 100644 --- a/archaeological_finds/wizards.py +++ b/archaeological_finds/wizards.py @@ -22,6 +22,9 @@ from django.utils.translation import ugettext_lazy as _ from ishtar_common.forms import reverse_lazy from ishtar_common.wizards import Wizard, DeletionWizard, SourceWizard +from archaeological_operations.wizards import OperationAdministrativeActWizard + +from archaeological_operations.models import AdministrativeAct import models @@ -129,6 +132,23 @@ class TreatmentDeletionWizard(DeletionWizard): 'goal', 'start_date', 'end_date', 'container'] +class TreatmentAdministrativeActWizard(OperationAdministrativeActWizard): + model = models.Treatment + current_obj_slug = 'administrativeacttreatment' + ref_object_key = 'treatment' + + def get_reminder(self): + return + + +class TreatmentEditAdministrativeActWizard(TreatmentAdministrativeActWizard): + model = AdministrativeAct + edit = True + + def get_associated_item(self, dct): + return self.get_current_object().treatment + + class TreatmentFileWizard(Wizard): model = models.TreatmentFile wizard_done_window = reverse_lazy('show-treatmentfile') @@ -145,6 +165,46 @@ class TreatmentFileDeletionWizard(DeletionWizard): 'creation_date', 'end_date', 'comment'] +class TreatmentFileAdministrativeActWizard( + OperationAdministrativeActWizard): + model = models.TreatmentFile + current_obj_slug = 'administrativeacttreatmentfile' + ref_object_key = 'treatment_file' + + def get_reminder(self): + form_key = 'selec-' + self.url_name + if self.url_name.endswith('_administrativeactop'): + # modification and deletion are suffixed with '_modification' + # and '_deletion' so it is creation + pk = self.session_get_value(form_key, "pk") + try: + return ( + (_(u"Treatment file"), + unicode(models.Operation.objects.get(pk=pk))), + ) + except models.TreatmentFile.DoesNotExist: + return + else: + admin_id = self.session_get_value(form_key, "pk") + try: + admin = AdministrativeAct.objects.get(pk=admin_id) + if not admin.operation: + return + return ((_(u"Operation"), unicode(admin.operation)),) + except AdministrativeAct.DoesNotExist: + return + return + + +class TreatmentFileEditAdministrativeActWizard( + TreatmentFileAdministrativeActWizard): + model = AdministrativeAct + edit = True + + def get_associated_item(self, dct): + return self.get_current_object().treatment_file + + class FindSourceWizard(SourceWizard): wizard_done_window = reverse_lazy('show-findsource') model = models.FindSource diff --git a/archaeological_operations/admin.py b/archaeological_operations/admin.py index 47ab8419b..b97df85eb 100644 --- a/archaeological_operations/admin.py +++ b/archaeological_operations/admin.py @@ -100,7 +100,15 @@ class RelationTypeAdmin(admin.ModelAdmin): admin.site.register(models.RelationType, RelationTypeAdmin) -general_models = [models.RemainType, models.ActType, models.ReportState] + +class ActTypeAdmin(GeneralTypeAdmin): + list_filter = ('intented_to',) + list_display = ['label', 'txt_idx', 'available', 'intented_to'] + + +admin.site.register(models.ActType, ActTypeAdmin) + +general_models = [models.RemainType, models.ReportState] for model in general_models: admin.site.register(model, GeneralTypeAdmin) diff --git a/archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py b/archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py new file mode 100644 index 000000000..671de79ec --- /dev/null +++ b/archaeological_operations/migrations/0063_auto__add_field_administrativeact_treatment_file__add_field_administra.py @@ -0,0 +1,822 @@ +# -*- 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 field 'AdministrativeAct.treatment_file' + db.add_column('archaeological_operations_administrativeact', 'treatment_file', + self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='administrative_act', null=True, to=orm['archaeological_finds.TreatmentFile']), + keep_default=False) + + # Adding field 'AdministrativeAct.treatment' + db.add_column('archaeological_operations_administrativeact', 'treatment', + self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='administrative_act', null=True, to=orm['archaeological_finds.Treatment']), + keep_default=False) + + + # Changing field 'ActType.intented_to' + db.alter_column('archaeological_operations_acttype', 'intented_to', self.gf('django.db.models.fields.CharField')(max_length=2)) + # Adding field 'HistoricalAdministrativeAct.treatment_file_id' + db.add_column('archaeological_operations_historicaladministrativeact', 'treatment_file_id', + self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True), + keep_default=False) + + # Adding field 'HistoricalAdministrativeAct.treatment_id' + db.add_column('archaeological_operations_historicaladministrativeact', 'treatment_id', + self.gf('django.db.models.fields.IntegerField')(db_index=True, null=True, blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'AdministrativeAct.treatment_file' + db.delete_column('archaeological_operations_administrativeact', 'treatment_file_id') + + # Deleting field 'AdministrativeAct.treatment' + db.delete_column('archaeological_operations_administrativeact', 'treatment_id') + + + # Changing field 'ActType.intented_to' + db.alter_column('archaeological_operations_acttype', 'intented_to', self.gf('django.db.models.fields.CharField')(max_length=1)) + # Deleting field 'HistoricalAdministrativeAct.treatment_file_id' + db.delete_column('archaeological_operations_historicaladministrativeact', 'treatment_file_id') + + # Deleting field 'HistoricalAdministrativeAct.treatment_id' + db.delete_column('archaeological_operations_historicaladministrativeact', 'treatment_id') + + + models = { + 'archaeological_files.file': { + 'Meta': {'ordering': "('cached_label',)", 'object_name': 'File'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'cira_advised': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'classified_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'corporation_general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), + 'departments': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '120', 'null': 'True', 'blank': 'True'}), + 'file_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.FileType']"}), + 'general_contractor': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'general_contractor_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imported_line': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_files_file'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'instruction_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '60', 'null': 'True', 'blank': 'True'}), + 'locality': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'main_town': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'file_main'", 'null': 'True', 'to': "orm['ishtar_common.Town']"}), + 'mh_listing': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'mh_register': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'numeric_reference': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'permit_reference': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'permit_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.PermitType']", 'null': 'True', 'blank': 'True'}), + 'planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'protected_area': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'raw_general_contractor': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'raw_town_planning_service': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'related_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.File']", 'null': 'True', 'blank': 'True'}), + 'requested_operation_type': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['ishtar_common.OperationType']"}), + 'research_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'responsible_town_planning_service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'responsible_town_planning_service_files'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'saisine_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_files.SaisineType']", 'null': 'True', 'blank': 'True'}), + 'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'total_developed_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), + 'total_surface': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), + 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'file'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), + 'year': ('django.db.models.fields.IntegerField', [], {'default': '2016'}) + }, + 'archaeological_files.filetype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'FileType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_files.permittype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'PermitType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_files.saisinetype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'SaisineType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'delay': ('django.db.models.fields.IntegerField', [], {'default': '30'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_finds.treatment': { + 'Meta': {'unique_together': "(('year', 'index'),)", 'object_name': 'Treatment'}, + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']", 'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), + 'goal': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatment'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']", 'null': 'True', 'blank': 'True'}), + 'organization': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'other_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'person': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatments'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'target_is_basket': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'treatment_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_finds.TreatmentType']", 'symmetrical': 'False'}), + 'year': ('django.db.models.fields.IntegerField', [], {'default': '2016'}) + }, + 'archaeological_finds.treatmentfile': { + 'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('year', 'index'),)", 'object_name': 'TreatmentFile'}, + 'cached_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today', 'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_finds_treatmentfile'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'treatmentfile_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'index': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'reception_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_finds.TreatmentFileType']"}), + 'year': ('django.db.models.fields.IntegerField', [], {'default': '2016'}) + }, + 'archaeological_finds.treatmentfiletype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentFileType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_finds.treatmenttype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'TreatmentType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'downstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), + 'upstream_is_many': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'virtual': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + 'archaeological_operations.acttype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'ActType'}, + 'associated_template': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'acttypes'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.DocumentTemplate']"}), + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'indexed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'intented_to': ('django.db.models.fields.CharField', [], {'max_length': '2'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_operations.administrativeact': { + 'Meta': {'ordering': "('year', 'signature_date', 'index', 'act_type')", 'object_name': 'AdministrativeAct'}, + 'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'act_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ActType']"}), + 'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), + 'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_administrativeact'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operation_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), + 'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'adminact_scientist'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'signatory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'signatory'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'treatment': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.Treatment']"}), + 'treatment_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'administrative_act'", 'null': 'True', 'to': "orm['archaeological_finds.TreatmentFile']"}), + 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_operations.archaeologicalsite': { + 'Meta': {'object_name': 'ArchaeologicalSite'}, + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_archaeologicalsite'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'}), + 'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}) + }, + 'archaeological_operations.historicaladministrativeact': { + 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalAdministrativeAct'}, + 'act_object': ('django.db.models.fields.TextField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'act_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'departments_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), + 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), + 'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'operation_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'ref_sra': ('django.db.models.fields.CharField', [], {'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'scientist_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'signatory_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'signature_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'towns_label': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'treatment_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'treatment_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_operations.historicaloperation': { + 'Meta': {'ordering': "('-history_date', '-history_id')", 'object_name': 'HistoricalOperation'}, + 'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'associated_file_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'cira_rapporteur_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'code_patriarche': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), + 'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), + 'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'history_creator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'history_id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'history_modifier_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'history_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'history_user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), + 'id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'blank': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'in_charge_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), + 'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'operation_type_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'operator_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), + 'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), + 'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'report_processing_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'scientist_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}), + 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_operations.operation': { + 'Meta': {'ordering': "('cached_label',)", 'object_name': 'Operation'}, + 'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'archaeological_sites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.ArchaeologicalSite']", 'null': 'True', 'blank': 'True'}), + 'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operations'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), + 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'cira_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'cira_rapporteur': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cira_rapporteur'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'code_patriarche': ('django.db.models.fields.IntegerField', [], {'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'common_name': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}), + 'documentation_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'documentation_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'eas_number': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'effective_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'excavation_end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'finds_deadline': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'finds_received': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'fnap_cost': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'fnap_financing': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}), + 'geoarchaeological_context_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_operation'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'large_area_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'multi_polygon': ('django.contrib.gis.db.models.fields.MultiPolygonField', [], {'null': 'True', 'blank': 'True'}), + 'negative_result': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'old_code': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'operation_code': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'operation_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['ishtar_common.OperationType']"}), + 'operator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operator'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'operator_reference': ('django.db.models.fields.CharField', [], {'max_length': '20', 'null': 'True', 'blank': 'True'}), + 'optional_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'periods': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), + 'point': ('django.contrib.gis.db.models.fields.PointField', [], {'null': 'True', 'blank': 'True'}), + 'record_quality': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}), + 'remains': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['archaeological_operations.RemainType']", 'null': 'True', 'blank': 'True'}), + 'report_delivery_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'report_processing': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.ReportState']", 'null': 'True', 'blank': 'True'}), + 'scheduled_man_days': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'scientific_documentation_comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'scientist': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'operation_scientist_responsability'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'towns': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operations'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Town']"}), + 'virtual_operation': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'zoning_prescription': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_operations.operationbydepartment': { + 'Meta': {'object_name': 'OperationByDepartment', 'db_table': "'operation_department'", 'managed': 'False'}, + 'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'operation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Operation']"}) + }, + 'archaeological_operations.operationsource': { + 'Meta': {'object_name': 'OperationSource'}, + 'additional_information': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'associated_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'operationsource_related'", 'symmetrical': 'False', 'to': "orm['ishtar_common.Author']"}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'duplicate': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True', 'blank': 'True'}), + 'format_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Format']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'index': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'internal_reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'item_number': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'operation': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'source'", 'to': "orm['archaeological_operations.Operation']"}), + 'receipt_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'receipt_date_in_documentation': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'scale': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'source_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SourceType']"}), + 'support_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.SupportType']", 'null': 'True', 'blank': 'True'}), + 'thumbnail': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '300'}) + }, + 'archaeological_operations.operationtypeold': { + 'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationTypeOld'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_operations.parcel': { + 'Meta': {'ordering': "('year', 'section', 'parcel_number')", 'object_name': 'Parcel'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_files.File']"}), + 'auto_external_id': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcel'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'operation': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'parcels'", 'null': 'True', 'to': "orm['archaeological_operations.Operation']"}), + 'parcel_number': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), + 'public_domain': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'section': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcels'", 'to': "orm['ishtar_common.Town']"}), + 'year': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_operations.parcelowner': { + 'Meta': {'object_name': 'ParcelOwner'}, + 'end_date': ('django.db.models.fields.DateField', [], {}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_operations_parcelowner'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'parcel_owner'", 'to': "orm['ishtar_common.Person']"}), + 'parcel': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'owners'", 'to': "orm['archaeological_operations.Parcel']"}), + 'start_date': ('django.db.models.fields.DateField', [], {}) + }, + 'archaeological_operations.period': { + 'Meta': {'ordering': "('order',)", 'object_name': 'Period'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.IntegerField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'order': ('django.db.models.fields.IntegerField', [], {}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.Period']", 'null': 'True', 'blank': 'True'}), + 'start_date': ('django.db.models.fields.IntegerField', [], {}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_operations.recordrelations': { + 'Meta': {'ordering': "('left_record', 'relation_type')", 'object_name': 'RecordRelations'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'left_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'right_relations'", 'to': "orm['archaeological_operations.Operation']"}), + 'relation_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.RelationType']"}), + 'right_record': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'left_relations'", 'to': "orm['archaeological_operations.Operation']"}) + }, + 'archaeological_operations.relationtype': { + 'Meta': {'ordering': "('order', 'label')", 'object_name': 'RelationType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'inverse_relation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_operations.RelationType']", 'null': 'True', 'blank': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'symmetrical': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'tiny_label': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_operations.remaintype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'RemainType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_operations.reportstate': { + 'Meta': {'ordering': "('order',)", 'object_name': 'ReportState'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'order': ('django.db.models.fields.IntegerField', [], {}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_warehouse.container': { + 'Meta': {'object_name': 'Container'}, + 'comment': ('django.db.models.fields.TextField', [], {}), + 'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) + }, + 'archaeological_warehouse.containertype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'ContainerType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), + 'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_warehouse.warehouse': { + 'Meta': {'object_name': 'Warehouse'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_warehouse'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'warehouse_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) + }, + 'archaeological_warehouse.warehousetype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'WarehouseType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'ishtar_common.arrondissement': { + 'Meta': {'object_name': 'Arrondissement'}, + 'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) + }, + 'ishtar_common.author': { + 'Meta': {'object_name': 'Author'}, + 'author_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.AuthorType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'author'", 'to': "orm['ishtar_common.Person']"}) + }, + 'ishtar_common.authortype': { + 'Meta': {'object_name': 'AuthorType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.canton': { + 'Meta': {'object_name': 'Canton'}, + 'arrondissement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Arrondissement']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}) + }, + 'ishtar_common.department': { + 'Meta': {'ordering': "['number']", 'object_name': 'Department'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), + 'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}), + 'state': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.State']", 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.documenttemplate': { + 'Meta': {'ordering': "['associated_object_name', 'name']", 'object_name': 'DocumentTemplate'}, + 'associated_object_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'template': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) + }, + 'ishtar_common.format': { + 'Meta': {'object_name': 'Format'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.import': { + 'Meta': {'object_name': 'Import'}, + 'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), + 'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), + 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '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'}), + 'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), + 'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) + }, + 'ishtar_common.importertype': { + 'Meta': {'object_name': 'ImporterType'}, + 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.ishtaruser': { + 'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, + 'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), + 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'ishtar_common.operationtype': { + 'Meta': {'ordering': "['-preventive', 'order', 'label']", 'object_name': 'OperationType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'preventive': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.organization': { + 'Meta': {'object_name': 'Organization'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), + 'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), + 'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), + 'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.organizationtype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.person': { + 'Meta': {'object_name': 'Person'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), + 'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), + 'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.persontype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.sourcetype': { + 'Meta': {'object_name': 'SourceType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.state': { + 'Meta': {'ordering': "['number']", 'object_name': 'State'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '30'}), + 'number': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}) + }, + 'ishtar_common.supporttype': { + 'Meta': {'object_name': 'SupportType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.titletype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.town': { + 'Meta': {'ordering': "['numero_insee']", 'object_name': 'Town'}, + 'canton': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Canton']", 'null': 'True', 'blank': 'True'}), + 'center': ('django.contrib.gis.db.models.fields.PointField', [], {'srid': '27572', 'null': 'True', 'blank': 'True'}), + 'departement': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.Department']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_town'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'numero_insee': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6'}), + 'surface': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['archaeological_operations'] \ No newline at end of file diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index c54a060cb..307d02e97 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -882,8 +882,10 @@ class OperationSource(Source): class ActType(GeneralType): TYPE = (('F', _(u'Archaeological file')), ('O', _(u'Operation')), + ('TF', _(u'Treatment file')), + ('T', _(u'Treatment')), ) - intented_to = models.CharField(_(u"Intended to"), max_length=1, + intented_to = models.CharField(_(u"Intended to"), max_length=2, choices=TYPE) code = models.CharField(_(u"Code"), max_length=10, blank=True, null=True) associated_template = models.ManyToManyField( @@ -988,6 +990,16 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): blank=True, null=True, related_name='administrative_act', verbose_name=_(u"Archaeological file")) + treatment_file = models.ForeignKey( + 'archaeological_finds.TreatmentFile', + blank=True, null=True, + related_name='administrative_act', + verbose_name=_(u"Treatment file")) + treatment = models.ForeignKey( + 'archaeological_finds.Treatment', + blank=True, null=True, + related_name='administrative_act', + verbose_name=_(u"Treatment")) signature_date = models.DateField(_(u"Signature date"), blank=True, null=True) year = models.IntegerField(_(u"Year"), blank=True, null=True) diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html index 57acf9cbe..c96d216c9 100644 --- a/archaeological_operations/templates/ishtar/sheet_administrativeact.html +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html @@ -1,32 +1,46 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_header %} +{% load i18n window_header window_field %} {% block head_title %}{% trans "Administrative act" %}{% endblock %} {% block content %} {% if item.operation %} {% window_nav item window_id 'show-administrativeact' 'operation_administrativeactop_modify' %} -{% else %} +{% endif %} +{% if item.associated_file %} {% window_nav item window_id 'show-administrativeact' 'file_administrativeactfile_modify' %} {% endif %} +{% if item.treatment %} +{% window_nav item window_id 'show-administrativeact' 'treatment_administrativeacttreatment_modify' %} +{% endif %} +{% if item.treatment_file %} +{% window_nav item window_id 'show-administrativeact' 'treatmentfile_administrativeacttreatmentfile_modify' %} +{% endif %}

{% trans "General"%}

-

{{ item.year }}

-{% if item.index %}

{{ item.index }}

{% endif %} -{% if item.ref_sra %}

{{ item.ref_sra }}

{% endif %} -

{{ item.act_type }}

-{% if item.act_object %}

{{ item.act_object }}

{% endif %} -

{{ item.signature_date }}

-

{{ item.in_charge.full_label }}

-{% if item.operator %}

{{ item.operator }}

{% endif %} - -{% if item.associated_file %}

{{ item.associated_file }}

{% endif %} -{% if item.operation %}

{{ item.operation }}

{% endif %} +
    + {% field_li "Year" item.year %} + {% field_li "Index" item.index %} + {% field_li "Internal reference" item.ref_sra %} + {% field_li "Type" item.act_type %} + {% field_li "Object" item.act_object %} + {% field_li "Signature date" item.signature_date %} + {% field_li "In charge" item.in_charge %} + {% field_li "Archaeological preventive operator" item.operator %} + {% field_li_detail "Associated file" item.associated_file %} + {% field_li_detail "Operation" item.operation %} + {% field_li_detail "Treatment" item.treatment %} + {% field_li_detail "Treatment file" item.treatment_file %} -{% if item.operation %}{% if item.operation.surface %}

    {{ item.operation.surface }} m2 ({{ item.operation.surface_ha }} ha)

    {%endif%} {% endif %} -

    {{ item.history_creator.ishtaruser.full_label }}

    -{%comment%}{% if item.general_contractor.attached_to %}

    {{ item.general_contractor.attached_to }}

    {% endif %} + {% if item.operation and item.operation.surface %} +
  • {{ item.operation.surface }} m2 ({{ item.operation.surface_ha }} ha)
  • + {% endif %} + {% field_li "Created by" item.history_creator.ishtaruser %} +{% comment %}{% if item.general_contractor.attached_to %}

    + + {{ item.general_contractor.attached_to }}

    {% endif %} {% if item.general_contractor %}

    {{ item.general_contractor.full_label }}

    {% endif %} -{%endcomment%} +{% endcomment %} +
{% endblock %} diff --git a/archaeological_operations/urls.py b/archaeological_operations/urls.py index aca98d4c4..710bc5e24 100644 --- a/archaeological_operations/urls.py +++ b/archaeological_operations/urls.py @@ -128,9 +128,13 @@ urlpatterns += patterns( # allow specialization for operations url(r'show-administrativeact(?:/(?P.+))?/(?P.+)?$', 'show_administrativeact', name='show-administrativeactop'), - # allow specialization for files + # allow specialization for files, treatment, treatment file url(r'show-administrativeact(?:/(?P.+))?/(?P.+)?$', 'show_administrativeact', name='show-administrativeactfile'), + url(r'show-administrativeact(?:/(?P.+))?/(?P.+)?$', + 'show_administrativeact', name='show-administrativeacttreatment'), + url(r'show-administrativeact(?:/(?P.+))?/(?P.+)?$', + 'show_administrativeact', name='show-administrativeacttreatmentfile'), url(r'generatedoc-administrativeactop/(?P.+)?/(?P.+)?$', 'generatedoc_administrativeactop', name='generatedoc-administrativeactop'), diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py index ece14d1d2..94aafb87c 100644 --- a/archaeological_operations/wizards.py +++ b/archaeological_operations/wizards.py @@ -17,6 +17,8 @@ # See the file COPYING for details. +import logging + from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse @@ -33,6 +35,8 @@ from forms import GenerateDocForm from archaeological_files.models import File +logger = logging.getLogger(__name__) + class OperationWizard(Wizard): model = models.Operation @@ -327,6 +331,7 @@ class OperationAdministrativeActWizard(OperationWizard): edit = False wizard_done_window = reverse_lazy('show-administrativeact') current_obj_slug = 'administrativeactop' + ref_object_key = 'operation' def get_reminder(self): form_key = 'selec-' + self.url_name @@ -389,11 +394,9 @@ class OperationAdministrativeActWizard(OperationWizard): else: associated_item = self.get_associated_item(dct) if not associated_item: + logger.warning("Admin act save: no associated model") return self.render(form_list[-1]) - if isinstance(associated_item, File): - dct['associated_file'] = associated_item - elif isinstance(associated_item, models.Operation): - dct['operation'] = associated_item + dct[self.ref_object_key] = associated_item admact = models.AdministrativeAct(**dct) admact.save() dct['item'] = admact diff --git a/archaeological_warehouse/ishtar_menu.py b/archaeological_warehouse/ishtar_menu.py index 1844b0018..c69ad760d 100644 --- a/archaeological_warehouse/ishtar_menu.py +++ b/archaeological_warehouse/ishtar_menu.py @@ -27,7 +27,7 @@ from archaeological_finds.models import Treatment MENU_SECTIONS = [ - (60, SectionItem('treatment_management', _(u"Treatment"), + (70, SectionItem('treatment_management', _(u"Treatment"), profile_restriction='warehouse', childs=[ MenuItem('warehouse_packaging', _(u"Packaging"), diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 25fa73132..d4f0c595e 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -413,6 +413,8 @@ class GeneralType(Cached, models.Model): new_vals = [] if not initial: return [] + if type(initial) not in (list, tuple): + initial = [initial] for value in initial: try: pk = int(value) @@ -486,7 +488,10 @@ class GeneralType(Cached, models.Model): pass items = cls.objects.filter(**dct) if default and default != "None": - exclude.append(default.txt_idx) + if hasattr(default, 'txt_idx'): + exclude.append(default.txt_idx) + else: + exclude.append(default) if exclude: items = items.exclude(txt_idx__in=exclude) for item in items.order_by(*cls._meta.ordering).all(): diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 7611a08df..be0ab8cba 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -19,9 +19,11 @@ # See the file COPYING for details. +import logging + from django import forms from django.conf import settings -from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse, NoReverseMatch from django.db.models import fields from django.forms import ClearableFileInput from django.forms.widgets import flatatt, \ @@ -37,6 +39,8 @@ from django.utils.translation import ugettext_lazy as _ from ishtar_common import models +logger = logging.getLogger(__name__) + reverse_lazy = lazy(reverse, unicode) @@ -639,7 +643,11 @@ class JQueryJqGrid(forms.RadioSelect): col_idx = col_idx and ", ".join(col_idx) or "" dct['encoding'] = settings.ENCODING or 'utf-8' - dct['source'] = unicode(self.source) + try: + dct['source'] = unicode(self.source) + except NoReverseMatch: + logger.warning('Cannot resolve source for {} widget'.format( + self.form)) if unicode(self.source_full) and unicode(self.source_full) != 'None': dct['source_full'] = unicode(self.source_full) -- cgit v1.2.3 From 7f1d9db82a29af007715eb786cc736277041704e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 22 Dec 2016 12:46:24 +0100 Subject: Manage cached_label for treatments - display full label in finds tables (refs #3395) --- archaeological_context_records/models.py | 4 +- archaeological_finds/models.py | 2 +- archaeological_finds/models_finds.py | 38 ++- archaeological_finds/models_treatments.py | 2 +- .../0012_auto__add_field_container_cached_label.py | 283 +++++++++++++++++++++ .../0013_generate_cache_lbl_for_containers.py | 281 ++++++++++++++++++++ archaeological_warehouse/models.py | 30 ++- ishtar_common/widgets.py | 5 +- 8 files changed, 622 insertions(+), 23 deletions(-) create mode 100644 archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py create mode 100644 archaeological_warehouse/migrations/0013_generate_cache_lbl_for_containers.py (limited to 'ishtar_common/widgets.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 22ff3b095..7d399ecd9 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -129,7 +129,7 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, TABLE_COLS.insert(1, 'operation__code_patriarche') TABLE_COLS_FOR_OPE = ['label', 'parcel', 'unit', 'datings__period', 'description'] - TABLE_COLS_FOR_OPE_LBL = {'section__parcel_number': _("Parcel")} + COL_LABELS = {'section__parcel_number': _("Parcel")} CONTEXTUAL_TABLE_COLS = { 'full': { 'related_context_records': 'detailled_related_context_records' @@ -405,7 +405,7 @@ class RecordRelations(GeneralRecordRelations, models.Model): "relation_type", "right_record__label", "right_record__unit", "right_record__parcel", "right_record__datings__period", "right_record__description"] - TABLE_COLS_LBL = { + COL_LABELS = { "left_record__label": _(u"ID (left)"), "left_record__unit": _(u"Unit (left)"), "left_record__parcel": _(u"Parcel (left)"), diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index f9d93b1a9..7d56bb771 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -13,4 +13,4 @@ __all__ = ['MaterialType', 'ConservatoryState', 'PreservationType', 'TreatmentType', 'Treatment', 'AbsFindTreatments', 'FindUpstreamTreatments', 'FindDownstreamTreatments', 'FindTreatments', 'TreatmentSource', 'TreatmentFile', - 'TreatmentFileType', 'TreatmentFileSource'] \ No newline at end of file + 'TreatmentFileType', 'TreatmentFileSource'] diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index be6037eaa..e1fcb38b7 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -295,7 +295,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'base_finds__context_record__parcel__town', 'base_finds__context_record__operation__year', 'base_finds__context_record__operation__operation_code', - 'container__reference', 'container__location', + 'container__cached_label', 'base_finds__batch', 'base_finds__context_record__parcel__town', 'base_finds__context_record__parcel', ] @@ -307,11 +307,13 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'base_finds__cache_complete_id', 'previous_id', 'label', 'material_types', 'datings__period__label', 'find_number', 'object_types', + 'container__cached_label', 'description', 'base_finds__context_record__parcel__town', 'base_finds__context_record__parcel', ] - TABLE_COLS_FOR_OPE_LBL = { + COL_LABELS = { 'datings__period__label': _(u"Periods"), + 'container__cached_label': _(u"Container"), } EXTRA_FULL_FIELDS = [ @@ -369,6 +371,18 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'basket': 'basket', 'cached_label': 'cached_label__icontains', 'image': 'image__isnull'} + EXTRA_REQUEST_KEYS.update( + dict( + [(key, key) for key in TABLE_COLS + if key not in EXTRA_REQUEST_KEYS] + ) + ) + EXTRA_REQUEST_KEYS.update( + dict( + [(key, key) for key in TABLE_COLS_FOR_OPE + if key not in EXTRA_REQUEST_KEYS] + ) + ) # fields base_finds = models.ManyToManyField(BaseFind, verbose_name=_(u"Base find"), @@ -486,10 +500,9 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): @property def full_label(self): - lbl = u" - ".join([ - getattr(self, attr) - for attr in ('label', 'administrative_index') - if getattr(self, attr)]) + lbl = u" - ".join([getattr(self, attr) + for attr in ('label', 'administrative_index') + if getattr(self, attr)]) base = u" - ".join([base_find.complete_id() for base_find in self.base_finds.all()]) if base: @@ -641,9 +654,9 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): def get_query_owns(cls, user): return Q(base_finds__context_record__operation__scientist=user. ishtaruser.person) | \ - Q(base_finds__context_record__operation__in_charge=user. - ishtaruser.person) | \ - Q(history_creator=user) + Q(base_finds__context_record__operation__in_charge=user. + ishtaruser.person) | \ + Q(history_creator=user) @classmethod def get_owns(cls, user, menu_filtr=None, limit=None): @@ -737,9 +750,10 @@ m2m_changed.connect(base_find_find_changed, sender=Find.base_finds.through) class FindSource(Source): SHOW_URL = 'show-findsource' MODIFY_URL = 'find_source_modify' - TABLE_COLS = ['find__base_finds__context_record__operation', - 'find__base_finds__context_record', 'find'] + \ - Source.TABLE_COLS + TABLE_COLS = [ + 'find__base_finds__context_record__operation', + 'find__base_finds__context_record', 'find'] + \ + Source.TABLE_COLS # search parameters BOOL_FIELDS = ['duplicate'] diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 95817fc40..0f8b4796a 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -71,7 +71,7 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms): "upstream_cached_label": "upstream__cached_label", 'image': 'image__isnull', } - TABLE_COLS_LBL = { + COL_LABELS = { "downstream_cached_label": _(u"Downstream find"), "upstream_cached_label": _(u"Upstream find"), } diff --git a/archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py b/archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py new file mode 100644 index 000000000..2ffeaa231 --- /dev/null +++ b/archaeological_warehouse/migrations/0012_auto__add_field_container_cached_label.py @@ -0,0 +1,283 @@ +# -*- 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 field 'Container.cached_label' + db.add_column('archaeological_warehouse_container', 'cached_label', + self.gf('django.db.models.fields.CharField')(max_length=500, null=True, blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Container.cached_label' + db.delete_column('archaeological_warehouse_container', 'cached_label') + + + models = { + 'archaeological_warehouse.container': { + 'Meta': {'ordering': "('cached_label',)", 'object_name': 'Container'}, + 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {}), + 'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) + }, + 'archaeological_warehouse.containerlocalisation': { + 'Meta': {'ordering': "('container', 'division__order')", 'unique_together': "(('container', 'division'),)", 'object_name': 'ContainerLocalisation'}, + 'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']"}), + 'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivisionLink']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200'}) + }, + 'archaeological_warehouse.containertype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'ContainerType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), + 'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_warehouse.warehouse': { + 'Meta': {'object_name': 'Warehouse'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'associated_divisions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']", 'symmetrical': 'False', 'through': "orm['archaeological_warehouse.WarehouseDivisionLink']", 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_warehouse'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'warehouse_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) + }, + 'archaeological_warehouse.warehousedivision': { + 'Meta': {'object_name': 'WarehouseDivision'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_warehouse.warehousedivisionlink': { + 'Meta': {'ordering': "('warehouse', 'order')", 'unique_together': "(('warehouse', 'division'),)", 'object_name': 'WarehouseDivisionLink'}, + 'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), + 'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}) + }, + 'archaeological_warehouse.warehousetype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'WarehouseType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'ishtar_common.import': { + 'Meta': {'object_name': 'Import'}, + 'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), + 'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), + 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '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'}), + 'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), + 'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) + }, + 'ishtar_common.importertype': { + 'Meta': {'object_name': 'ImporterType'}, + 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.ishtaruser': { + 'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, + 'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), + 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'ishtar_common.organization': { + 'Meta': {'object_name': 'Organization'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), + 'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), + 'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), + 'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.organizationtype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.person': { + 'Meta': {'object_name': 'Person'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), + 'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), + 'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.persontype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.titletype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + } + } + + complete_apps = ['archaeological_warehouse'] \ No newline at end of file diff --git a/archaeological_warehouse/migrations/0013_generate_cache_lbl_for_containers.py b/archaeological_warehouse/migrations/0013_generate_cache_lbl_for_containers.py new file mode 100644 index 000000000..3386c85ec --- /dev/null +++ b/archaeological_warehouse/migrations/0013_generate_cache_lbl_for_containers.py @@ -0,0 +1,281 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models +from ishtar_common.utils import cached_label_changed +from archaeological_warehouse.models import Container + + +class Migration(SchemaMigration): + + def forwards(self, orm): + for obj in Container.objects.all(): + obj.skip_history_when_saving = True + obj.save() + + def backwards(self, orm): + pass + + models = { + 'archaeological_warehouse.container': { + 'Meta': {'ordering': "('cached_label',)", 'object_name': 'Container'}, + 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {}), + 'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_container'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}) + }, + 'archaeological_warehouse.containerlocalisation': { + 'Meta': {'ordering': "('container', 'division__order')", 'unique_together': "(('container', 'division'),)", 'object_name': 'ContainerLocalisation'}, + 'container': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Container']"}), + 'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivisionLink']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200'}) + }, + 'archaeological_warehouse.containertype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'ContainerType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'length': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '30'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), + 'volume': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'archaeological_warehouse.warehouse': { + 'Meta': {'object_name': 'Warehouse'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'associated_divisions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']", 'symmetrical': 'False', 'through': "orm['archaeological_warehouse.WarehouseDivisionLink']", 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_warehouse'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'person_in_charge': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'warehouse_in_charge'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Person']"}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'warehouse_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseType']"}) + }, + 'archaeological_warehouse.warehousedivision': { + 'Meta': {'object_name': 'WarehouseDivision'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'archaeological_warehouse.warehousedivisionlink': { + 'Meta': {'ordering': "('warehouse', 'order')", 'unique_together': "(('warehouse', 'division'),)", 'object_name': 'WarehouseDivisionLink'}, + 'division': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.WarehouseDivision']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '10'}), + 'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.Warehouse']"}) + }, + 'archaeological_warehouse.warehousetype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'WarehouseType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'ishtar_common.import': { + 'Meta': {'object_name': 'Import'}, + 'conservative_import': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}), + 'encoding': ('django.db.models.fields.CharField', [], {'default': "'utf-8'", 'max_length': '15'}), + 'end_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'error_file': ('django.db.models.fields.files.FileField', [], {'max_length': '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'}), + 'imported_images': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'importer_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.ImporterType']"}), + 'match_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'result_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'seconds_remaining': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'skip_lines': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '2'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.IshtarUser']"}) + }, + 'ishtar_common.importertype': { + 'Meta': {'object_name': 'ImporterType'}, + 'associated_models': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_template': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'unicity_keys': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['ishtar_common.IshtarUser']", 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.ishtaruser': { + 'Meta': {'object_name': 'IshtarUser', '_ormbases': ['auth.User']}, + 'advanced_shortcut_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'person': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ishtaruser'", 'unique': 'True', 'to': "orm['ishtar_common.Person']"}), + 'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}) + }, + 'ishtar_common.organization': { + 'Meta': {'object_name': 'Organization'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_organization'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), + 'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Organization']"}), + 'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '500'}), + 'organization_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.OrganizationType']"}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.organizationtype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'OrganizationType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.person': { + 'Meta': {'object_name': 'Person'}, + 'address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_complement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'alt_address_is_prefered': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'alt_country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'alt_postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'alt_town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}), + 'archived': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'attached_to': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'members'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ishtar_common.Organization']"}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'contact_type': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'country': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_ishtar_common_person'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'merge_candidate': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_candidate_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), + 'merge_exclusion': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'merge_exclusion_rel_+'", 'null': 'True', 'to': "orm['ishtar_common.Person']"}), + 'merge_key': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'mobile_phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'old_title': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'person_types': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['ishtar_common.PersonType']", 'symmetrical': 'False'}), + 'phone': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone2': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone3': ('django.db.models.fields.CharField', [], {'max_length': '18', 'null': 'True', 'blank': 'True'}), + 'phone_desc': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc2': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'phone_desc3': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'postal_code': ('django.db.models.fields.CharField', [], {'max_length': '10', 'null': 'True', 'blank': 'True'}), + 'raw_name': ('django.db.models.fields.CharField', [], {'max_length': '300', 'null': 'True', 'blank': 'True'}), + 'raw_phone': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'salutation': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'surname': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'title': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ishtar_common.TitleType']", 'null': 'True', 'blank': 'True'}), + 'town': ('django.db.models.fields.CharField', [], {'max_length': '70', 'null': 'True', 'blank': 'True'}) + }, + 'ishtar_common.persontype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'PersonType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + }, + 'ishtar_common.titletype': { + 'Meta': {'ordering': "('label',)", 'object_name': 'TitleType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'txt_idx': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}) + } + } + + complete_apps = ['archaeological_warehouse'] \ No newline at end of file diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 0eb19814d..0996a10e8 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -19,11 +19,14 @@ import datetime +from django.conf import settings from django.contrib.gis.db import models from django.db.models.signals import post_save, post_delete from django.template.defaultfilters import slugify from django.utils.translation import ugettext_lazy as _, ugettext +from ishtar_common.utils import cached_label_changed + from ishtar_common.models import GeneralType, \ LightHistorizedItem, OwnPerms, Address, Person, post_save_cache @@ -72,6 +75,11 @@ class Warehouse(Address, OwnPerms): return datetime.date.today().strftime('%Y-%m-%d') + '-' + \ slugify(unicode(self)) + def save(self, *args, **kwargs): + super(Warehouse, self).save(*args, **kwargs) + for container in self.containers.all(): + cached_label_changed(Container, {'instance': container}) + class WarehouseDivision(GeneralType): class Meta: @@ -128,16 +136,24 @@ class Container(LightHistorizedItem): verbose_name=_("Container type")) reference = models.CharField(_(u"Container ref."), max_length=40) comment = models.TextField(_(u"Comment")) + cached_label = models.CharField(_(u"Cached name"), max_length=500, + null=True, blank=True) class Meta: verbose_name = _(u"Container") verbose_name_plural = _(u"Containers") + ordering = ('cached_label',) def __unicode__(self): lbl = u" - ".join((self.reference, unicode(self.container_type), unicode(self.location))) return lbl + def _generate_cached_label(self): + items = [self.reference, self.precise_location] + cached_label = u" | ".join(items) + return cached_label + @property def associated_filename(self): return datetime.date.today().strftime('%Y-%m-%d') + '-' + \ @@ -149,11 +165,13 @@ class Container(LightHistorizedItem): def precise_location(self): location = unicode(self.location) locas = [ - u"{} {}".format(loca.division.division, loca.reference) - for loca in ContainerLocalisation.objects.filter( - container=self) + u"{} {}".format(loca.division.division, loca.reference) + for loca in ContainerLocalisation.objects.filter( + container=self) ] - return location + u" - " + u", ".join(locas) + return location + u" | " + u", ".join(locas) + +post_save.connect(cached_label_changed, sender=Container) class ContainerLocalisation(models.Model): @@ -172,3 +190,7 @@ class ContainerLocalisation(models.Model): lbl = u" - ".join((unicode(self.container), unicode(self.division), self.reference)) return lbl + + def save(self, *args, **kwargs): + super(ContainerLocalisation, self).save(*args, **kwargs) + cached_label_changed(Container, {'instance': self.container}) diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index be0ab8cba..ddbfa91bf 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -573,9 +573,8 @@ class JQueryJqGrid(forms.RadioSelect): def get_cols(self, python=False): jq_col_names, extra_cols = [], [] col_labels = {} - if hasattr(self.associated_model, self.table_cols + '_LBL'): - col_labels = getattr(self.associated_model, - self.table_cols + '_LBL') + if hasattr(self.associated_model, 'COL_LABELS'): + col_labels = self.associated_model.COL_LABELS for col_names in getattr(self.associated_model, self.table_cols): field_verbose_names = [] field_verbose_name, field_name = "", "" -- cgit v1.2.3