I need the default value of a field in a model to be the id of the
user creating the new instance of the object the model is modeling
( am I making sense at all?)

i.e. :
class Article(models.Model):
    category = models.ForeignKey(Category)
    title = models.CharField(max_length=200)
    sub_title = models.CharField(max_length=200)
    intro_text = models.TextField(blank=True)
    main_text = models.TextField()
    pub_date = models.DateTimeField(default=datetime.now)
    author = models.ForeignKey(User)

When someone is creating a new Article in the admin app I want the new
Article's author field to be the user's id.

Is that possible ?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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