Re: CMS application: auto-setting the post author

2008-06-23 Thread Alex Koshelev
Try this http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On Jun 17, 6:02 am, saxon75 <[EMAIL PROTECTED]> wrote: > I'm working on a CMS application and had a question about > automatically setting certain model fields. > > Suppose I have the following model (this is simplified from

Re: CMS application: auto-setting the post author

2008-06-23 Thread Jashugan
On Jun 16, 9:46 pm, "Ronny Haryanto" <[EMAIL PROTECTED]> wrote: > Another way (which I personally prefer because it's more explicit and > clear), is to do it in the view. Don't show the author field in the > form, because we want to automatically add it before saving. > > def add_item(request): >

Re: CMS application: auto-setting the post author

2008-06-16 Thread Ronny Haryanto
On Tue, Jun 17, 2008 at 9:02 AM, saxon75 <[EMAIL PROTECTED]> wrote: > I'm working on a CMS application and had a question about > automatically setting certain model fields. > > Suppose I have the following model (this is simplified from the actual > application): > > class Item(models.Model): >

Re: CMS application: auto-setting the post author

2008-06-16 Thread Ronny Haryanto
On Tue, Jun 17, 2008 at 9:02 AM, saxon75 <[EMAIL PROTECTED]> wrote: > > I'm working on a CMS application and had a question about > automatically setting certain model fields. > > Suppose I have the following model (this is simplified from the actual > application): > > class Item(models.Model): >

CMS application: auto-setting the post author

2008-06-16 Thread saxon75
I'm working on a CMS application and had a question about automatically setting certain model fields. Suppose I have the following model (this is simplified from the actual application): class Item(models.Model): author = models.ForeignKey(User) created = models.DateTimeField() title