W dniu 24.10.2013 18:33, Gavin Wahl pisze:
I really like the idea of implementing this as a url pattern decorator.
This seems similar to Alex Gaynor's talk about everything being a view.
It's more flexible than a middleware because you can decorate any part
of the urls tree, such as the patterns for a single reusable app.

     urls = decorate_recursively(login_required, patterns(...))

This is actually possible to implement today, see snippets like
https://djangosnippets.org/snippets/2532/. The code required is kind of
ugly, so I think it would benefit from an implementation in core.

There is also the django-decorator-include package:
https://github.com/jeffkistler/django-decorator-include and it contains DecoratedPatterns class: https://github.com/jeffkistler/django-decorator-include/blob/cc50e071e51af63e24583dc7274547796478fec3/src/decorator_include/__init__.py#L10 .

--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/529752E0.5020603%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to