Setting initial value of a autoincrement field in the database
170 views
Skip to first unread message
Anurag Baidyanath
unread,
Jun 19, 2014, 1:14:17 PM6/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I have a field in my models.py file as follows
ticket_id = models.AutoField(primary_key=True)
The value for the ticket_id column starts at 1. say i wanted it to start from some value (say 989) . how do i accomplish this using django?
C. Kirby
unread,
Jun 19, 2014, 1:47:51 PM6/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
You can't do it in Django directly. If you need to do it you have to go to your DB and use whatever functionality it supports to set an auto id start point.