Joshua Russo wrote:
> On Mon, Jul 20, 2009 at 9:23 AM, Matthias Kestenholz
> mailto: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 e
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 :)
>>
>>> That's deep in the cate
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 method
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 'give them rope to hang
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 save.
>> Yes, I bumped
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
>
> Tha
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 same problem and came t
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 subscribe
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 t
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 = request.u
I think I might be overlooking something simple here. I have a set of
4 fields in almost every table (user create & modified and date create
& modified). The date (datetime) is easy with auto_now and
auto_now_add options.
The user has been much trickier. I can't figure out how (if possible)
to ge
11 matches
Mail list logo