Thanks for the comments.
I wasn't aware of the ROOT_VIEW proposal (brand new to the mailing
list).
I couldn't tell from a quick read-over if ROOT_VIEW would allow me to
specify the URL for a view in the same place I define a view--the
functionality I'm really interested in--the thing that prompted me to
post. Certainly seems like some kind of "decorator" functionality could
enable that easily in a ROOT_VIEW world (or perhaps there's a better
way than decorators). All-in-all, ROOT_VIEW sounds like a good proposal
to me.
One point I wanted to clarify: the way I'm using the code I appended is
to get rid of the urls.py file in the app directory (i.e., place that
information in the views.py file). For the simple apps I've been making
so far, the relative urls for the app don't change though the point
where I drop the app into a sitewide url may change. Therefore, I'm not
proposing anything for the site-wide urls.py file which would set up
where an app plugs into a url. So if I had a blog app, the
mysite/urls.py file would map that to an appropriate place on the site
(say "/blog"), but I'd like to have an option to define my view and url
pattern right next to each other within the app:
@bind_to_url(_URL,r'^(?P<index>\d+)/')
def view_index(request, index):
pass
I'm not crazy about the _URL global variable, nor am I tied to this
implimentation. I just like the fact that I could say "here's the
relative URL pattern I want to associate with this view" and then
define the view right after.
So I'll go on record to say that whether it's this functionality I have
here, a ROOT_VIEW type of design, or something else, I see value in
having the option to define the url pattern in the same place as the
view function is defined.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---