diff options
Diffstat (limited to 'archaeological_finds/models.py')
| -rw-r--r-- | archaeological_finds/models.py | 21 | 
1 files changed, 19 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index a70fa01bb..754ef75fa 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2012-2013 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2012-2015 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as @@ -59,7 +59,14 @@ class ConservatoryState(GeneralType):  class BaseFind(BaseHistorizedItem, OwnPerms):      label = models.CharField(_(u"ID"), max_length=60) -    description = models.TextField(_(u"Description")) +    external_id = models.CharField(_(u"External ID"), blank=True, null=True, +                                   max_length=120) +    description = models.TextField(_(u"Description"), blank=True, null=True) +    comment = models.TextField(_(u"Comment"), blank=True, null=True) +    topographic_localisation = models.CharField(_(u"Topographic localisation"), +                                         blank=True, null=True, max_length=120) +    special_interest = models.CharField(_(u"Special interest"), blank=True, +                                        null=True, max_length=120)      context_record = models.ForeignKey(ContextRecord,                related_name='base_finds', verbose_name=_(u"Context Record"))      is_isolated = models.NullBooleanField(_(u"Is isolated?"), blank=True, @@ -150,6 +157,9 @@ class BaseFind(BaseHistorizedItem, OwnPerms):      def name(self):          return self.label +WEIGHT_UNIT = (('g', _(u"g")), +               ('kg', _(u"kg")),) +  class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):      TABLE_COLS = ['label', 'material_type', 'dating.period',                    'base_finds.context_record.parcel.town', @@ -171,6 +181,10 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):                verbose_name = _(u"Conservatory state"), blank=True, null=True)      volume = models.FloatField(_(u"Volume (l)"), blank=True, null=True)      weight = models.FloatField(_(u"Weight (g)"), blank=True, null=True) +    weight_unit = models.CharField(_(u"Weight unit"), max_length=1, +                                   blank=True, null=True, choices=WEIGHT_UNIT) +    discovery_date = models.DateField(_(u"Discovery date"), +                                      blank=True, null=True)      find_number = models.IntegerField(_("Find number"), blank=True, null=True)      upstream_treatment = models.ForeignKey("Treatment", blank=True, null=True,        related_name='downstream_treatment', verbose_name=_("Upstream treatment")) @@ -349,11 +363,14 @@ class Treatment(BaseHistorizedItem, OwnPerms):         container = models.ForeignKey(Container, verbose_name=_(u"Container"),                                    blank=True, null=True)      description = models.TextField(_(u"Description"), blank=True, null=True) +    comment = models.TextField(_(u"Comment"), blank=True, null=True)      treatment_type = models.ForeignKey(TreatmentType,                                         verbose_name=_(u"Treatment type"))      if WAREHOUSE_AVAILABLE:          location = models.ForeignKey(Warehouse, verbose_name=_(u"Location"),                                       blank=True, null=True) +    other_location = models.CharField(_(u"Other location"), max_length=200, +                                      blank=True, null=True)      person = models.ForeignKey(Person, verbose_name=_(u"Person"),                                 blank=True, null=True, on_delete=models.SET_NULL,                                 related_name='treatments')  | 
