diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-06-03 22:05:13 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-06-03 22:05:13 +0200 |
| commit | dd098e6bab668d5d602b2d5c4dd64af3d0aa62b4 (patch) | |
| tree | 4fdfe0c828e975812fdc6a8ededba4995300ecc2 /archaeological_warehouse/models.py | |
| parent | 5f77b4d18fdd1f4b8c6e967d65dc949197a28243 (diff) | |
| parent | 6bcaf64532e8b1ea76e5e74e3291fac2b238f838 (diff) | |
| download | Ishtar-dd098e6bab668d5d602b2d5c4dd64af3d0aa62b4.tar.bz2 Ishtar-dd098e6bab668d5d602b2d5c4dd64af3d0aa62b4.zip | |
Merge branch 'master' into v0.9
Conflicts:
ishtar_common/views.py
Diffstat (limited to 'archaeological_warehouse/models.py')
| -rw-r--r-- | archaeological_warehouse/models.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 86e430a7e..3591f554a 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -17,12 +17,11 @@ # See the file COPYING for details. -from django.conf import settings from django.contrib.gis.db import models from django.utils.translation import ugettext_lazy as _, ugettext -from ishtar_common.models import GeneralType, BaseHistorizedItem, \ - LightHistorizedItem, OwnPerms, Address, Person +from ishtar_common.models import GeneralType, \ + LightHistorizedItem, OwnPerms, Address, Person class WarehouseType(GeneralType): @@ -31,13 +30,14 @@ class WarehouseType(GeneralType): verbose_name_plural = _(u"Warehouse types") ordering = ('label',) + class Warehouse(Address, OwnPerms): name = models.CharField(_(u"Name"), max_length=40) warehouse_type = models.ForeignKey(WarehouseType, verbose_name=_(u"Warehouse type")) - person_in_charge = models.ForeignKey(Person, on_delete=models.SET_NULL, - related_name='warehouse_in_charge', - verbose_name=_(u"Person in charge"), null=True, blank=True) + person_in_charge = models.ForeignKey( + Person, on_delete=models.SET_NULL, related_name='warehouse_in_charge', + verbose_name=_(u"Person in charge"), null=True, blank=True) comment = models.TextField(_(u"Comment"), null=True, blank=True) class Meta: @@ -54,6 +54,7 @@ class Warehouse(Address, OwnPerms): def __unicode__(self): return u"%s (%s)" % (self.name, unicode(self.warehouse_type)) + class ContainerType(GeneralType): length = models.IntegerField(_(u"Length (mm)"), blank=True, null=True) width = models.IntegerField(_(u"Width (mm)"), blank=True, null=True) @@ -66,8 +67,9 @@ class ContainerType(GeneralType): verbose_name_plural = _(u"Container types") ordering = ('label',) + class Container(LightHistorizedItem): - TABLE_COLS = ['reference', 'container_type', 'location',] + TABLE_COLS = ['reference', 'container_type', 'location'] location = models.ForeignKey(Warehouse, verbose_name=_(u"Warehouse")) container_type = models.ForeignKey(ContainerType, verbose_name=_("Container type")) @@ -82,4 +84,3 @@ class Container(LightHistorizedItem): lbl = u" - ".join((self.reference, unicode(self.container_type), unicode(self.location))) return lbl - |
