foo.updater = request.user ?
In each view of Admin?
Todd O'Bryan wrote:
> You don't want to save the user id explicitly. Your model should be
>
> updater = models.ForeignKey(User)
>
> Since you'll be setting the updater (or some other better word) from
> within a view, you'll have access to t
You don't want to save the user id explicitly. Your model should be
updater = models.ForeignKey(User)
Since you'll be setting the updater (or some other better word) from
within a view, you'll have access to the currently logged-in user.
Just do
foo.updater = request.user
and you're good t
Ok, I agree.
But if I want to save the ID of the user logged-in in a field in my
table, I can't.
Basically in almost of my tables I will have this fields:
ip (IP Address)
last_update (Record last update)
user_id (User id that make the change)
Don Arbow wrote:
> On Jun 13, 2006, at 7:58 AM, [EMA
Ok,
I will give a try.
Thanks all.
Nuno
Quoting Michael Radziej <[EMAIL PROTECTED]>:
>
> Don Arbow wrote:
>> Then in the view that calls the template, you determine if the user
>> is authorized to edit the field.
>
> You don't have a view function with an Admin page ... that doesn't work.
>
> B
Don Arbow wrote:
> Then in the view that calls the template, you determine if the user
> is authorized to edit the field.
You don't have a view function with an Admin page ... that doesn't work.
But you could just redirect the Admin page to a view function (using the URL
config) and from the
On Jun 13, 2006, at 7:58 AM, [EMAIL PROTECTED] wrote:
>
> I have a problem then.
> I just need to test if a user have permission to edit a field in
> Admin.
>
Then in the view that calls the template, you determine if the user
is authorized to edit the field. You can test the authorization i
I have a problem then.
I just need to test if a user have permission to edit a field in Admin.
Quoting Michael Radziej <[EMAIL PROTECTED]>:
>
> [EMAIL PROTECTED] wrote:
>> Hi,
>> I need the access to the logged-in user object in a model, to verify
>> permissions.
>> How I do that?
>
> You can't.
[EMAIL PROTECTED] wrote:
> Hi,
> I need the access to the logged-in user object in a model, to verify
> permissions.
> How I do that?
You can't. The model is decoupled from the http stuff and has no way to access
it.
Such kind of validations must be done in the Manipulator or view.
There are
8 matches
Mail list logo