summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2011-03-06 22:49:08 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2011-03-06 22:49:08 +0100
commitb467050d3f65830e175f4a1483db11e0c603aca3 (patch)
treef56549ff998890309f78b525972c9b578d016503 /ishtar/furnitures/models.py
parent0d37af8098ed4bc7f3ffc552e8454ee897eb39c1 (diff)
downloadIshtar-b467050d3f65830e175f4a1483db11e0c603aca3.tar.bz2
Ishtar-b467050d3f65830e175f4a1483db11e0c603aca3.zip
Creation of context record (refs #18)
Diffstat (limited to 'ishtar/furnitures/models.py')
-rw-r--r--ishtar/furnitures/models.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py
index cea0c1b4c..c1980f68c 100644
--- a/ishtar/furnitures/models.py
+++ b/ishtar/furnitures/models.py
@@ -456,7 +456,8 @@ class Parcel(LightHistorizedItem):
null=True, verbose_name=_(u"Operation"))
year = models.IntegerField(_(u"Year"),
default=lambda:datetime.datetime.now().year)
- town = models.ForeignKey("Town", related_name='+', verbose_name=_(u"Town"))
+ town = models.ForeignKey("Town", related_name='parcels',
+ verbose_name=_(u"Town"))
section = models.CharField(_(u"Section"), max_length=4)
parcel_number = models.CharField(_(u"Parcel number"), max_length=6)
@@ -464,6 +465,11 @@ class Parcel(LightHistorizedItem):
verbose_name = _(u"Parcel")
verbose_name_plural = _(u"Parcels")
+ def short_label(self):
+ return u" - ".join([unicode(item) for item in \
+ [self.town, self.section, self.parcel_number]
+ if item])
+
def __unicode__(self):
return u" - ".join([unicode(item) for item in \
[self.associated_file, self.operation, self.section, self.parcel_number]
@@ -550,12 +556,15 @@ class ContextRecord(BaseHistorizedItem, OwnPerms):
width = models.IntegerField(_(u"Width"))
thickness = models.IntegerField(_(u"Thickness"))
depth = models.IntegerField(_(u"Depth"))
+ location = models.CharField(_(u"Location"), blank=True, null=True,
+ max_length=200,
+ help_text=_(u"A short description of the location of the context record"))
+ datings = models.ManyToManyField(Dating)
+ units = models.ManyToManyField(Unit)
has_furniture = models.BooleanField(u"Has furniture?")
+ filling = models.TextField(_(u"Filling"), blank=True, null=True)
interpretation = models.TextField(_(u"Interpretation"), blank=True,
null=True)
- filling = models.TextField(_(u"Filling"), blank=True, null=True)
- datings = models.ManyToManyField(Dating)
- units = models.ManyToManyField(Unit)
taq = models.IntegerField(_(u"TAQ"), blank=True, null=True,
help_text=_("\"Terminus Ante Quem\" the context record can't have been "
"created after this date"))
@@ -566,8 +575,6 @@ class ContextRecord(BaseHistorizedItem, OwnPerms):
" created before this date"))
tpq_estimated = models.IntegerField(_(u"Estimated TPQ"), blank=True,
null=True, help_text=_("Estimation of a \"Terminus Post Quem\""))
- location = models.CharField(_(u"Location"), max_length=200,
- help_text=_(u"A short description of the location of the context record"))
history = HistoricalRecords()
class Meta: