summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
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
commit6bcaf64532e8b1ea76e5e74e3291fac2b238f838 (patch)
tree3b9881e932b4dabf8da7c30d25feaf8185365e19 /archaeological_warehouse/models.py
parent775270bef684f4e91b6d14e879dbed0e690fe63a (diff)
downloadIshtar-6bcaf64532e8b1ea76e5e74e3291fac2b238f838.tar.bz2
Ishtar-6bcaf64532e8b1ea76e5e74e3291fac2b238f838.zip
Pep8
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py17
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
-