SyntaxFix
Write A Post
Hire A Developer
Questions
I am using the following code in such cases:
obj, created = Model.objects.get_or_create(id=some_id) if not created: resp= "It was created" else: resp= "OK" obj.save()