Skip to content

Commit

Permalink
[#1351] Add attributes on iati-activity element
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperBrandt committed Mar 24, 2015
1 parent 1e2891a commit f41c11b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions akvo/iati/iati_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f41c11b

Please sign in to comment.