Re: [Django] #12199: Give 'firstof' tag ability to assign result to context

2015-04-14 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+
 Reporter:  tiliv |Owner:  craigls
 Type:  New feature   |   Status:  closed
Component:  Template system   |  Version:  master
 Severity:  Normal|   Resolution:  fixed
 Keywords:  firstof, as, context  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"75bc5bc634e90d5ccd2d7fc324df878dc5d4ce5d" 75bc5bc6]:
 {{{
 #!CommitTicketReference repository=""
 revision="75bc5bc634e90d5ccd2d7fc324df878dc5d4ce5d"
 Fixed #12199 -- Added the ability to use "as" with the firstof template
 tag.
 }}}

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


Re: [Django] #12199: Give 'firstof' tag ability to assign result to context

2015-04-13 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+
 Reporter:  tiliv |Owner:  craigls
 Type:  New feature   |   Status:  assigned
Component:  Template system   |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  firstof, as, context  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by craigls):

 * owner:  nobody => craigls
 * status:  new => assigned


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


Re: [Django] #12199: Give 'firstof' tag ability to assign result to context

2013-05-14 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+
 Reporter:  tiliv |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  Template system   |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  firstof, as, context  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by mark0978@…):

 There is another instance where the AS keyword would be very useful

 Trying to write a template to include something for xyz: in json, but i
 can't put {% firstof %} output thru escapejs as it currently stands.

 {{{
 xyz: '{% firstof a b %}',
 }}}

 with AS, we could do:

 {{{
 {% firstof a b AS c %}
 xyz: '{{ c|escapejs }}',
 }}}

 Right now to do this you end up with a logic block in the template.

 {{{
   {% if a %}{{ a|escapejs }}{% else %}{{ b|escapejs }}{% endif %}
 }}}

 which isn't horrible until you only want a or b if EITHER of them is
 defined and then it looks like:

 {{{
   {% if a or b %}xyz: '{% if a %}{{ a|escapejs }}{% else %}{{ b|escapejs
 }}{% endif %}',{% endif %}
 }}}

 while it could be as simple as:

 {{{
 {% firstof a b AS c %}{% if c %}xyz: '{{ c|escapejs }}',{% endif %}
 }}}

-- 
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] #12199: Give 'firstof' tag ability to assign result to context

2013-03-22 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+
 Reporter:  tiliv |Owner:  nobody
 Type:  New feature   |   Status:  new
Component:  Template system   |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  firstof, as, context  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  1 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by aaugustin):

 * stage:  Design decision needed => Accepted


Comment:

 I don't know what the "capture" tag discussed 3 years ago was, but AFAIK
 it didn't come into existence.

 This feature can be useful and it's still quite restricted -- it isn't a
 general switch statement.

-- 
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] #12199: Give 'firstof' tag ability to assign result to context

2011-04-01 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
-+-
   Reporter:  tiliv  |Owner:  nobody
   Type:  New|   Status:  new
  feature|Component:  Template system
  Milestone: | Severity:  Normal
Version:  SVN| Keywords:  firstof, as, context
 Resolution: |Has patch:  1
   Triage Stage:  Design |  Needs tests:  1
  decision needed|
Needs documentation:  0  |
Patch needs improvement:  0  |
-+-
Changes (by mattmcc):

 * type:   => New feature
 * severity:   => Normal


-- 
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] #12199: Give 'firstof' tag ability to assign result to context

2010-02-05 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
-+--
  Reporter:  tiliv   | Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Template system |   Version:  SVN  
   
Resolution:  |  Keywords:  firstof, as, 
context
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  1
   
Needs_better_patch:  0   |  
-+--
Changes (by russellm):

  * stage:  Unreviewed => Design decision needed
  * milestone:  1.2 =>

-- 
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-upda...@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] #12199: Give 'firstof' tag ability to assign result to context

2009-12-14 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+-
  Reporter:  tiliv| Owner:  nobody  
Status:  new  | Milestone:  1.2 
 Component:  Template system  |   Version:  SVN 
Resolution:   |  Keywords:  firstof, as, context
 Stage:  Unreviewed   | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  1   
Needs_better_patch:  0|  
--+-
Comment (by alexr):

 I worked on this ticket during the sprint on 12/12/09.
 There was initially some concern that this ticket would accomplish the
 same thing as the proposed capture tag. They would do exactly the same
 thing though.

 Jacob is -0 on this ticket since we are making the tag a switch statement,
 but didn't want to veto it without discussion.

-- 
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-upda...@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] #12199: Give 'firstof' tag ability to assign result to context

2009-11-23 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+-
  Reporter:  tiliv| Owner:  nobody  
Status:  new  | Milestone:  1.2 
 Component:  Template system  |   Version:  SVN 
Resolution:   |  Keywords:  firstof, as, context
 Stage:  Unreviewed   | Has_patch:  1   
Needs_docs:  0|   Needs_tests:  1   
Needs_better_patch:  0|  
--+-
Changes (by tiliv):

  * needs_better_patch:  => 0
  * needs_tests:  => 1
  * needs_docs:  => 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 post to this group, send email to django-upda...@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=.




[Django] #12199: Give 'firstof' tag ability to assign result to context

2009-11-11 Thread Django
#12199: Give 'firstof' tag ability to assign result to context
--+-
 Reporter:  tiliv |   Owner:  nobody
   Status:  new   |   Milestone:  1.2   
Component:  Template system   | Version:  SVN   
 Keywords:  firstof, as, context  |   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 When you need to access fields on objects in a {{{ {% firstof %} }}}
 fashion, semantically 'optional' fields can cause issues:

 {{{
 Today the teacher is {% firstof substitute.name teacher.name %},
 and drives a {% firstof substitute.car teacher.car %}
 }}}

 If {{{ substitute }}} doesn't have a value for {{{ car }}}, then it will
 fall back to {{{ teacher.car }}}.

 The real issue is that {{{ {% firstof %} }}} cannot preserve its value for
 later multiple inspections.  If the {{{ {% firstof %} }}} tag could assign
 its result to a context variable, it would solve this problem:

 {{{
 {% firstof substitute teacher as teacher_for_today %}
 Today the teacher is {{ teacher_for_today }}
 {% if teacher_for_today.car %}
 and drives a {{ teacher_for_today.car }}
 {% endif %}
 }}}


 I am unsure that this is possible to achieve without the {{{ as }}}
 syntax.  One would have to code a template tag or filter for the sole
 purpose of duplicating the exact functionality that I propose be added to
 {{{ {% firstof %} }}}.

 Attached patch for functionality and documentation on the subject.

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