On 1/11/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> Create a ForeignKey field that references
> django.contrib.auth.models.User or whatever. This field cannot be
> editable=False, or the manipulator will skip over it when you save the
> object. Exclude the field from your admin screens using the fields
> attribute of the new inner Admin class. At this point, the user field
> is techincally editable, but not displayed. Then, the admin add/change
> views (controller in your terminology) call a method of the inner
> Admin class to set the correct user in new_data or something before
> the manipulator validates and saves it. The details obviously need to
> be worked out, but I think this is a pretty clean solution. Nothing
> changes but admin views, and the inner Admin class. No more coupling.

Oooh, I like this. Putting methods in the inner Admin class is very clean.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply via email to