summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-10 17:20:01 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-10 17:20:01 +0100
commit2e4847a414f44600dc25fd1152c1bcff173f76de (patch)
tree5af06729ecc00c740f127d5fd57d1c383efb4e90 /archaeological_context_records
parent6f32d8713096f85029c213954816ea50d06f9643 (diff)
downloadIshtar-2e4847a414f44600dc25fd1152c1bcff173f76de.tar.bz2
Ishtar-2e4847a414f44600dc25fd1152c1bcff173f76de.zip
Models: generic images with m2m relations with main items
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/migrations/0014_contextrecord_images.py21
-rw-r--r--archaeological_context_records/models.py4
2 files changed, 24 insertions, 1 deletions
diff --git a/archaeological_context_records/migrations/0014_contextrecord_images.py b/archaeological_context_records/migrations/0014_contextrecord_images.py
new file mode 100644
index 000000000..641309c97
--- /dev/null
+++ b/archaeological_context_records/migrations/0014_contextrecord_images.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11 on 2017-11-10 17:17
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0021_auto_20171110_1717'),
+ ('archaeological_context_records', '0013_auto_20171026_1827'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='contextrecord',
+ name='images',
+ field=models.ManyToManyField(blank=True, to='ishtar_common.IshtarImage', verbose_name='Images'),
+ ),
+ ]
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 925a48597..dde661ee7 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -33,7 +33,7 @@ from ishtar_common.utils import cached_label_changed
from ishtar_common.models import GeneralType, BaseHistorizedItem, \
HistoricalRecords, OwnPerms, ShortMenuItem, Source, GeneralRelationType,\
GeneralRecordRelations, post_delete_record_relation, \
- ImageModel, post_save_cache, ValueGetter, BulkUpdatedItem
+ ImageModel, post_save_cache, ValueGetter, BulkUpdatedItem, IshtarImage
from archaeological_operations.models import Operation, Period, Parcel
@@ -302,6 +302,8 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
point_2d = models.PointField(_(u"Point (2D)"), blank=True, null=True)
point = models.PointField(_(u"Point (3D)"), blank=True, null=True, dim=3)
polygon = models.PolygonField(_(u"Polygon"), blank=True, null=True)
+ images = models.ManyToManyField(IshtarImage, verbose_name=_(u"Images"),
+ blank=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
PARENT_SEARCH_VECTORS = ['operation']