diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-10 11:29:02 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-10 11:29:02 +0100 |
commit | c108937967d18c1b22aa5b2d87e093fe0ec83117 (patch) | |
tree | ad2a67c9c118abb0ed734394bc1945974e74477c | |
parent | 960d580bcbe19293941926639ac1750c391e8a07 (diff) | |
download | Ishtar-c108937967d18c1b22aa5b2d87e093fe0ec83117.tar.bz2 Ishtar-c108937967d18c1b22aa5b2d87e093fe0ec83117.zip |
Document generation: WIP on basket
-rw-r--r-- | archaeological_finds/models_finds.py | 16 | ||||
-rw-r--r-- | archaeological_finds/models_treatments.py | 9 | ||||
-rw-r--r-- | ishtar_common/views.py | 1 |
3 files changed, 25 insertions, 1 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 3404749c7..cd827a0d0 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1246,6 +1246,22 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, return return self.base_finds.order_by('-pk').all()[0] + def get_values(self, prefix=''): + values = super(Find, self).get_values(prefix=prefix) + return values + # TODO + bf = self.get_first_base_find() + if not bf: + return values + operation = bf.context_record.operation + values[prefix + "operation"] = [ + { + "common_name": operation.common_name, + "code_patriarche": operation.code_patriarche, + "address": operation.address + } + ] + @property def reference(self): bf = self.get_first_base_find() diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 080d2cc50..3d3827596 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -853,6 +853,15 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem, for attr in ('year', 'index', 'internal_reference', 'name') if getattr(self, attr)]) + def get_values(self, prefix=''): + values = super(TreatmentFile, self).get_values(prefix=prefix) + if not self.associated_basket: + return + values[prefix + "basket"] = [ + find.get_values() for find in self.associated_basket.items.all() + ] + return values + def get_extra_actions(self, request): # url, base_text, icon, extra_text, extra css class, is a quick action actions = [] diff --git a/ishtar_common/views.py b/ishtar_common/views.py index a4b979bd9..e1e5b3d17 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1803,7 +1803,6 @@ def gen_generate_doc(model): return func - class SearchQueryMixin(object): """ Manage content type and profile init |