Joshua Russo wrote:
> On Mon, Jul 20, 2009 at 9:23 AM, Matthias Kestenholz
> >
> wrote:
>
> thread locals have all the problems which are generally associated
> with global variables. They might be overwritten by
Matthias Kestenholz wrote:
> On Mon, Jul 20, 2009 at 9:26 AM, Bartłomiej Górny wrote:
>> [...]
>>> there is a cookbook recipe for achieving this sort of thing:
>>>
>>> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
>> Yep, that's exactly what I did :)
>>
>>>
On Mon, Jul 20, 2009 at 9:23 AM, Matthias Kestenholz <
matthias.kestenh...@gmail.com> wrote:
> thread locals have all the problems which are generally associated
> with global variables. They might be overwritten by other code, they
> make testing extremely difficult because the behavior of
On Mon, Jul 20, 2009 at 9:26 AM, Bartłomiej Górny wrote:
> [...]
>> there is a cookbook recipe for achieving this sort of thing:
>>
>> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
>
> Yep, that's exactly what I did :)
>
>>
>> That's deep in the category of
Matthias Kestenholz wrote:
> On Fri, Jul 17, 2009 at 4:24 PM, Bartłomiej Górny wrote:
>> Phil wrote:
>>> Hi Josh,
>>>
>>> unfortunately it seems that there is no way to do so. As you've
>>> noticed that correctly you can use request (request.user) in any place
>>> but model
On Sat, Jul 18, 2009 at 8:06 AM, Matthias Kestenholz <
matthias.kestenh...@gmail.com> wrote:
> If you really need to do that (or if you are just extremely lazy)
> there is a cookbook recipe for achieving this sort of thing:
>
> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
>
>
On Fri, Jul 17, 2009 at 4:24 PM, Bartłomiej Górny wrote:
>
> Phil wrote:
>> Hi Josh,
>>
>> unfortunately it seems that there is no way to do so. As you've
>> noticed that correctly you can use request (request.user) in any place
>> but model save.
>
> Yes, I bumped into the
I think you still have to pass the user, but you can tell if the item
is modified or new by whether its id has a value. If it's brand new
and has never been saved, then it won't have one.
--~--~-~--~~~---~--~~
You received this message because you are
Phil wrote:
> Hi Josh,
>
> unfortunately it seems that there is no way to do so. As you've
> noticed that correctly you can use request (request.user) in any place
> but model save.
Yes, I bumped into the same problem and came to the same conclusion. No
way. Unless you hack out something along
Hi Josh,
unfortunately it seems that there is no way to do so. As you've
noticed that correctly you can use request (request.user) in any place
but model save.
most likely that will be view:
---
if form.is_valid():
newObj = form.save(commit=False)
newObj.user =
10 matches
Mail list logo