Hi django users,

Currently writing an application in Django, I'm trying to use most of
the super-powered tools that Django provide.
One of them is generic views.

Use of object_list and object_detail works well, even with more
complex queries which I implement using a 'wrapper' view.

But now I'm blocked with object_create generic view, and can't find a
way to solve it.

My model is composed of several fields, some of them (creation_author
and creation_datetime) are not showed on the creation form because
they are not supposed to be editable by the application user.
It looks like this (simplified)
----
class Model(models.Model):
    name = models.CharField(max_length=100)
    description = models.TextField()
    creation_author = models.ForeignKey(User,
related_name='%(class)s_creation_author')
    creation_datetime = models.DateTimeField(editable=False)
----

To fill the creation_datetime field, I have created a save() method
directly in my models.py field and I think it should works.

My problem is with the creation_author field. How can i fill it using
the generic view? Because in my model save() method I have no
conscience of the user logged in, so I can't fill this field there.

ps : I'm not really sure my problem is there, but I think so...

-- 
Eric Veiras Galisson
http://www.veiras.info

--~--~---------~--~----~------------~-------~--~----~
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