diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-06-02 20:47:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-06-02 20:47:30 +0200 |
commit | 32ab6d75bd1cd5163e8d21d0d49cd538b36612e0 (patch) | |
tree | 3b9881e932b4dabf8da7c30d25feaf8185365e19 /archaeological_warehouse/models.py | |
parent | 340f41d071d1477e21c2a829341144a6b84be1a6 (diff) | |
download | Ishtar-32ab6d75bd1cd5163e8d21d0d49cd538b36612e0.tar.bz2 Ishtar-32ab6d75bd1cd5163e8d21d0d49cd538b36612e0.zip |
Pep8
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 - |