Re: [Django] #11642: Specify default namespace in urls.py

2015-06-09 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  abki
 Type:  New feature  |   Status:  closed
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  url namespace| Triage Stage:  Accepted
  default|
Has patch:  0|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by knbk):

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


Comment:

 Fixed/superseded by #21927.

--
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/067.b04b63048024cc4e725599a46d796ffa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #11642: Specify default namespace in urls.py

2015-01-04 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  abki
 Type:  New feature  |   Status:  new
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|
Has patch:  0|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by apollo13):

 * cc: apollo13 (added)


--
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/067.4996549de338699e66639022e6ae5c39%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #11642: Specify default namespace in urls.py

2015-01-04 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  abki
 Type:  New feature  |   Status:  new
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|
Has patch:  0|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by apollo13):

 I think the patch from mrmachine is sensible. In a nutshell: specifying
 `app_name` on the url module should set the default `app_name` and
 `namespace` and everything in `include()` should override this default.

--
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/067.28753408fe8a883f6ba45efabe7f4df7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #11642: Specify default namespace in urls.py

2014-02-02 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  abki
 Type:  New feature  |   Status:  new
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|  Needs documentation:  1
Has patch:  0|  Patch needs improvement:  1
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by aaugustin):

 This may be superseded by #21927.

-- 
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/067.58879bbddbfcd2d51216a25f2dcb7787%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #11642: Specify default namespace in urls.py

2013-01-04 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  abki
 Type:  New feature  |   Status:  new
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|  Needs documentation:  1
Has patch:  0|  Patch needs improvement:  1
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by abki):

 * status:  assigned => new


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11642: Specify default namespace in urls.py

2012-12-20 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  abki
 Type:  New feature  |   Status:  assigned
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|  Needs documentation:  1
Has patch:  0|  Patch needs improvement:  1
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by abki):

 * status:  new => assigned
 * cc: amirouche.boubekki@… (added)
 * needs_better_patch:  0 => 1
 * needs_tests:  0 => 1
 * owner:  nobody => abki
 * needs_docs:  0 => 1


Comment:

 '''tl;dr''':
 - +1 for the current feature request
 - make it possible to have a default application namespace everytime

 '''Todo''':

 - maybe update for master
 - default application namespace everytime
 - more test
 - more documentation

 


 This would be nice and will IMO allow to simplify the url namespace thing
 while still keeping the mechanics for complex (and a bit weird setups)
 possible and for most usecases, people will say «Yay! it's actually what I
 need!».

 I did not understand the point of «application_namespace» until I wrote
 the following paragraph:

 Application namespace is useless inside the application itself, since
 application_ns:index will always resolve to current_app:index in this
 case, application_ns:index is equivalent to index. There is a case where
 «index» can be something else when you are inside another application, url
 patterns of application B, included in url patterns of application A, and
 have another view named «index», then the only way inside application B to
 get the index of application A in a *generic way* is to use the
 application A application namespace. This can be achieve otherwise, and I
 think that what is still used by people, you namespace the url name of so
 that you never have the same urls names something like «app-a-index» or
 «app-b-index» or better use semantic url names instead of generic naming.

 Using application namespace outside of the application is weird at best, I
 did not find a useful usecase for it, except maybe if an application C, is
 included in a project and expects application A to exists then getting
 {{{reverse}}} work needs the «default application for application
 namespace» mechanics and the fallback mechanics.

 Basically what OP says and with which I agree, is that most of the time
 (not to say all the time) the guy or gal writring app.urls knows which
 application_namespace to use for the application so including it in the
 urls.py makes sens. I will go further and say that namespace which becomes
 application_namespace should has a default of the application package
 name. Like @russellm points Python package names are most of the time
 unique among Python/Django and happens to be most of the time what we
 need. Allowing for providing another application_namespace introduce the
 replaceable application pattern, for instance: to allow the django
 favorites application market to flourish no one use the same package name
 (which I think allows for them to all be on PyPi) but they all agree to
 use the same url names, the first is named «django-kingking-favorites» &
 «kingking» as package name, it doesn't support ajax, so another
 application exists which implements the same «url scheme» its package is
 «princess», it's a drop-in replacement of «kingking». If they both use the
 default application namespace induced by the package name it will be
 possible to replace one app by another but it will be more difficult
 (rebuild the favorite application urls inside the project urls for
 instance).

 We cannot get the application package name right everytime (if the
 patterns are somewhere inside another package inside the application
 package) to avoid any complex code (!) I will use the urls.py package
 name, the author will be able to override this default with namespace
 variable.

 Saying -1 or 0 with the argument «this can be done with namespace url
 names» is not an argument, getting the «application namespace» feature is
 already useless given namespaced url names.

 I'm not sure about the «namespace» naming, maybe «application_namespace»
 is better, what do you think ?

 Here is a usecase, for overriding the application namespace provided by
 the application author outside the application:  There is a clash between
 several applications that use the same app namespace, but not the same url
 name schemes aka. they are not replaceable application this should be done
 with care since it can break the current app which might be using the
 

Re: [Django] #11642: Specify default namespace in urls.py

2012-08-20 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Core (URLs)  |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * component:  Core (Other) => Core (URLs)


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11642: Specify default namespace in urls.py

2011-10-06 Thread Django
#11642: Specify default namespace in urls.py
-+-
 Reporter:  mrmachine|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Core (Other) |  Version:  1.1
 Severity:  Normal   |   Resolution:
 Keywords:  url namespace| Triage Stage:  Accepted
  default|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by twoolie):

 * ui_ux:   => 0
 * easy:   => 0


Comment:

 why did this stagnate?

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11642: Specify default namespace in urls.py

2009-08-05 Thread Django
#11642: Specify default namespace in urls.py
-+--
  Reporter:  mrmachine   | Owner:  nobody   
Status:  new | Milestone:   
 Component:  Core framework  |   Version:  1.1  
Resolution:  |  Keywords:  url namespace default
 Stage:  Accepted| Has_patch:  0
Needs_docs:  0   |   Needs_tests:  0
Needs_better_patch:  0   |  
-+--
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 There's the start of an idea here, but it's not fully formed. For
 starters, there isn't a single concept of a 'namespace' - there's the
 application namespace and the instance namespace. What you refer to as the
 "default" namespace is the application namespace.

 Essentially, it sounds like you're proposing that include('myapp.urls',
 namespace='foo', app_name='bar') can be made easier for the case where an
 application knows it can provide a namespace. I agree with this. However,
 it isn't quite as simple as you describe. By definition, you can't define
 the instance namespace in the way you describe. However, you could define
 the application namespace in this way.

 There are some issues that need to be resolved here - for instance:
  * What happens when you define an application namespace, but not an
 instance namespace? This would happen if you ever did
 include('myapp.urls') when myapp.urls defines an app_name internally.
  * What takes precedence? An app_name defined in the include, or in the
 app itself?

 I'll mark this as accepted in principle - but there is some design work
 that still needs to be done. If you can resolve what happens in the edge
 cases, this shouldn't be too hard to implement (patches welcome).

-- 
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 post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---