Opened 18 years ago
Closed 16 years ago
#4516 closed (duplicate)
newforms-admin: Move AdminModel's URL handling into a method
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | nfa-someday handle_url | |
Cc: | schlaber@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After some discussions on django-developers, this patch moves ModelAdmin's URL handling into a separate method that can then be overridden by subclasses to provide extra hooks into the model's URL scheme.
Attachments (1)
Change History (8)
by , 18 years ago
Attachment: | handle_url.diff added |
---|
comment:1 by , 17 years ago
Version: | SVN → newforms-admin |
---|
+1. I have already overridden __call__
and it is pretty nasty and I end up losing the dependancy checks. However, I think the new method needs to be improved slightly. Based on the patch given here if I override
handle_url
I will still need to check for None and display the changelist page then call the parent. If I call the parent first then
change_view
will always have to run before I can check for my own URL. It seems to me that the URL mapping in
AdminSite
and
ModelAdmin
need to be refactored a little bit for better customization.
comment:2 by , 17 years ago
Oh yeah, almost forgot. I am writing an app called djog that allows for some URL mapping through a class similar to how AdminSite
and
ModelAdmin
work. I have hooked the views (aka methods in the class) to the app's url.py. Take a look here: http://dev.oebfare.com/projects/djog/browser/trunk/djog/urls.py. This might prove to be a better way. Not sure, since my implementation with djog has been real world tested yet.
comment:3 by , 17 years ago
It's been a while since I had thought about this. Malcolm and I had some discussion a while back about expanding how URL resolution happens, and if anything comes of that, this problem would be a bit easier to solve. If it works the way I think it will, it would even make the override problem easier to deal with. I figure this ticket can just be put on hold for now, while we see if anything comes of the RULResolver stuff. And no, I'm not just hoping someone else will do it, I'm actively looking into it.
comment:4 by , 17 years ago
Keywords: | nfa-someday added; newforms-admin removed |
---|
This ticket isn't critical to the merge of newforms-admin. Tagging with nfa-someday.
comment:5 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:6 by , 17 years ago
Cc: | added |
---|
comment:7 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Simple patch to make ModelAdmin URL handling more flexible for subclasses