more event keys

This commit is contained in:
j 2011-10-09 17:40:18 +02:00
parent 5826e80d35
commit 0912e94263

View file

@ -32,7 +32,8 @@ def addEvent(request):
existing_names.append(name) existing_names.append(name)
if not exists: if not exists:
event = models.Event(name = data['name']) event = models.Event(name = data['name'])
for key in ('start', 'end', 'alternativeNames'): for key in ('start', 'startTime', 'end', 'endTime', 'duration', 'durationTime',
'alternativeNames'):
if key in data and data[key]: if key in data and data[key]:
setattr(event, key, data[key]) setattr(event, key, data[key])
event.save() event.save()
@ -66,7 +67,8 @@ def editEvent(request):
conflict = True conflict = True
conflict_names.append(name) conflict_names.append(name)
if not conflict: if not conflict:
for key in ('start', 'end', 'alternativeNames'): for key in ('start', 'startTime', 'end', 'endTime', 'duration', 'durationTime',
'alternativeNames'):
if key in data: if key in data:
setattr(event, key, data[key]) setattr(event, key, data[key])
event.save() event.save()