mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-23 07:41:52 +00:00
10 lines
437 B
Python
10 lines
437 B
Python
|
def save(objectType, lookupAttribs={}, nonLookupAttribs={}):
|
||
|
|
||
|
instance, created=objectType.objects.get_or_create(defaults=nonLookupAttribs, **lookupAttribs)
|
||
|
|
||
|
if not created and not instance.new_since_parsing:
|
||
|
for k, v in nonLookupAttribs.items(): #overwrite the existing attributes from the logbook text (except date and title)
|
||
|
setattr(instance, k, v)
|
||
|
instance.save()
|
||
|
|
||
|
return instance
|