Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2014-02-07 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:  wontfix
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by mjtamlyn):

 For the sake of completeness, you may also be interested in this package:
 https://github.com/mjtamlyn/django-cbvpatterns

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.05de2169024e127525de4db702a4120c%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2014-02-06 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:  wontfix
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by russellm):

 This was considered and rejected as part of the original CBV work. See
 [https://code.djangoproject.com/wiki/ClassBasedViews the wiki] for the
 rationale.

 Short version: it's all about keeping a simple contract for urlpatterns.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.d6fceace09791ed58b49feff9ecab326%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2014-02-06 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:  wontfix
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Gwildor):

 I'm sorry for commenting on a closed ticket, but I can't seem to find a
 new ticket for this subject. Has a new ticket been opened yet?

 My quick two cents on this subject: perhaps with the eye on the future the
 way the CBV's work should be changed, which I think is a backwards
 compatible change. At the moment, the CBV's actually function as FBV's in
 the urls, because the {{{as_view()}}} method, as the name states, returns
 a function which is ''then'' called with the url dispatching. My proposal:
 when url dispatching happens, call it as a FBV when it's a view (this way
 FBV's and CBV.as_view() are both still supported as they should). If it's
 a class, initialize and call {{{dispatch()}}} on it ({{{__init__}}} should
 probably be rewritten for this, maybe dispatch can be called directly from
 the {{{__init__}}} if it's a class). If it's a class ''instance'', call
 {{{dispatch()}}} on it. This way, you can still pass {{{initkwargs}}} to
 the CBV in the urls, but the whole thing is more clear and generally makes
 more sense in my opinion. Python's {{{inspect}}} module can help with
 these things to check whether it's a function, a class or a class
 instance. A {{{__call___}}} method on the {{{View}}} class might also come
 in handy here.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.c2d3bb668546fb53e0236aae9076b1a2%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-21 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:
 Type:   |   Status:  closed
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:  wontfix
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timo):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 Ok, let's open a new ticket for the CBV urlpatterns idea so it's not mixed
 with other conversation.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.8569a2356e906b395684871763cc1076%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-21 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:
 Type:   |   Status:  new
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by loic84):

 * status:  assigned => new
 * owner:  loic84 =>


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.2c152f9cb5f10d8f50fa9cd61cc8c145%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-21 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:  loic84
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by loic84):

 That would be the third -0 and I don't think I've received any positive
 feedback so far, so I don't think my implementation is worth pursuing.

 If I understood properly @mjtamlyn mentioned on IRC that he wants to
 investigate the CBV `urlpatterns` idea; I guess we should keep this ticket
 open to track this effort.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.21979b6225b3648eb3a7ea7e2383cb14%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-21 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:  loic84
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by timo):

 @loic84 - do you want to write a quick email to the mailing list and try
 to get a consensus on this?

 I tend to think -0 as well because "There should be one-- and preferably
 only one --obvious way to do it" and if you are using `as_view()` with
 parameters on some views, allowing things to be mixed isn't ideal. I'm
 sympathetic of the problem though.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e6b1ac8b8eb84b2f13155a5b1ecf7bee%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-12 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:  loic84
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by loic84):

 I see the `as_view` duck-type as an implementation agnostic hook into
 `urlpatterns`, one could for instance bring his own CBV implementation yet
 be compatible.

 Regarding a "cbv version of patterns", that's something worth studying,
 but I think it would add a fair amont of complexity if we need to deal
 with different types of `urlpatterns`. In a way the pattern reminds me of
 https://github.com/jacobian/django-multiurl, which I really wanted handled
 inside core at the time.

 I do share the "just callables" concern of @aaugustin; however, having
 embraced CBV, I can testify that my `urls.py` look pretty terrible at this
 point, so maybe it's one of those cases where practicality should beat
 purity?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.1c05cc811358132c789eb13fcfd116f1%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-12 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:  loic84
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by aaugustin):

 Paraphrasing what I said on IRC yesterday:

 - This proposal breaks (extends) the contract that views are "just"
 callables; I'm quite attached to this design.
 - It introduces more than one way to do it".
 - It adds coupling between the URLresolver and the current implement of
 CBVs.

 I'm -0.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.3683f291743fcce21ccf65d09804b33b%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-12 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:  loic84
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by mjtamlyn):

 Not sure about this - I can see it being useful but I'm tentative to
 change the explicit api with something which is frankly magical. What I
 might find interesting is a cbv version of patterns which does clever
 things, but also perjhaos doesn't do the clever things the normal one does
 too handle string paths etc.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.d8e447809fb1cee254967e03d99bc12d%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21595: Automatically call as_view() when urlpatterns encounter a CBV.

2013-12-11 Thread Django
#21595: Automatically call as_view() when urlpatterns encounter a CBV.
-+-
 Reporter:  loic84   |Owner:  loic84
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  master
Component:  Core (URLs)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by loic84):

 * status:  new => assigned
 * needs_better_patch:   => 1
 * needs_tests:   => 0
 * owner:  nobody => loic84
 * needs_docs:   => 1
 * has_patch:  0 => 1


Comment:

 Tentative patch: https://github.com/loic/django/compare/ticket21595.

 I'll write the docs if this gets accepted.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.837b841fbcca6b8242fc359a333170b9%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.