On Jun 1, 8:20 am, "Yuri Baburov" <[EMAIL PROTECTED]> wrote: > So, how about an idea of adding request, object, and action to > ModelAdmin instances in newforms-admin code rather than in user code > and refactoring newforms-admin code based on this decision?
We've used that exact trick recently at work, for implementing finely grained permissions where a user should only be able to select from a subset of the available options in a foreign key relationship box. To do this, you need to use the formfield_for_dbfield method to alter the choices for that particular field based on the current request.user object. We solved it the same way you did - by stashing the request object at the beginning of the change_view method - so it would be nice if newforms admin did that for us. Cheers, Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
