Python Forum
Framework Django duplicating objects in databases-table!?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Framework Django duplicating objects in databases-table!?
#1
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
Reply
#2
How did you create the table? What's the primary key?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python code keeps duplicating information - OOP ( Could be related to shallow copy? ) ben1122 1 1,194 Jun-04-2022, 11:03 AM
Last Post: DeaD_EyE
  Help please. Looping the same SQL query over different databases and combine them danlin123 3 2,013 Sep-23-2020, 02:31 PM
Last Post: danlin123
  Final Project (Databases, GUI, and Classes) poochenthecreator 1 1,616 Apr-27-2020, 09:58 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020