Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2024-03-25 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
--+
 Reporter:  Jacob Rief|Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  Template system   |  Version:  dev
 Severity:  Normal|   Resolution:
 Keywords:  verbatim  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Mariusz Felisiak):

 * owner:  Atul Bhouraskar => (none)
 * 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e75729a9e-4842617d-16bf-4a5b-a207-3f34d24ceef0-00%40eu-central-1.amazonses.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-08-25 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  Atul
 Type:   |  Bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_better_patch:  0 => 1


Comment:

 I agree with Chris that re-parsing multiple times is not an acceptable
 solution. IMO we should take a step back and try to fix #23424 without
 considering [https://github.com/django/django/pull/14686 PR14686], then we
 can rethink solution for this ticket.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.8d22c3d14bfb14144f2a2fc4eeb4eded%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-08-23 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  Atul
 Type:   |  Bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Chris Jerdonek):

 If the use cases for this ticket were spelled out in more detail, I feel
 like it would be easier to discuss other ways of solving it. Currently,
 it's not clear what requirements a solution needs to satisfy. It seems
 like there should be a solution that preserves the "one pass" nature of
 parsing. For example, maybe there can be a way to register verbatim tags
 so that the list consulted in `create_token()` will no longer be hard-
 coded.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.9ed385f63d6bb00fcd640ff9254e5fe8%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-08-23 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  Atul
 Type:   |  Bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Chris Jerdonek):

 > In fact that ticket would be much simpler to fix using this approach

 It seems more complicated to me, IMO, and a lot less efficient because you
 need to be re-parsing multiple times. With the other approach, it would
 just be one pass.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.482da39fb27bf2e890945b60200f0c5b%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-08-23 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  Atul
 Type:   |  Bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Atul Bhouraskar):

 Thanks Chris, I wasn't aware of #23424.

 In fact that ticket would be much simpler to fix using this approach -
 I've updated my pull request to make a possible fix for #23424 possible
 (and added tests that expose the bug).

 I've also created a proof of concept fix for #23424 based of this fix -
 https://github.com/django/django/pull/14786 - all tests pass in that one.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.81022e4cbb731c83d627ace2311b2f0b%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-08-20 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  Atul
 Type:   |  Bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Chris Jerdonek):

 > Currently the `Lexer.create_token()` logic returns tokens of type
 `TokenType.TEXT` if it encounters a `{% verbatim %}` tag. This change
 removes this logic, ie. tokens are created as normal,

 It seems like making this change would make it harder to fix #23424 and
 might even be incompatible with fixing it. The reason is that changing
 things in this way would require tokens to be parsed before finding the
 end of the verbatim tag, whereas fixing that bug would require looking for
 the end of the verbatim tag before attempting to parse tokens in between.
 Thus, I would suggest fixing the bug in #23424 (and adding test cases)
 before reworking the implementation into a way that might be incompatible
 with fixing it.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.1775d958254ad5029f4ce496a362b62c%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-07-25 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  Atul
 Type:   |  Bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Atul Bhouraskar):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/14686 PR]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.9b35bc264003e94996cf7dff73f469a1%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2021-07-23 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  Jacob Rief   |Owner:  atul-
 Type:   |  bhouraskar
  Cleanup/optimization   |   Status:  assigned
Component:  Template system  |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by atul-bhouraskar):

 * owner:  nobody => atul-bhouraskar
 * status:  new => assigned


Comment:

 The {{{Lexer.create_token()}}} method can be greatly simplified by
 removing the hard coded logic for {{{self.verbatim}}} and instead saving
 the full token_string in the {{{Token}}} for tags.

 Currently the {{{Lexer.create_token()}}} logic returns tokens of type
 {{{TokenType.TEXT}}} if it encounters a % verbatim % tag. This
 change removes this logic, ie. tokens are created as normal, instead a
 simple {{{Parser.parse_verbatim()}}} method can be implemented to return
 verbatim text in the parsing stage. This can be called by any tag instead
 of calling {{{Parser.parse()}}}.

 I've created a quick pull request
 [https://github.com/django/django/pull/14686] with the above implemented -
 all template tests pass.

 This approach fully removes the 'special case' for the built in verbatim
 tag and allows creating custom tags that need similar behaviour.
 The simplified {{{Lexer.create_token()}}} should now be easier to maintain
 and probably also faster than the existing code (though I haven't profiled
 this).

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.2a8075ecfb5ee64746e5979f6371ebd1%40djangoproject.com.


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2016-04-18 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
--+
 Reporter:  jrief |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Template system   |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:  verbatim  | Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timgraham):

 * stage:  Unreviewed => Accepted


Comment:

 I'm open to a solution, although I'm not sure if the change proposed in
 the description is ideal.

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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2016-04-18 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  jrief|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by jrief):

 BTW: In the meantime I found another solution for the described problem.

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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2016-04-18 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+-
 Reporter:  jrief|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by liminspace):

 * has_patch:  1 => 0
 * type:  Uncategorized => Cleanup/optimization


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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2016-04-18 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+--
 Reporter:  jrief|Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by liminspace):

 I am creating template tag and need get code between {% mytag %}...{%
 endmytag %}.
 I read code and saw that similar template tag "verbatim" is hardcode using
 in Lexer.
 This is bad idea because nobody can't create template like "verbatim".
 Please, improve this thing and make django template system more convenient
 and flexible.

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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2016-04-18 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+--
 Reporter:  jrief|Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  verbatim | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by liminspace):

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


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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2014-09-14 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+--
 Reporter:  jrief|Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  verbatim | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by shayneoneill:

Old description:

> Currently it is impossible to create custom template tags which behave
> similar to {{{ {% verbatim %} }}}.
> The reason is in {{{Lexer.create_token()}}}. There, the class member
> {{{self.verbatim}}} is set for template blocks in "verbatim" state. It is
> impossible to turn on that state from outside, ie. a template tag.
>
> Fixing this, would be as simple as changing {{{if block_content[:9] in
> ('verbatim', 'verbatim ')}}} to {{{if
> block_content.startswith('verbatim')}}} or to {{{if block_content[:9] in
> ('verbatim', 'verbatim ', 'verbatim_')}}}.
> Then all template tags beginning with verbatim..., would start in
> "verbatim" state. I don't assume this will break any existing code; who
> starts the name of a templatetag with 'verbatim...' if not for that
> purpose?
>
> Background information why this is useful:
> Templates syntax for Django and AngularJS is very similar, and with some
> caveats it is possible to reuse a Django template for rendering in
> AngularJS. I therefore attempted to add a context sensitive variation of
> the verbatim tag to this app https://github.com/jrief/django-angular, but
> was hindered by this issue.
>
> BTW: This part of the Django code did not change from 1.6 up to master.
>
> For the purposes of anyone coming across this ticket and pulling their
> hair out over it, heres a template tag that might ease the pain;-
> {{{
>
> from django import template
>
> register = template.Library()
>
> @register.filter(name='specialbracket')
> def specialbracket(value):
> if value == 'left':
> return "{{"
> elif value == 'right':
> return "}}"
> else:
> return "??"
> }}}
>
> And the above example solved with this tag;-
>
> {{{
> {{ 'left'|specialbracket }}
> computer.{{field}} {{ 'right'|specialbracket }} 
>
> }}}

New description:

 Currently it is impossible to create custom template tags which behave
 similar to {{{ {% verbatim %} }}}.
 The reason is in {{{Lexer.create_token()}}}. There, the class member
 {{{self.verbatim}}} is set for template blocks in "verbatim" state. It is
 impossible to turn on that state from outside, ie. a template tag.

 Fixing this, would be as simple as changing {{{if block_content[:9] in
 ('verbatim', 'verbatim ')}}} to {{{if
 block_content.startswith('verbatim')}}} or to {{{if block_content[:9] in
 ('verbatim', 'verbatim ', 'verbatim_')}}}.
 Then all template tags beginning with verbatim..., would start in
 "verbatim" state. I don't assume this will break any existing code; who
 starts the name of a templatetag with 'verbatim...' if not for that
 purpose?

 Background information why this is useful:
 Templates syntax for Django and AngularJS is very similar, and with some
 caveats it is possible to reuse a Django template for rendering in
 AngularJS. I therefore attempted to add a context sensitive variation of
 the verbatim tag to this app https://github.com/jrief/django-angular, but
 was hindered by this issue.

 BTW: This part of the Django code did not change from 1.6 up to master.

--

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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2014-09-14 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+--
 Reporter:  jrief|Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  verbatim | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by shayneoneill:

Old description:

> Currently it is impossible to create custom template tags which behave
> similar to {{{ {% verbatim %} }}}.
> The reason is in {{{Lexer.create_token()}}}. There, the class member
> {{{self.verbatim}}} is set for template blocks in "verbatim" state. It is
> impossible to turn on that state from outside, ie. a template tag.
>
> Fixing this, would be as simple as changing {{{if block_content[:9] in
> ('verbatim', 'verbatim ')}}} to {{{if
> block_content.startswith('verbatim')}}} or to {{{if block_content[:9] in
> ('verbatim', 'verbatim ', 'verbatim_')}}}.
> Then all template tags beginning with verbatim..., would start in
> "verbatim" state. I don't assume this will break any existing code; who
> starts the name of a templatetag with 'verbatim...' if not for that
> purpose?
>
> Background information why this is useful:
> Templates syntax for Django and AngularJS is very similar, and with some
> caveats it is possible to reuse a Django template for rendering in
> AngularJS. I therefore attempted to add a context sensitive variation of
> the verbatim tag to this app https://github.com/jrief/django-angular, but
> was hindered by this issue.
>
> BTW: This part of the Django code did not change from 1.6 up to master.

New description:

 Currently it is impossible to create custom template tags which behave
 similar to {{{ {% verbatim %} }}}.
 The reason is in {{{Lexer.create_token()}}}. There, the class member
 {{{self.verbatim}}} is set for template blocks in "verbatim" state. It is
 impossible to turn on that state from outside, ie. a template tag.

 Fixing this, would be as simple as changing {{{if block_content[:9] in
 ('verbatim', 'verbatim ')}}} to {{{if
 block_content.startswith('verbatim')}}} or to {{{if block_content[:9] in
 ('verbatim', 'verbatim ', 'verbatim_')}}}.
 Then all template tags beginning with verbatim..., would start in
 "verbatim" state. I don't assume this will break any existing code; who
 starts the name of a templatetag with 'verbatim...' if not for that
 purpose?

 Background information why this is useful:
 Templates syntax for Django and AngularJS is very similar, and with some
 caveats it is possible to reuse a Django template for rendering in
 AngularJS. I therefore attempted to add a context sensitive variation of
 the verbatim tag to this app https://github.com/jrief/django-angular, but
 was hindered by this issue.

 BTW: This part of the Django code did not change from 1.6 up to master.

 For the purposes of anyone coming across this ticket and pulling their
 hair out over it, heres a template tag that might ease the pain;-
 {{{

 from django import template

 register = template.Library()

 @register.filter(name='specialbracket')
 def specialbracket(value):
 if value == 'left':
 return "{{"
 elif value == 'right':
 return "}}"
 else:
 return "??"
 }}}

 And the above example solved with this tag;-

 {{{
 {{ 'left'|specialbracket }}
 computer.{{field}} {{ 'right'|specialbracket }} 

 }}}

--

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


Re: [Django] #23356: Unable to create template tag which behaves similar to {% verbatim %}

2014-08-24 Thread Django
#23356: Unable to create template tag which behaves similar to {% verbatim %}
-+--
 Reporter:  jrief|Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  verbatim | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by jrief):

 * status:  new => closed
 * needs_docs:   => 0
 * resolution:   => wontfix
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 wont fix with only that modification

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