diff options
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r-- | archaeological_finds/models.py | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index f677b1297..9308be593 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -32,11 +32,7 @@ from ishtar_common.models import GeneralType, ImageModel, BaseHistorizedItem, \ from archaeological_operations.models import AdministrativeAct from archaeological_context_records.models import ContextRecord, Dating -WAREHOUSE_AVAILABLE = 'archaeological_warehouse' in settings.INSTALLED_APPS -if WAREHOUSE_AVAILABLE: - from archaeological_warehouse.models import Warehouse, Container - -FILES_AVAILABLE = 'archaeological_files' in settings.INSTALLED_APPS +from archaeological_warehouse.models import Warehouse, Container class MaterialType(GeneralType): @@ -105,7 +101,7 @@ IS_ISOLATED_CHOICES = ( class BaseFind(BaseHistorizedItem, OwnPerms): IS_ISOLATED_DICT = dict(IS_ISOLATED_CHOICES) - label = models.TextField(_(u"Free-ID")) + label = models.TextField(_(u"Free ID")) external_id = models.CharField(_(u"External ID"), blank=True, null=True, max_length=120) description = models.TextField(_(u"Description"), blank=True, null=True) @@ -136,7 +132,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms): verbose_name = _(u"Base find") verbose_name_plural = _(u"Base finds") permissions = ( - ("view_basefind", ugettext(u"Can view all Base find")), + ("view_basefind", ugettext(u"Can view all Base finds")), ("view_own_basefind", ugettext(u"Can view own Base find")), ("add_own_basefind", ugettext(u"Can add own Base find")), ("change_own_basefind", ugettext(u"Can change own Base find")), @@ -270,7 +266,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'base_finds.special_interest', 'base_finds.discovery_date'] EXTRA_FULL_FIELDS_LABELS = { - 'base_finds.cache_short_id': _(u"Base find - Short Id"), + 'base_finds.cache_short_id': _(u"Base find - Short ID"), 'base_finds.cache_complete_id': _(u"Base find - Complete ID"), 'base_finds.comment': _(u"Base find - Comment"), 'base_finds.description': _(u"Base find - Description"), @@ -285,7 +281,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): external_id = models.CharField(_(u"External ID"), blank=True, null=True, max_length=120) order = models.IntegerField(_(u"Order"), default=1) - label = models.TextField(_(u"Free-ID")) + label = models.TextField(_(u"Free ID")) description = models.TextField(_(u"Description"), blank=True, null=True) material_types = models.ManyToManyField( MaterialType, verbose_name=_(u"Material types"), related_name='finds') @@ -309,10 +305,9 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): verbose_name=_("Downstream treatment")) datings = models.ManyToManyField(Dating, verbose_name=_(u"Dating"), related_name='find') - if WAREHOUSE_AVAILABLE: - container = models.ForeignKey( - Container, verbose_name=_(u"Container"), blank=True, null=True, - related_name='finds') + container = models.ForeignKey( + Container, verbose_name=_(u"Container"), blank=True, null=True, + related_name='finds') is_complete = models.NullBooleanField(_(u"Is complete?"), blank=True, null=True) object_types = models.ManyToManyField( @@ -346,7 +341,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): verbose_name = _(u"Find") verbose_name_plural = _(u"Finds") permissions = ( - ("view_find", ugettext(u"Can view all Find")), + ("view_find", ugettext(u"Can view all Finds")), ("view_own_find", ugettext(u"Can view own Find")), ("add_own_find", ugettext(u"Can add own Find")), ("change_own_find", ugettext(u"Can change own Find")), @@ -559,16 +554,14 @@ class TreatmentType(GeneralType): class Treatment(BaseHistorizedItem, OwnPerms): external_id = models.CharField(_(u"External ID"), blank=True, null=True, max_length=120) - if WAREHOUSE_AVAILABLE: - container = models.ForeignKey(Container, verbose_name=_(u"Container"), - blank=True, null=True) + 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) + 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( @@ -582,7 +575,7 @@ class Treatment(BaseHistorizedItem, OwnPerms): verbose_name = _(u"Treatment") verbose_name_plural = _(u"Treatments") permissions = ( - ("view_treatment", ugettext(u"Can view all Treatment")), + ("view_treatment", ugettext(u"Can view all Treatments")), ("view_own_treatment", ugettext(u"Can view own Treatment")), ("add_own_treatment", ugettext(u"Can add own Treatment")), ("change_own_treatment", ugettext(u"Can change own Treatment")), @@ -610,9 +603,8 @@ class TreatmentSource(Source): class Property(LightHistorizedItem): find = models.ForeignKey(Find, verbose_name=_(u"Find")) - if FILES_AVAILABLE: - administrative_act = models.ForeignKey( - AdministrativeAct, verbose_name=_(u"Administrative act")) + administrative_act = models.ForeignKey( + AdministrativeAct, verbose_name=_(u"Administrative act")) person = models.ForeignKey(Person, verbose_name=_(u"Person"), related_name='properties') start_date = models.DateField(_(u"Start date")) |