Changeset 529
- Timestamp:
- 02/08/10 18:55:30 (7 months ago)
- Location:
- trunk/telemeta
- Files:
-
- 3 modified
-
models/crem.py (modified) (1 diff)
-
models/dublincore.py (modified) (1 diff)
-
templates/telemeta_default/mediaitem_detail.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/telemeta/models/crem.py
r528 r529 633 633 return None 634 634 635 def sequences(self): 636 sequence = [] 635 def paths(self): 636 #FIXME: need to handle multiple (polyhierarchical) paths 637 path = [] 637 638 location = self 638 639 while location: 639 sequence.append(location) 640 location = location.parent() 641 return sequence 640 path.append(location) 641 try: 642 location = location.ancestors(direct=True)[0] 643 except IndexError: 644 location = None 645 return [path] 642 646 643 647 def fullnames(self): 644 645 return u', '.join([unicode(l) for l in self.sequence()]) 648 names = [] 649 for path in self.paths(): 650 names.append(u', '.join([unicode(l) for l in path])) 651 return names 646 652 647 653 class LocationType(ModelCore): -
trunk/telemeta/models/dublincore.py
r517 r529 212 212 date, 213 213 Date(item.collection.year_published, refinement='issued'), 214 Element ('coverage', item.location.fullname(), 'spatial'),214 Element.multiple('coverage', item.location.fullnames(), 'spatial'), 215 215 Element('coverage', item.location_comment, 'spatial'), 216 216 Element('rights', item.collection.legal_rights, 'license'), -
trunk/telemeta/templates/telemeta_default/mediaitem_detail.html
r528 r529 147 147 {% if item.location %} 148 148 <dt>{% trans "Location" %}</dt> 149 <dd>{{ item.location.fullname }}</dd>149 <dd>{{ item.location.fullnames|join:"<br/>" }}</dd> 150 150 {% endif %} 151 151 {% dl_field item "location_comment" %}
