diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-21 12:25:35 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-28 11:40:17 +0100 | 
| commit | 71f84bfa3da9db01215cc61318d6a1e3f8536c28 (patch) | |
| tree | f10e7be1639b8c20899d55d3a3ff0ea7ee89d2bc | |
| parent | 59d1938d45346aea74746e56d634e81a53cb2015 (diff) | |
| download | Ishtar-71f84bfa3da9db01215cc61318d6a1e3f8536c28.tar.bz2 Ishtar-71f84bfa3da9db01215cc61318d6a1e3f8536c28.zip  | |
Fix imports logic
| -rw-r--r-- | archaeological_finds/migrations/0041_auto_20181121_1225.py | 24 | ||||
| -rw-r--r-- | archaeological_finds/models_finds.py | 4 | ||||
| -rw-r--r-- | archaeological_finds/models_treatments.py | 3 | 
3 files changed, 28 insertions, 3 deletions
diff --git a/archaeological_finds/migrations/0041_auto_20181121_1225.py b/archaeological_finds/migrations/0041_auto_20181121_1225.py new file mode 100644 index 000000000..248dc6499 --- /dev/null +++ b/archaeological_finds/migrations/0041_auto_20181121_1225.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.10 on 2018-11-21 12:25 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + +    dependencies = [ +        ('archaeological_finds', '0040_auto_20181120_1027'), +    ] + +    operations = [ +        migrations.RemoveField( +            model_name='treatment', +            name='finds', +        ), +        migrations.AddField( +            model_name='find', +            name='treatments', +            field=models.ManyToManyField(blank=True, help_text='Related treatments when no new find is created', related_name='finds', to='archaeological_finds.Treatment', verbose_name='Treatments'), +        ), +    ] diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index c7bd3f64e..a3aaae50d 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1097,6 +1097,10 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms,      documents = models.ManyToManyField(          Document, related_name='finds', verbose_name=_(u"Documents"),          blank=True) +    treatments = models.ManyToManyField( +        "Treatment", verbose_name=_(u"Treatments"), +        related_name='finds', blank=True, +        help_text=_(u"Related treatments when no new find is created"))      cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,                                      db_index=True)      history = HistoricalRecords() diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index b1ad5fa41..48da7c8ec 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -152,9 +152,6 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,      start_date = models.DateField(_(u"Start date"), blank=True, null=True)      end_date = models.DateField(_(u"Closing date"), blank=True, null=True)      creation_date = models.DateTimeField(default=datetime.datetime.now) -    finds = models.ManyToManyField( -        "Find", verbose_name=_(u"Finds"), related_name='treatments', blank=True, -        help_text=_(u"Related finds for non-destructive treatment"))      container = models.ForeignKey(Container, verbose_name=_(u"Container"),                                    blank=True, null=True)      estimated_cost = models.FloatField(_(u"Estimated cost"),  | 
