summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 080fa54da..58acfd148 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -35,7 +35,7 @@ from ishtar_common.models import Document, GeneralType, \
BaseHistorizedItem, HistoricalRecords, OwnPerms, ShortMenuItem, \
GeneralRelationType, GeneralRecordRelations, post_delete_record_relation,\
post_save_cache, ValueGetter, BulkUpdatedItem, \
- RelationItem, Town, get_current_profile
+ RelationItem, Town, get_current_profile, ExternalIdManager
from archaeological_operations.models import Operation, Period, Parcel, \
ArchaeologicalSite
@@ -396,6 +396,7 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
blank=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
+ objects = ExternalIdManager()
class Meta:
verbose_name = _(u"Context Record")
@@ -409,6 +410,9 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
)
ordering = ('cached_label',)
+ def natural_key(self):
+ return (self.external_id, )
+
@property
def name(self):
return self.label or ""