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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -