On 4/18/06, Mathieu Blondel <[EMAIL PROTECTED]> wrote:
> When one saves an object with the save() method, a common need is to
> get the id corresponding to the row that has just been inserted.
>
> p = polls.Poll(...)
> p.save()
> p.id # is set to None
>
> So here are two possible solutions,
> 1)
Strange, for me it works like said in 1). After the new object is
saved, the id field is not None, but the true id of the object in
database. Maybe I did not understand something?
Also, if you look at the tutorial at
http://www.djangoproject.com/documentation/tutorial1/ it says:
# No polls are
Hi,
I'm a new comer to Django so please forgive me if the following has
already a solution.
When one saves an object with the save() method, a common need is to
get the id corresponding to the row that has just been inserted.
p = polls.Poll(...)
p.save()
p.id # is set to None
So here are two