Re: [Django] #16391: New URL tag for reversing urls with placeholder args/kwargs

2015-10-27 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
+-
 Reporter:  h.a.clifford@…  |Owner:  nobody
 Type:  New feature |   Status:  closed
Component:  Core (URLs) |  Version:  1.3
 Severity:  Normal  |   Resolution:  wontfix
 Keywords:  | Triage Stage:  Someday/Maybe
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-
Changes (by timgraham):

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


Comment:

 I haven't heard of much demand for this feature, so living as a third-
 party library seems okay to me.

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


Re: [Django] #16391: New URL tag for reversing urls with placeholder args/kwargs

2013-03-14 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
+-
 Reporter:  h.a.clifford@…  |Owner:  nobody
 Type:  New feature |   Status:  new
Component:  Core (URLs) |  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Someday/Maybe
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-
Changes (by aaugustin):

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


Comment:

 #2615 was a duplicate.

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




Re: [Django] #16391: New URL tag for reversing urls with placeholder args/kwargs

2012-09-29 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
+-
 Reporter:  h.a.clifford@…  |Owner:  nobody
 Type:  New feature |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Someday/Maybe
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-

Comment (by mitar):

 I add this code (with some improvements) [http://django-
 
missing.readthedocs.org/en/latest/templatetags.html#missing.templatetags.url_tags.urltemplate
 to my library].

-- 
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] #16391: New URL tag for reversing urls with placeholder args/kwargs

2012-07-19 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
+-
 Reporter:  h.a.clifford@…  |Owner:  nobody
 Type:  New feature |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Someday/Maybe
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-

Comment (by mitar):

 Maybe I am wrong. This simple version works quite nicely:

 {{{
 @register.simple_tag
 def urltemplate(viewname):
 urlconf = urlresolvers.get_urlconf()
 resolver = urlresolvers.get_resolver(urlconf)
 prefix = urlresolvers.get_script_prefix()

 possibilities = resolver.reverse_dict.getlist(viewname)

 if len(possibilities) != 1:
 # TODO: Template tags should not the throwing exceptions (only if
 TEMPLATE_DEBUG is true)
 raise NotImplementedError

 possibility, pattern, defaults = possibilities[0]

 if len(possibility) != 1:
 # TODO: Template tags should not the throwing exceptions (only if
 TEMPLATE_DEBUG is true)
 raise NotImplementedError

 result, params = possibility[0]

 for param in params:
 result = result.replace('%%(%s)s' % param, '{%s}' % param)

 return prefix + result
 }}}

-- 
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] #16391: New URL tag for reversing urls with placeholder args/kwargs

2012-07-19 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
+-
 Reporter:  h.a.clifford@…  |Owner:  nobody
 Type:  New feature |   Status:  new
Component:  Core (Other)|  Version:  1.3
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Someday/Maybe
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-
Changes (by mitar):

 * cc: mmitar@… (added)


Comment:

 Without the support in `reverse` which would allow caller to skip regex
 check (but the default would of course still be to check it) it would be
 hard to implement such a tag (which I am also missing) without duplicating
 code (and thus breaking the DRY principle).

 +1 for at least support for `reverse` to have an argument to skip regex
 check. Then tag is simple to implement.

-- 
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] #16391: New URL tag for reversing urls with placeholder args/kwargs

2011-09-26 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
--+--
   Reporter:  h.a.clifford@…  |  Owner:  nobody
   Type:  New feature | Status:  new
  Milestone:  |  Component:  Core (Other)
Version:  1.3 |   Severity:  Normal
 Resolution:  |   Keywords:
   Triage Stage:  Someday/Maybe   |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
  UI/UX:  0   |
--+--
Changes (by jacob):

 * stage:  Design decision needed => Someday/Maybe


Comment:

 I agree with jezdez - this is something that'd be best done in a third-
 party app. I'm not going to close this ticket, but I am going to stick it
 in "someday/maybe" purgatory. I think it's a good idea, but the way to get
 this in Django is to start with a solid third-party implementation and
 then push to get that in.

 Thanks!

-- 
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] #16391: New URL tag for reversing urls with placeholder args/kwargs

2011-08-17 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
-+-
   Reporter: |  Owner:  nobody
  h.a.clifford@… | Status:  new
   Type:  New|  Component:  Core (Other)
  feature|   Severity:  Normal
  Milestone: |   Keywords:
Version:  1.3|  Has patch:  0
 Resolution: |Needs tests:  0
   Triage Stage:  Design |  Easy pickings:  0
  decision needed|
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by anonymous):

 To follow up on this, would also be useful with URI templates:

 http://code.google.com/p/uri-templates/
 http://bitworking.org/projects/URI-Templates

-- 
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] #16391: New URL tag for reversing urls with placeholder args/kwargs

2011-08-12 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
-+-
   Reporter: |  Owner:  nobody
  h.a.clifford@… | Status:  new
   Type:  New|  Component:  Core (Other)
  feature|   Severity:  Normal
  Milestone: |   Keywords:
Version:  1.3|  Has patch:  0
 Resolution: |Needs tests:  0
   Triage Stage:  Design |  Easy pickings:  0
  decision needed|
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-
Description changed by ramiro:

Old description:

> It would be incredibly useful if Django supported a placeholder url tag:
>
> usage would be similar to url, but with args/kwargs that don't match the
> url regex.
>
> E.g: {% urlplaceholder User username='<%username%>' %}, where my url rule
> only allows a-z usernames.
> (Currently, you can't do this).
>
> This isn't a huge change which is why I'm suggesting it (line 325
> urlresolves does the regex check after substituting in the values)
>
> Why is this useful? It would allow *easy* generation of javascript
> templates on the frontend - all the current methods seem to involve
> reversing the urls with javasacript which is hardly in keeping DRY.
>
> Example:
>
> 
> ' %}'>
> 
> 
> 

New description:

 It would be incredibly useful if Django supported a placeholder url tag:

 usage would be similar to url, but with args/kwargs that don't match the
 url regex.

 E.g: `{% urlplaceholder User username='<%username%>' %}`, where my url
 rule only allows a-z usernames.
 (Currently, you can't do this).

 This isn't a huge change which is why I'm suggesting it (line 325
 urlresolves does the regex check after substituting in the values)

 Why is this useful? It would allow *easy* generation of javascript
 templates on the frontend - all the current methods seem to involve
 reversing the urls with javasacript which is hardly in keeping DRY.

 Example:
 {{{
 
 ' %}'>
 
 
 
 }}}

--

-- 
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] #16391: New URL tag for reversing urls with placeholder args/kwargs

2011-08-12 Thread Django
#16391: New URL tag for reversing urls with placeholder args/kwargs
-+-
   Reporter: |  Owner:  nobody
  h.a.clifford@… | Status:  new
   Type:  New|  Component:  Core (Other)
  feature|   Severity:  Normal
  Milestone: |   Keywords:
Version:  1.3|  Has patch:  0
 Resolution: |Needs tests:  0
   Triage Stage:  Design |  Easy pickings:  0
  decision needed|
Needs documentation:  0  |
Patch needs improvement:  0  |
  UI/UX:  0  |
-+-

Comment (by jezdez):

 This sounds like a great idea for a 3rd party app, that would provide
 helpers for JavaScript development.

-- 
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.