INNER CODE UNIT · Python
found
jsbroks/coco-annotator · backend/database/__init__.py:33
found = model.objects(**query)
if found.first():
return found.modify(new=True, **update)
new_model = model(**update)
new_model.save()
return new_model
def fix_ids(q):
json_obj = json.loads(q.to_json().replace('\"_id\"', '\"id\"'))
return json_obj
def create_from_json(json_file):