Python Forum
Framework Django duplicating objects in databases-table!? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Framework Django duplicating objects in databases-table!? (/thread-1193.html)



Framework Django duplicating objects in databases-table!? - tavaresdavi677 - Dec-12-2016

Hello ! i'm starting framework Django for python and I was left with a question about database :

I created a class named Category in models.py

Class Category (models.Model)
Name = models.Charfield (max_lenght = 255)


And in the views.py file I created an object (Category.objects.create (name = "python")) but even updating the page deleting the line of the code and updated again the object is duplicated and I do not understand the reason, Solution to this problem?

I've tried it several times and it's always the same, I have no idea what I'm doing wrong. Wall Wall Cry



RE: Framework Django duplicating objects in databases-table!? - nilamo - Dec-12-2016

How did you create the table? What's the primary key?