Re: pass entire request object to urlresolver

2016-06-15 Thread Elephant Liu
Yes! That's it.
Thank you.

在 2016年6月15日星期三 UTC+8下午10:50:44,Tim Graham写道:
>
> I believe that's implemented as part of Marten's URL dispatcher work: 
> https://github.com/django/django/pull/5578.
>
> On Tuesday, June 14, 2016 at 8:20:59 AM UTC-4, Elephant Liu wrote:
>>
>> Hi all, I'd like to introduce a new feature to django urlresolver.
>>
>> Currently, django urlresolver can only handle the path_info field of 
>> request object.
>>
>> code from django.core.handlers.base.BaseHandler.get_response
>> callback, callback_args, callback_kwargs = resolver.resolve(request.
>> path_info) 
>>
>> I'd like to pass the entire request object to urlresolver so that I 
>> can implement more complex url resolving logic.
>> For example:
>> * base on path and http method
>> * base on path and http header (such as User-Agent)
>>
>> I'd like to make a demo if you agree with my idea.
>>
>> At last, forgive my bad English.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/b1d44b06-ae89-4d74-a8b1-8a1dec4f5e83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pass entire request object to urlresolver

2016-06-15 Thread Tim Graham
I believe that's implemented as part of Marten's URL dispatcher work: 
https://github.com/django/django/pull/5578.

On Tuesday, June 14, 2016 at 8:20:59 AM UTC-4, Elephant Liu wrote:
>
> Hi all, I'd like to introduce a new feature to django urlresolver.
>
> Currently, django urlresolver can only handle the path_info field of 
> request object.
>
> code from django.core.handlers.base.BaseHandler.get_response
> callback, callback_args, callback_kwargs = resolver.resolve(request.
> path_info) 
>
> I'd like to pass the entire request object to urlresolver so that I 
> can implement more complex url resolving logic.
> For example:
> * base on path and http method
> * base on path and http header (such as User-Agent)
>
> I'd like to make a demo if you agree with my idea.
>
> At last, forgive my bad English.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/752bec82-b5e4-4527-8f47-2a41cfbcab7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: missing feature, View permission for django admin

2016-06-15 Thread Tim Graham
Just to give you my perspective so you don't feel ignored, after the 1.10 
release is a better for reviewing and merging larger features than right 
now.

On Wednesday, June 15, 2016 at 7:40:44 AM UTC-4, Olivier Dalang wrote:
>
> Hi,
>
> I worked a bit on this feature lately. I rebased PetrDlouhy's great work 
> (PR 5297 ) onto master in a 
> new PR 6734 .
>
> I think everyone agrees this is a very useful addition to the admin. If we 
> also agree on the implementation; I suggest to merge as soon as possible so 
> that we can benefit from as much testing as possible before release, and 
> more importantly so that third parties have time to adapt their packages 
> (grappelli...).
>
> Please let me know if there's anything more I can do.
>
> I'm really looking forward for this feature, and judging from the 
> frequency this topic is raised on the ml, I'm not the only one ;)
>
> Thanks a lot, 
>
> Olivier
>
>
>
> On 31 May 2016 13:20, "Tim Graham"  
> wrote:
>
>> This feature is tracked in https://code.djangoproject.com/ticket/8936. 
>> Feel free to review, contribute to, or test the patch if you want to help.
>>
>> On Tuesday, May 31, 2016 at 8:26:41 AM UTC-4, Ander Ustarroz wrote:
>>>
>>> I am surprised this feature is not implemented yet, at the moment when 
>>> we create a new model  three permissions are created automatically for the 
>>> admin panel:
>>>
>>>- *add_permission*
>>>- *change_permission*
>>>- 
>>> *delete_permission *
>>>
>>> We really missing the *view_permission* here, when we want staff to be 
>>> able to see the content but not being able to modify it. Searching a bit, 
>>>  you can find many different implementations to achieve this, but all of 
>>> them are extending django.contrib.*admin.**ModelAdmin*. Having so many 
>>> people rewriting these methods in my opinion is a clear sign that this 
>>> feature should be part of the core. 
>>>
>>> Regards,
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com .
>> To post to this group, send email to django-d...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/cfe9b399-2486-4dff-97e6-1c3f94b13f65%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4c529e2a-4cd3-4930-b532-c0d0a10c05cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: missing feature, View permission for django admin

2016-06-15 Thread Olivier Dalang
Hi,

I worked a bit on this feature lately. I rebased PetrDlouhy's great work
(PR 5297 ) onto master in a new PR
6734 .

I think everyone agrees this is a very useful addition to the admin. If we
also agree on the implementation; I suggest to merge as soon as possible so
that we can benefit from as much testing as possible before release, and
more importantly so that third parties have time to adapt their packages
(grappelli...).

Please let me know if there's anything more I can do.

I'm really looking forward for this feature, and judging from the frequency
this topic is raised on the ml, I'm not the only one ;)

Thanks a lot,

Olivier



On 31 May 2016 13:20, "Tim Graham"  wrote:

> This feature is tracked in https://code.djangoproject.com/ticket/8936.
> Feel free to review, contribute to, or test the patch if you want to help.
>
> On Tuesday, May 31, 2016 at 8:26:41 AM UTC-4, Ander Ustarroz wrote:
>>
>> I am surprised this feature is not implemented yet, at the moment when we
>> create a new model  three permissions are created automatically for the
>> admin panel:
>>
>>- *add_permission*
>>- *change_permission*
>>-
>> *delete_permission *
>>
>> We really missing the *view_permission* here, when we want staff to be
>> able to see the content but not being able to modify it. Searching a bit,
>>  you can find many different implementations to achieve this, but all of
>> them are extending django.contrib.*admin.**ModelAdmin*. Having so many
>> people rewriting these methods in my opinion is a clear sign that this
>> feature should be part of the core.
>>
>> Regards,
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/cfe9b399-2486-4dff-97e6-1c3f94b13f65%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAExk7p0G%3DCGebL8y084ea9f3zgSjmWu%3DmWCm5JsbHyEbK6ionw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.