#2104: Admin view paranoia limits re-use
------------------------------+---------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Admin interface | Version:
Severity: normal | Keywords:
------------------------------+---------------------------------------------
I'm trying to call admin views from my views to greatly simplify my code.
My efforts are frustrated by this style of view definition in
django.contrib.admin.views.main:
{{{
def useful_view_method(request):
# ...
useful_view_method = staff_member_required(usefulmethod)
}}}
Thanks to the wrapper, the method is useful only to the admin interface
unless I make a copy of it. Such a copy is inefficient, error-prone, and
requires checking each Django code update.
Making the unprotected view available as follows would let me wrap the
view myself to whatever protection level I see fit:
{{{
def _useful_view_method(request):
# ...
useful_view_method = staff_member_required(_useful_view_method)
}}}
On a similar line of thinking: {{{change_list}}} needlessly insists on
change permission. I'd like it to list regardless, as even mortals should
be able to ''view'' the table I've got in mind. I can have my
{{{change_stage}}} equivalent check permissions and then pass on to either
a read-only view method or the "official" {{{change_stage}}}, at least
once I can reach around the {{{staff_member_required}}} wrapper.
--
Ticket URL: <http://code.djangoproject.com/ticket/2104>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates
-~----------~----~----~----~------~----~------~--~---