From ecdea8b34ba6047147a449623737dcd2c0aee376 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 14 Dec 2016 18:35:10 +0100 Subject: Manage container localisation --- .../templates/ishtar/wizard/wizard_containerlocalisation.html | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html (limited to 'archaeological_warehouse/templates') diff --git a/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html b/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html new file mode 100644 index 000000000..4a21368ae --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/wizard/wizard_containerlocalisation.html @@ -0,0 +1,7 @@ +{% extends "ishtar/wizard/default_wizard.html" %} +{% load i18n %} +{% block form_head %} +{% if not wizard.form.fields %} +

{% trans "No division set for this warehouse. Define it to localise container in this warehouse." %}

+{% endif %} +{% endblock %} -- cgit v1.2.3 From f42ea0f49a4d5c5a6cb15758d2bc8edaacc49ec3 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 18 Dec 2016 18:34:43 +0100 Subject: Containers / Warehouse: actions, sheets and fixes. --- archaeological_finds/models_finds.py | 2 +- archaeological_finds/models_treatments.py | 2 ++ archaeological_warehouse/forms.py | 6 ---- archaeological_warehouse/ishtar_menu.py | 21 ++++++------ archaeological_warehouse/models.py | 38 ++++++++++++++++++++-- .../templates/ishtar/sheet_container.html | 21 ++++++++++++ .../templates/ishtar/sheet_container_pdf.html | 18 ++++++++++ .../templates/ishtar/sheet_container_window.html | 3 ++ .../templates/ishtar/sheet_warehouse.html | 21 ++++++++++++ .../templates/ishtar/sheet_warehouse_pdf.html | 18 ++++++++++ .../templates/ishtar/sheet_warehouse_window.html | 3 ++ archaeological_warehouse/urls.py | 5 +++ archaeological_warehouse/views.py | 5 ++- archaeological_warehouse/wizards.py | 14 ++++++-- ishtar_common/templatetags/window_tables.py | 3 ++ ishtar_common/wizards.py | 4 +-- 16 files changed, 159 insertions(+), 25 deletions(-) create mode 100644 archaeological_warehouse/templates/ishtar/sheet_container.html create mode 100644 archaeological_warehouse/templates/ishtar/sheet_container_pdf.html create mode 100644 archaeological_warehouse/templates/ishtar/sheet_container_window.html create mode 100644 archaeological_warehouse/templates/ishtar/sheet_warehouse.html create mode 100644 archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html create mode 100644 archaeological_warehouse/templates/ishtar/sheet_warehouse_window.html (limited to 'archaeological_warehouse/templates') diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 1f55ee1a0..be6037eaa 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -291,7 +291,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): CHECK_DICT = dict(CHECK_CHOICES) SHOW_URL = 'show-find' SLUG = 'find' - TABLE_COLS = ['label', 'material_types', 'datings__period', + TABLE_COLS = ['label', 'material_types', 'datings__period__label', 'base_finds__context_record__parcel__town', 'base_finds__context_record__operation__year', 'base_finds__context_record__operation__operation_code', diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 8de10c417..95817fc40 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -362,6 +362,8 @@ class TreatmentFileType(GeneralType): verbose_name = _(u"Treatment file type") verbose_name_plural = _(u"Treatment file types") ordering = ('label',) +post_save.connect(post_save_cache, sender=TreatmentFileType) +post_delete.connect(post_save_cache, sender=TreatmentFileType) class TreatmentFile(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter): diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 8e0328880..4ed8e7aed 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -200,7 +200,6 @@ class BasePackagingForm(SelectFindBasketForm): 'person': Person, 'location': models.Warehouse, 'basket': FindBasket} - treatment_type = forms.IntegerField(label="", widget=forms.HiddenInput) person = forms.IntegerField( label=_(u"Packager"), widget=widgets.JQueryAutoComplete( @@ -210,11 +209,6 @@ class BasePackagingForm(SelectFindBasketForm): start_date = forms.DateField( label=_(u"Date"), required=False, widget=widgets.JQueryDate) - def __init__(self, *args, **kwargs): - super(BasePackagingForm, self).__init__(*args, **kwargs) - self.fields['treatment_type'].initial = \ - TreatmentType.objects.get(txt_idx='packaging').pk - class FindPackagingFormSelection(FindMultipleFormSelection): form_label = _(u"Packaged finds") diff --git a/archaeological_warehouse/ishtar_menu.py b/archaeological_warehouse/ishtar_menu.py index 4fe84e516..7f182d02b 100644 --- a/archaeological_warehouse/ishtar_menu.py +++ b/archaeological_warehouse/ishtar_menu.py @@ -37,16 +37,17 @@ MENU_SECTIONS = [ access_controls=['add_treatment', 'add_own_treatment']), ])), (80, SectionItem('warehouse', _(u"Warehouse"), - childs=[ - MenuItem('warehouse_creation', _(u"Creation"), - model=models.Warehouse, - access_controls=['add_warehouse',]), - MenuItem('warehouse_modification', _(u"Modification"), - model=models.Warehouse, - access_controls=['change_warehouse',]), - MenuItem('container_localisation', _(u"Container localisation"), - model=models.Warehouse, - access_controls=['change_warehouse',]), + profile_restriction='warehouse', + childs=[ + MenuItem('warehouse_creation', _(u"Creation"), + model=models.Warehouse, + access_controls=['add_warehouse',]), + MenuItem('warehouse_modification', _(u"Modification"), + model=models.Warehouse, + access_controls=['change_warehouse',]), + MenuItem('container_localisation', _(u"Container localisation"), + model=models.Warehouse, + access_controls=['change_warehouse',]), ])) ] """ diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 57068f374..0872df220 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -17,8 +17,11 @@ # See the file COPYING for details. -from django.db.models.signals import post_save, post_delete +import datetime + 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.models import GeneralType, \ @@ -35,6 +38,7 @@ post_delete.connect(post_save_cache, sender=WarehouseType) class Warehouse(Address, OwnPerms): + SHOW_URL = 'show-warehouse' name = models.CharField(_(u"Name"), max_length=200) warehouse_type = models.ForeignKey(WarehouseType, verbose_name=_(u"Warehouse type")) @@ -63,11 +67,18 @@ class Warehouse(Address, OwnPerms): def __unicode__(self): return u"%s (%s)" % (self.name, unicode(self.warehouse_type)) + @property + def associated_filename(self): + return datetime.date.today().strftime('%Y-%m-%d') + '-' + \ + slugify(unicode(self)) + class WarehouseDivision(GeneralType): class Meta: verbose_name = _(u"Warehouse division") verbose_name_plural = _(u"Warehouse divisions") +post_save.connect(post_save_cache, sender=WarehouseDivision) +post_delete.connect(post_save_cache, sender=WarehouseDivision) class WarehouseDivisionLink(models.Model): @@ -80,6 +91,9 @@ class WarehouseDivisionLink(models.Model): ordering = ('warehouse', 'order') unique_together = ('warehouse', 'division') + def __unicode__(self): + return u"{} - {}".format(self.warehouse, self.division) + class ContainerType(GeneralType): length = models.IntegerField(_(u"Length (mm)"), blank=True, null=True) @@ -105,9 +119,11 @@ class Container(LightHistorizedItem): 'container_type': 'container_type__pk', 'reference': 'reference__icontains', } + SHOW_URL = 'show-container' # fields - location = models.ForeignKey(Warehouse, verbose_name=_(u"Warehouse")) + location = models.ForeignKey(Warehouse, verbose_name=_(u"Warehouse"), + related_name='containers') container_type = models.ForeignKey(ContainerType, verbose_name=_("Container type")) reference = models.CharField(_(u"Container ref."), max_length=40) @@ -122,6 +138,23 @@ class Container(LightHistorizedItem): unicode(self.location))) return lbl + @property + def associated_filename(self): + return datetime.date.today().strftime('%Y-%m-%d') + '-' + \ + "-".join([str(slugify(getattr(self, attr))) + for attr in ('location', 'container_type', + 'reference')]) + + @property + def precise_location(self): + location = unicode(self.location) + locas = [ + u"{} {}".format(loca.division.division, loca.reference) + for loca in ContainerLocalisation.objects.filter( + container=self) + ] + return location + u" - " + u", ".join(locas) + class ContainerLocalisation(models.Model): container = models.ForeignKey(Container, verbose_name=_(u"Container")) @@ -133,6 +166,7 @@ class ContainerLocalisation(models.Model): verbose_name = _(u"Container localisation") verbose_name_plural = _(u"Container localisations") unique_together = ('container', 'division') + ordering = ('container', 'division__order') def __unicode__(self): lbl = u" - ".join((unicode(self.container), diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html new file mode 100644 index 000000000..fd3c6510a --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -0,0 +1,21 @@ +{% extends "ishtar/sheet.html" %} +{% load i18n window_header window_field window_tables %} + +{% block head_title %}{% trans "Container" %}{% endblock %} + +{% block content %} +{% window_nav item window_id 'show-container' '' '' '' previous next 1 %} + + +{% field "Comment" item.comment "
" "
" %} +{% field "Location" item.precise_location %} + +{% if item.finds.count %} +

{% trans "Content" %}

+{% dynamic_table_document finds 'finds' 'container' item.pk 'TABLE_COLS' output 'large' %} +{% endif %} + +{% endblock %} diff --git a/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html b/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html new file mode 100644 index 000000000..5e4947cfa --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/sheet_container_pdf.html @@ -0,0 +1,18 @@ +{% extends "ishtar/sheet_container.html" %} +{% block header %} + +{% endblock %} +{% block main_head %} +{{ block.super }} +
+Ishtar – {{APP_NAME}} – {{item}} +
+{% endblock %} +{%block head_sheet%}{%endblock%} +{%block main_foot%} +
+– – +
+ + +{%endblock%} diff --git a/archaeological_warehouse/templates/ishtar/sheet_container_window.html b/archaeological_warehouse/templates/ishtar/sheet_container_window.html new file mode 100644 index 000000000..28aeaf9aa --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/sheet_container_window.html @@ -0,0 +1,3 @@ +{% extends "ishtar/sheet_container.html" %} +{% block main_head %}{%endblock%} +{% block main_foot %}{%endblock%} diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html new file mode 100644 index 000000000..6304dc3a5 --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -0,0 +1,21 @@ +{% extends "ishtar/sheet.html" %} +{% load i18n window_header window_field window_tables %} + +{% block head_title %}{% trans "Warehouse" %}{% endblock %} + +{% block content %} +{% window_nav item window_id 'show-warehouse' '' '' '' previous next 1 %} + + +{% field "Comment" item.comment "
" "
" %} + +{% if item.containers.count %} +

{% trans "Containers" %}

+{% dynamic_table_document '' 'containers' 'location' item.pk 'TABLE_COLS' output 'large' %} +{% endif %} + +{% endblock %} diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html new file mode 100644 index 000000000..260834ac6 --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse_pdf.html @@ -0,0 +1,18 @@ +{% extends "ishtar/sheet_warehouse.html" %} +{% block header %} + +{% endblock %} +{% block main_head %} +{{ block.super }} +
+Ishtar – {{APP_NAME}} – {{item}} +
+{% endblock %} +{%block head_sheet%}{%endblock%} +{%block main_foot%} +
+– – +
+ + +{%endblock%} diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse_window.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse_window.html new file mode 100644 index 000000000..e77c2c2a3 --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse_window.html @@ -0,0 +1,3 @@ +{% extends "ishtar/sheet_warehouse.html" %} +{% block main_head %}{%endblock%} +{% block main_foot %}{%endblock%} diff --git a/archaeological_warehouse/urls.py b/archaeological_warehouse/urls.py index ab1437a04..5c18200db 100644 --- a/archaeological_warehouse/urls.py +++ b/archaeological_warehouse/urls.py @@ -21,6 +21,7 @@ from django.conf.urls.defaults import * from ishtar_common.wizards import check_rights import views +from archaeological_warehouse import models # be carreful: each check_rights must be relevant with ishtar_menu @@ -35,6 +36,8 @@ urlpatterns += patterns( 'archaeological_warehouse.views', url(r'new-warehouse/(?P.+)?/$', 'new_warehouse', name='new-warehouse'), + url(r'^show-warehouse(?:/(?P.+))?/(?P.+)?$', 'show_warehouse', + name=models.Warehouse.SHOW_URL), url(r'autocomplete-warehouse/$', 'autocomplete_warehouse', name='autocomplete-warehouse'), url(r'new-container/(?P.+)?/$', @@ -45,6 +48,8 @@ urlpatterns += patterns( name='get-warehouse'), url(r'autocomplete-container/?$', 'autocomplete_container', name='autocomplete-container'), + url(r'^show-container(?:/(?P.+))?/(?P.+)?$', 'show_container', + name=models.Container.SHOW_URL), url(r'^warehouse_creation/(?P.+)?$', check_rights(['add_warehouse'])( views.warehouse_creation_wizard), name='warehouse_creation'), diff --git a/archaeological_warehouse/views.py b/archaeological_warehouse/views.py index 1b9288ed1..5366aa53b 100644 --- a/archaeological_warehouse/views.py +++ b/archaeological_warehouse/views.py @@ -23,15 +23,18 @@ from django.db.models import Q from django.http import HttpResponse from django.utils.translation import ugettext_lazy as _ -from ishtar_common.views import get_item, new_item import models + +from ishtar_common.views import get_item, new_item, show_item from wizards import * from ishtar_common.forms import FinalForm from forms import * get_container = get_item(models.Container, 'get_container', 'container') +show_container = show_item(models.Container, 'container') get_warehouse = get_item(models.Warehouse, 'get_warehouse', 'warehouse') +show_warehouse = show_item(models.Warehouse, 'warehouse') new_warehouse = new_item(models.Warehouse, WarehouseForm) new_container = new_item(models.Container, ContainerForm) diff --git a/archaeological_warehouse/wizards.py b/archaeological_warehouse/wizards.py index 407a58ad6..cfe5be4d4 100644 --- a/archaeological_warehouse/wizards.py +++ b/archaeological_warehouse/wizards.py @@ -17,13 +17,12 @@ # See the file COPYING for details. -from django.contrib.formtools.wizard.views import NamedUrlWizardView from django.shortcuts import render_to_response from django.template import RequestContext from ishtar_common.wizards import Wizard from archaeological_finds.wizards import TreatmentWizard -from archaeological_finds.models import Treatment +from archaeological_finds.models import Treatment, TreatmentType import models @@ -36,11 +35,20 @@ class PackagingWizard(TreatmentWizard): dct = self.get_extra_model(dct, form_list) obj = self.get_current_saved_object() dct['location'] = dct['container'].location - items = dct.pop('basket') + items = None + if 'items' in dct: + items = dct.pop('items') + if 'basket' in dct: + if not items: + items = dct.pop('basket') + else: + dct.pop('basket') treatment = Treatment(**dct) extra_args_for_new = {"container": dct['container']} treatment.save(items=items, user=self.request.user, extra_args_for_new=extra_args_for_new) + packaging = TreatmentType.objects.get(txt_idx='packaging') + treatment.treatment_types.add(packaging) res = render_to_response('ishtar/wizard/wizard_done.html', {}, context_instance=RequestContext(self.request)) return return_object and (obj, res) or res diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index 377b6e435..e9f628ab6 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -18,6 +18,7 @@ from archaeological_context_records.models import ContextRecord, \ ContextRecordSource, RecordRelations as CRRecordRelations from archaeological_finds.models import Find, FindSource, \ FindUpstreamTreatments, FindDownstreamTreatments, FindTreatments +from archaeological_warehouse.models import Container register = template.Library() @@ -55,6 +56,8 @@ ASSOCIATED_MODELS['finds_downstreamtreatments'] = ( FindDownstreamTreatments, 'get-downstreamtreatment', '') ASSOCIATED_MODELS['treatments'] = ( FindTreatments, 'get-treatment', '') +ASSOCIATED_MODELS['containers'] = ( + Container, 'get-container', '') @register.simple_tag(takes_context=True) diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 2fbe30e0e..6e5216c6a 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -647,8 +647,8 @@ class Wizard(NamedUrlWizardView): model.RELATIVE_MODELS: value[model.RELATIVE_MODELS[ self.get_saved_model()]] = obj - value = model.objects.create(**value) - value.save() + value, created = model.objects.get_or_create(**value) + value.save() # force post_save # check that an item is not add multiple times (forged forms) if value not in related_model.all() and\ hasattr(related_model, 'add'): -- cgit v1.2.3 From e1753fd6d32500bb5c76a2902bec4bc8b09d24d8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 9 Jan 2017 23:20:50 +0100 Subject: Container: manage location and responsible --- .../templates/ishtar/sheet_find.html | 7 +- archaeological_warehouse/forms.py | 11 +- .../0019_auto__add_field_container_responsible.py | 297 +++++++++++++++++++++ archaeological_warehouse/models.py | 8 +- .../templates/ishtar/sheet_container.html | 4 +- .../templates/ishtar/sheet_warehouse.html | 7 +- ishtar_common/templatetags/window_tables.py | 2 +- 7 files changed, 326 insertions(+), 10 deletions(-) create mode 100644 archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py (limited to 'archaeological_warehouse/templates') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 444c6c5d8..05a796a9f 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -76,10 +76,11 @@ {% if item.container %} -

{% trans "Localisation"%}

-{% field_detail "Warehouse" item.container.location %} +

{% trans "Warehouse"%}

{% field_detail "Container" item.container %} -{% field "Localisation" item.container.divisions_lbl %} +{% field_detail "Responsible warehouse" item.container.responsible %} +{% field_detail "Location (warehouse)" item.container.location %} +{% field "Precise localisation" item.container.divisions_lbl %} {% endif %} {% if item.upstream_treatment or item.downstream_treatment %} diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index d61658b0e..e91d04d61 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -149,11 +149,18 @@ class WarehouseDeletionForm(FinalForm): class ContainerForm(ManageOldType, forms.Form): form_label = _(u"Container") associated_models = {'container_type': models.ContainerType, - 'location': models.Warehouse} + 'location': models.Warehouse, + 'responsible': models.Warehouse} reference = forms.CharField(label=_(u"Ref.")) container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) location = forms.IntegerField( - label=_(u"Warehouse"), + label=_(u"Current location (warehouse)"), + widget=widgets.JQueryAutoComplete( + reverse_lazy('autocomplete-warehouse'), + associated_model=models.Warehouse, new=True), + validators=[valid_id(models.Warehouse)]) + responsible = forms.IntegerField( + label=_(u"Responsible warehouse"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-warehouse'), associated_model=models.Warehouse, new=True), diff --git a/archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py b/archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py new file mode 100644 index 000000000..21612d227 --- /dev/null +++ b/archaeological_warehouse/migrations/0019_auto__add_field_container_responsible.py @@ -0,0 +1,297 @@ +# -*- 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.responsible' + db.add_column('archaeological_warehouse_container', 'responsible', + self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='owned_containers', null=True, to=orm['archaeological_warehouse.Warehouse']), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Container.responsible' + db.delete_column('archaeological_warehouse_container', 'responsible_id') + + + models = { + 'archaeological_warehouse.collection': { + 'Meta': {'ordering': "('name',)", 'object_name': 'Collection'}, + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'history_creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'history_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'history_modifier': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['auth.User']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'imports': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'imported_archaeological_warehouse_collection'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['ishtar_common.Import']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'warehouse': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'collections'", 'to': "orm['archaeological_warehouse.Warehouse']"}) + }, + 'archaeological_warehouse.container': { + 'Meta': {'ordering': "('cached_label',)", 'unique_together': "(('index', 'location'),)", 'object_name': 'Container'}, + 'cached_label': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'cached_location': ('django.db.models.fields.CharField', [], {'max_length': '500', 'null': 'True', 'blank': 'True'}), + 'comment': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'container_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['archaeological_warehouse.ContainerType']"}), + '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']"}), + 'index': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'containers'", 'to': "orm['archaeological_warehouse.Warehouse']"}), + 'reference': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'responsible': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_containers'", 'null': 'True', 'to': "orm['archaeological_warehouse.Warehouse']"}) + }, + '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 656f516d5..c3c159550 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -153,8 +153,12 @@ class Container(LightHistorizedItem): CACHED_LABELS = ['cached_label', 'cached_location'] # fields - location = models.ForeignKey(Warehouse, verbose_name=_(u"Warehouse"), - related_name='containers') + location = models.ForeignKey( + Warehouse, verbose_name=_(u"Location (warehouse)"), + related_name='containers') + responsible = models.ForeignKey( + Warehouse, verbose_name=_(u"Responsible warehouse"), + related_name='owned_containers', blank=True, null=True) container_type = models.ForeignKey(ContainerType, verbose_name=_("Container type")) reference = models.CharField(_(u"Container ref."), max_length=40) diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index fd3c6510a..4a7b2f0b9 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -9,9 +9,11 @@
    {% field_li "Reference" item.reference %} {% field_li "Container type" item.container_type %} + {% field_li_detail "Responsible warehouse" item.responsible %} + {% field_li_detail "Location (warehouse)" item.location %}
-{% field "Comment" item.comment "
" "
" %} {% field "Location" item.precise_location %} +{% field "Comment" item.comment "
" "
" %} {% if item.finds.count %}

{% trans "Content" %}

diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index 6304dc3a5..9fd022281 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -15,7 +15,12 @@ {% if item.containers.count %}

{% trans "Containers" %}

-{% dynamic_table_document '' 'containers' 'location' item.pk 'TABLE_COLS' output 'large' %} +{% dynamic_table_document '' 'containers' 'location' item.pk 'TABLE_COLS' output %} +{% endif %} + +{% if item.owned_containers.count %} +

{% trans "Attached containers" %}

+{% dynamic_table_document '' 'containers' 'responsible' item.pk 'TABLE_COLS' output %} {% endif %} {% endblock %} diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index 2fc364f25..05592557a 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -81,7 +81,7 @@ def dynamic_table_document( t = get_template('ishtar/blocks/window_tables/dynamic_documents.html') context = template.Context({ 'caption': caption, - 'name': slugify(caption) + '{}'.format(int(time.time())), + 'name': '{}{}{}'.format(slugify(caption), key, int(time.time())), 'source': source + source_attrs, 'source_full': source_full, 'simple_source': source, -- cgit v1.2.3