python - set auto increment initial value for id in django model -
i have model 1 field. name.
class city(models.model): <br> name = models.charfield(max_length=30)
django sets id
end id
, description
field in sql.
but id
field increment 1. want start 1000 , increment one.
is there way in django?
you use initial data give models ids 1000. think if first models pk 1000 django continue 1001.
or create attribute called custom_id 1000+id. way have additional field in db work.
Comments
Post a Comment