You have been able to use if statements as far back as I can remember
using django (over a year). You might as well finish posting your
actual problem since you're here and I'll try to help.
As for your version problem you more than likely have the latest
development version. I notice the same thi
clude content.include_template %}
{% endfor %}
On Jan 30, 6:19 am, Eric Abrahamsen wrote:
> On Jan 30, 2010, at 2:07 PM, Super McFly wrote:
>
> > Thanks for your suggestion, Eric. I actually tried that but for some
> > reason it didn't work so I assumed it was the same problem
even write a model mixin class that does this automatically,
> populating the include_template attribute using string formatting and
> the class name.
>
> Eric
>
> On Jan 30, 2010, at 1:45 PM, Super McFly wrote:
>
> > I guess the only way to do this would be to use an if
Lai wrote:
> You can always use if blocks, e.g.
>
> {% ifequal content.model_type "post" %}
> {% include "content/post/include.html" %}
> {% elseifequal ... %}
> ...
> {% endif %}
>
> What's the bigger picture for what you're trying to do?
>
&
nt/review/include.html" %}
{% endif %}
On Jan 30, 5:33 am, Super McFly wrote:
> Thank you for the reply. Do you have any suggestions on how to do it
> my way?
>
> On Jan 30, 5:23 am, pyleaf wrote:
>
> > i think that will not work,because 'include' excutes before
Thank you for the reply. Do you have any suggestions on how to do it
my way?
On Jan 30, 5:23 am, pyleaf wrote:
> i think that will not work,because 'include' excutes before the Variable.
>
> On Sat, Jan 30, 2010 at 12:51 PM, Super McFly wrote:
>
>
>
> > Is it p
Is it possible to use a template variable in the "include" template
tag. My actual problem is below...
{% include "content/{{ content.model_type }}/include.html" %}
{{ content.model_type }} by itself outputs "post" and the full string
outputs "content/post/include.html" and if that string is hard
> The solutions isn't too hard, though. Use the "string format" for
> referencing from, say, Image -> Container.
> Seehttp://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkeyfor
> documentation about this.
Thank you for replying. I tried that method before but I received an
error sayin
This is a bit of a tricky one but I need help solving the following
error:
ImportError: cannot import name Container
I'm sure it has something to do with the unusual relationships I have
between two models. I'll put a simplified version below.
It started when I added the 'image' field to the co
9 matches
Mail list logo