On 12/2/06, Michael Patrick O'Keefe <[EMAIL PROTECTED]> wrote:
>
> SUMMARY OF PROPOSAL:
> For Django application modules, I find it easier to have the URL
> information for a view coupled with the function that is going to
> display that view. Why? This further supports the DRY (Don't Repeat
> Yourself) principle in my mind because you don't have to type both
> the view function definition as well as the "mapping" for that view
> to the relevant URL regular expression. My mind also works better
> such that it makes sense to keep view and URL mappings in one logical
> place as opposed to jumping back and forth between two files.

Can't say I'm crazy about this. I'm very fond of the separation of
view definition from view dispatch. As noted by James, it allows the
same set of views to be deployed in different URL spaces. If you want
to provide a 'default' URL deployment scheme, you can already provide
a urlpatterns snippet that can be included into a site-wide
urlpatterns object.

Another problem with your approach is the handling of curried
functions. A relatively common use case for me is to write a single
view function with some arguments preceeding the 'request' arguemnt;
then, in urlpatterns, I curry in the extra arguments. This approach
wouldn't be possible if decorators were used for specifying URLs.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to