Re: Model Blues - A Newbie's question

2008-02-06 Thread nikosk
Awesome. Thanks ... On Feb 5, 1:00 am, r_f_d <[EMAIL PROTECTED]> wrote: > Sure, you can do it, with two (at least) ways, one is to put this into > your model so it automatically happens, search the documentation or > users group for threadlocals middleware. The other way is to simply > put it in

Re: Model Blues - A Newbie's question

2008-02-05 Thread Rajesh Dhawan
> > 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 ? See: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser -Rajesh D --~--~-~--~~~---~--~~ You received this m

Re: Model Blues - A Newbie's question

2008-02-04 Thread r_f_d
Sure, you can do it, with two (at least) ways, one is to put this into your model so it automatically happens, search the documentation or users group for threadlocals middleware. The other way is to simply put it into your view as all views get the request, request.user will provide you with wha

Model Blues - A Newbie's question

2008-02-04 Thread nikosk
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_ti