return None
- def sequences(self):
- sequence = []
+ def paths(self):
+ #FIXME: need to handle multiple (polyhierarchical) paths
+ path = []
location = self
while location:
- sequence.append(location)
- location = location.parent()
- return sequence
+ path.append(location)
+ try:
+ location = location.ancestors(direct=True)[0]
+ except IndexError:
+ location = None
+ return [path]
def fullnames(self):
-
- return u', '.join([unicode(l) for l in self.sequence()])
+ names = []
+ for path in self.paths():
+ names.append(u', '.join([unicode(l) for l in path]))
+ return names
class LocationType(ModelCore):
"Location types"
Element('publisher', settings.TELEMETA_ORGANIZATION),
date,
Date(item.collection.year_published, refinement='issued'),
- Element('coverage', item.location.fullname(), 'spatial'),
+ Element.multiple('coverage', item.location.fullnames(), 'spatial'),
Element('coverage', item.location_comment, 'spatial'),
Element('rights', item.collection.legal_rights, 'license'),
Element('rights', media_access_rights(item.collection), 'accessRights'),
<dl class="listing">\r
{% if item.location %}\r
<dt>{% trans "Location" %}</dt>\r
- <dd>{{ item.location.fullname }}</dd>\r
+ <dd>{{ item.location.fullnames|join:"<br/>" }}</dd>\r
{% endif %}\r
{% dl_field item "location_comment" %}\r
{% dl_field item "cultural_area" %}\r