From f41c11b82a1956f6f2dff183f7972735e041f7d7 Mon Sep 17 00:00:00 2001 From: Kasper Brandt Date: Tue, 24 Mar 2015 10:08:37 +0100 Subject: [PATCH] [#1351] Add attributes on iati-activity element --- akvo/iati/iati_export.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/akvo/iati/iati_export.py b/akvo/iati/iati_export.py index 9c282f962a..e6178132fe 100644 --- a/akvo/iati/iati_export.py +++ b/akvo/iati/iati_export.py @@ -73,6 +73,19 @@ def add_project(self, project): :param project: Project object """ project_element = etree.SubElement(self.iati_activities, "iati-activity") + + if project.last_modified_at: + project_element.attrib['last-updated-datetime'] = project.last_modified_at.strftime("%Y-%m-%dT%H:%M:%SZ") + + if project.language: + project_element.attrib['{http://www.w3.org/XML/1998/namespace}lang'] = project.language + + if project.currency: + project_element.attrib['default-currency'] = project.currency + + if project.hierarchy: + project_element.attrib['hierarchy'] = str(project.hierarchy) + for element in ELEMENTS: tree_elements = getattr(elements, element)(project) for tree_element in tree_elements: