On Thu, 2008-02-14 at 15:49 +0530, Sairam Krishnamurthy wrote:
> Hi,
> 
> I need to specify an initial value for for an AutoField. Is there a
> way of doing it? 

You will need to manually tell the database to update its internal
counter. AutoField values are managed by the database. How you do this
depends on the database backend you are using. Django doesn't provide a
specific API for this, although you could draw some inspiration from the
sequence_reset_sql() function in each database backend
(django.db.backends.*.operations) to see what the commands are and then
use your database manual to go from there

Malcolm

-- 
Save the whales. Collect the whole set. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to