This commit is contained in:
j 2012-02-16 14:59:00 +05:30
parent d81c50f590
commit 58f0f1cbeb
1 changed files with 4 additions and 3 deletions

View File

@ -140,6 +140,7 @@ def item_data(data):
u'source': u'project',
u'collection': u'source',
u'languages': u'language',
u'description': u'summary',
}.get(key, key)] = value
if 'director' in d:
d['director'] = unicode(d['director']).replace(' and ', ', ').strip().split(', ')
@ -162,8 +163,8 @@ def import_layers(item, layers):
'locations': 'places'
}.get(layer_name, layer_name)
annotation = Annotation(item=item, layer=layer_name)
annotation.start = float(layer['time_in'])/1000
annotation.end = float(layer['time_out'])/1000
annotation.start = max(float(layer['time_in'])/1000, 0)
annotation.end = max(float(layer['time_out'])/1000, 0)
if annotation.end < annotation.start:
annotation.end, annotation.start = annotation.start, annotation.end
username = layer['creator'].strip()
@ -274,7 +275,7 @@ for l in locations:
l['modified'] = datetime.fromtimestamp(int(l['modified']))
l['alternativeNames'] = tuple(l['alternativeNames'])
l['geoname'] = l['name']
l['type'] = 'city'
l['type'] = 'feature'
p, c = Place.objects.get_or_create(name=l['name'])
for key in l:
if key != 'annotations':