Thursday, April 17, 2014

Re: Including Page Fragments

I guess you are not supposed to use spaces there.

IIRC spaces aren't allowed when using filters, neither (e.g.
var|filter1 is ok, var | filter1 is not)

You could find the exact reason digging in the template compiler code.
https://github.com/django/django/blob/master/django/template/__init__.py
https://github.com/django/django/blob/master/django/template/base.py

Regards,
Ramon

On Wed, Apr 16, 2014 at 10:21 PM, Venkatraman S <venkat83@gmail.com> wrote:
> Just saw a weird problem while including template fragments:
>
> Works :
> {% include "page.html" with one_variable="1" %}
>
> Does not because of the space during the variable assignment :
> {% include "page.html" with one_variable = "1" %}
>
> Regards,
> Venkat
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN7tdFT-kAGYgw6nioN-JK4a8LSK1_jadx6u0J7fnSt7%2Bo6%3D5g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABoKswjXdwxhiuUHsy_R8Vj28n5EzK%3D2gdS-HEMk0Xx5C8N_Wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment