2006/1/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> Hi folks,
> Yes, I'm bringing this issue again, please don't throw things at me !
>
> Basically, I would want to open a discussion on these subjects so as to
> define a clean solution to this problem, if at least possible.
>
> I think I'm gonna give some use cases that should, in my very humble
> opinion, be fulfilled by Django :
>
> - CurrentUser:
> In a multi-user content management system (cms), the client sometimes
> (well, for every project I've been working on, this has been a client
> will, but it might be french-client-specific) want to keep track of the
> author, or poster of a document.
> The current django state on the subject is to create a ForeignKey on
> meta.Users, and have the author to select himself in the list.
> This has two drawbacks :
> 1/ the user has to do something that should be dealt with by the system
> (since he is already authentified)
> 2/ this system allows one to specify another user than him (either on
> purpose or by mistake)
> One could enforce this by writing custom views, but then you can't use
> provide your users with the admin interface
> Related tickets : 1132 [1] and 1164 [2]
>
I was thinking that this has nothing to do in the model. So maybe this
should be done in the controller, in our case by the admin site. So
*maybe* a solution would to be able to say something like this :

author = meta.ForeignKey(meta.User)

[...]

admin=Admin(
    [...]
    fill_with_current_user=('author',)
)

This would allow us to write the directive in the model file, but have
it executed in the controller.
This is somehow inconsistent with the way auto_now and auto_now_add
are used, but these don't depend on the request object.

Any feeling about this anyone ?

--
Brice Carpentier aka Br|ce

Reply via email to