I have been working in Django for about a week now so I don't have much idea on the following. I need to create a sequence for a field in my model and postgres database that auto increments starting at 1000. So it would list like: 1000, 1001, 1002, etc....
From what I have researched so far I would need to extend the save function and check the previous value in the db.
The end result is to be able to post to an API using this model and this field increments like above.
class MyModel(AuditMixin, models.Model):
order_number = models.IntegerField(blank=False)
def get_number(self):
return ???
def save(self):
??? .save()