Re: Getting logged in username in admin

2009-03-20 Thread Joshua Partogi
Thanks Alex. It worked beautifully now. Regards, On Mar 20, 12:43 am, Alex Gaynor wrote: > On Thu, Mar 19, 2009 at 9:32 AM, Joshua Partogi wrote: > > > > > > > Dear all, > > > How do I get the current logged in user to be used and inserted to a

Re: Getting logged in username in admin

2009-03-19 Thread Alex Gaynor
On Thu, Mar 19, 2009 at 9:32 AM, Joshua Partogi 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 =

Getting logged in username in admin

2009-03-19 Thread Joshua Partogi
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