Skip to content

Instantly share code, notes, and snippets.

@sbenthall
Created August 3, 2010 19:29
Show Gist options
  • Save sbenthall/506981 to your computer and use it in GitHub Desktop.
Save sbenthall/506981 to your computer and use it in GitHub Desktop.
for map in maps.all()[start:start+limit]:
try:
owner_name = Contact.objects.get(user=map.owner).name
except:
owner_name = map.owner.first_name + " " + map.owner.last_name
mapdict = {
'id' : map.id,
'title' : map.title,
'abstract' : map.abstract,
'detail' : reverse('geonode.maps.views.map_controller', args=(map.id,)),
'owner' : owner_name,
'owner_detail' : reverse('profiles.views.profile_detail', args=(map.owner.username,)),
'last_modified' : map.last_modified.isoformat()
}
maps_list.append(mapdict)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment