There is a certain model in django.
When I tested it, I added and deleted records in the admin panel, only one record was left there. In the view I need to get this record, I thought I would get it through get(pk=1)
, but as it turned out she had pk equal to 6. That is, those records I entered for the test were not completely removed?
Can I somehow update the state of the table so that the element has pk = 1
?
PS Tried through objects.all()[:1]
, also does not work ...
MyModel.objects.all().first()
- for getting the first object - Andrey