On 6/7/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
> I'm running into this problem/limitation in trying to fix
> http://code.djangoproject.com/ticket/4450 -- the previous (trunk)
> admin overrides the admin URLconf value for "/auth/user/" as a special
> case, and newforms-admin doesn't do that yet. So there needs to be a
> hook in ModelAdmin for overriding the URL parsing behavior.

This probably sounds bad, but I'm glad I'm not the only one who's
missing something.

> It's currently implemented in ModelAdmin.__call__(), but that method
> does some other things that you shouldn't have to duplicate. So, maybe
> this could be fixed by adding a small hook in there -- handle_url(),
> or something. Any thoughts?

I admit I haven't done much work or testing with newforms-admin yet,
so I'm not sure how would be best. Looking at ModelAdmin.__call__(), I
wonder if those that if/elif section could reuse something from
urlpatterns. After all, it's just checking URLs and delegating to
views, something we already have a solid system for.

I doubt all of URLconf is needed, but maybe a list of 2-tuples
containing a regular expressions and a callable. Given that
ModelAdmin.__call__ currently passes parts of the URL to each view, it
would include the same kind of group captures that URLconf currently
uses.

I guess I don't know if all of that is necessary. Maybe just moving
that if/elif section to a handle_url() method would be simple enough.
Then subclasses can just override it and use super() to tie into the
stock views.

I guess I'm not sure exactly how would be best, but it's essentially
just a URLconf, so there ought to be something there that can be
reused.

-Gul

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to