I think what Rach is suggesting is different from @require_GET,
@require_POST, etc. The patch essentially makes a view invisible if
the predicate function returns False.

I'm not sure this would be good for inclusion to django, since you are
tying url resolution to application state .  This could have negative
implications, especially for performance.  On top of that, the same
functionality could be achieved by creating a function/class to route
the request further after django has initially routed the request.
This would be preferable because the performance hit would be isolated
to the resolved routing function/class.



On Wed, May 22, 2013 at 2:37 PM, Jacob Kaplan-Moss <[email protected]> wrote:
> I'm not sure I understand what you're proposing here. How is this
> different from @require_GET, @require_POST, and friends?
>
> Jacob
>
> On Wed, May 22, 2013 at 11:05 AM, Rach Belaid <[email protected]> wrote:
>> I just did a pull request resulting of my last Django sprints for
>> adding a new feature in Django.
>>
>> https://code.djangoproject.com/ticket/20479
>>
>> The idea is being able to have more control on the url resolving
>> process.
>>
>> I have no merit behind the idea of predicate. Predicate is one of my
>> favorite feature in Pyramid/Pylons to allow more complex and flexible
>> routing.
>>
>> I will be curious about feebacks? Do you like this idea of features ?
>>
>> The implementation is probably imperfect so don't be too harsh ;) we
>> can always fix the implementation.
>>
>> For people unaware about what is a predicate, I advice to check the
>> pyramid doc here:
>> http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/viewconfig.html#predicate-arguments
>>
>> --
>> 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?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to