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
using django 1.0.x from svn
I'm doing the following to disassociates a relation.
instance = Some.objects.get(pk=1)
insance.bar_set.clear()
bar_set has a method clear yet and the foreignkey in bar is
"null=True"
Yet if I call "clear()" then nothing happens. the foreignkeys are not
set to NULL .
Concider this:
parent = models.ForeignKey('self', null=True, blank=True,
related_name='children')
So my user makes a database that has
root
level1
level2
level3
If the user moves level1 under level3 than the database breaks and I
get this error.
ProgrammingError: (2014,, "Commands out of sync;
I'm building an application without the django admin. I wan't to run
my own permmissions system. The docs say:
"Note that if your model doesn't have class Admin set when you run
syncdb, the permissions won't be created. If you initialize your
database and add class Admin to models after the fact,
On 30 jan, 16:34, omat <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> When I try to syncdb I am getting a "unknown locale: UTF-8" error.
>
> I am using a recent checkout from the trunk with Postgres on MacOS X.
> My database is UTF-8 and my DEFAULT_CHARSET is 'utf-8'. The
> application was used to run o
On 30 jan, 01:06, Noah <[EMAIL PROTECTED]> wrote:
> We're having an extremely difficult to diagnose problem:
>
> At some point (possibly due to access from the public to a particular
> view) our server will crap out.
> All 21 Django sites hosted on it will display a very similar error.
> There are
Hello,
I've made a site where I use language settings.
The problem I have:
I have the following code
{% ifequal request.LANGUAGE_CODE "nl" %}
do this
{% endifequal %}
On some browsers this works on other browser this does not work as
{{ request.LANGUAGE_CODE }} gives "nl-be"
To make sure the
Some trouble using ajax in with forms.
To make things simple a dumb down version
I got a two fields :
class MyForm(forms.Form):
room =
forms.ModelChoiceField(queryset=Product.objects.filter(type=1))
attending = forms.ChoiceField(required=False, choices=(('',
'-'),))
However eac
Ok I worked myself a bit in trouble.
Don't know yet how to do this with newforms:
Let me explain and dumb down my problem to make things easy:
two models:
model 1: Products
I got "products" that have each a name and a price
Model 2: Options
Option has a foreingkey pointing to products but also a
Chak de india Video songs / Audio Songs and wallpapers
www.FunAtoZ.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To uns
Chak de india Video songs / Audio Songs and wallpapers
www.FunAtoZ.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To uns
19 matches
Mail list logo