Thanks Alex.

It worked beautifully now.

Regards,

On Mar 20, 12:43 am, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Thu, Mar 19, 2009 at 9:32 AM, Joshua Partogi <joshua.j...@gmail.com>wrote:
>
>
>
>
>
> > Dear all,
>
> > How do I get the current logged in user to be used and inserted to a model?
> > from django.db import models
> > from django.contrib.auth.models import User
>
> > class News(models.Model):
> >    creator = models.ForeignKey(User)
>
> > I want the creator field to be the current logged in user.
>
> > Thank you very much.
>
> > --
> > If you can't believe in God the chances are your God is too small.
>
> > Read my blog:http://joshuajava.wordpress.com/
> > Follow me on twitter:http://twitter.com/jpartogi
>
> The admin has a specific method you can overide just for 
> this:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-model-se...
>
> The example should make it pretty clear what you need to do.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~---------~--~----~------------~-------~--~----~
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 
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