Just a little more information. The autoField id is in the model class. Model_Form is a form based on this model class.
On Aug 11, 9:20 am, David <[email protected]> wrote: > Hello, > > I am trying to retrieve an autoField id value in my following code > when I update records. > > def update_record(request): > if request.POST: > form = Model_Form(request.POST) > if form.is_valid(): > form.save(pk=form.id, force_update=True) > > I got an error that "Model_Form" object has no attribute 'id'. > > Model_Form is a model-based form class that has an autoField id that > increases one by one. When I update a record, I need to give this > value. > > I even tried "pk=form.pk", however it did not work either. > > Any suggestions how to fix this? > > Thanks so much. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

