Quantcast
Channel: Django save() always create a new object - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Stephane Martin for Django save() always create a new object

This is my updated code, which worked for me...def make_id(): today = datetime.datetime.now() ticket_count = DeploymentTask.objects.filter( created_at__year=today.year,...

View Article



Answer by imposeren for Django save() always create a new object

You are always setting self.deployment_id to a new value in the save method.Django tries to do UPDATE ... WHERE deployment_id = %, but there are no records with this id yet (at least if you are saving...

View Article

Django save() always create a new object

I have this model in my app which is meant to auto-generate it's primary Key based on a method added in the save().However, for each object, I will be expected to make updates of certain fields. Right...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images