Django Django administration shows more objects then the actual datapoints

29 Views Asked by At

I have created a Django model and uploaded some data, around 90 data point. I deleted and uploaded these data points multiple times for testing purposes. I notice my Django admin showing object number much higher then the actual data point present in the database.

PeptideSeq object (695)

While the total data point I have around 90. Is these normal behavior or is there a way to correct this issue and start the count from zero when you delete all objects. I used Django admin GUI to delete objects.

Thanks!

1

There are 1 best solutions below

0
Sagun Devkota On

For each model django add a auto field by default named id which is auto increment primary key. When you add a record it adds id 1,2,3,… and so on. Now consider you have id 1-90 for your 90 records and flush the table then the new record will be added with id 91. If you want to reset the id to 1 you should truncate table