On 19 ago, 22:03, Russell Keith-Magee <russ...@keith-magee.com> wrote:
> The instance will exist, but the author_id won't. Unless you are
> manually allocating the primary key, the primary key is allocated by
> the database at the time of object save, which means you won't be able
> to determine the primary key until *after* the object is saved (which
> is obviously too late to determine the database allocation).

Just my 2 cents, but by his model definition:

class Tweet(models.Model):
    author_id = models.IntegreField()
    text = models.TextField()

I believe an Author is pre-condition for a Tweet. As such, wouldn't
author_id already exist?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to