http://docs.djangoproject.com/en/dev/intro/tutorial03/#intro-tutorial03
I'm following the above tutorial, and I'm confused with the following
section:
<h1>{{ poll.question }}</h1>
<ul>
{% for choice in poll.choice_set.all %}
<li>{{ choice.choice }}</li>
{% endfor %}
</ul>
The 'poll' and 'choice' are referred to with out the first letters, p
and c respectively, being capitalized.
This is despite the fact that both are declared as 'Poll' and
'Choice', respectively, in the models.py.
I have tried this in my own app and find the same to be true there
too: If I try to refer to a model with a capitalized first letter (as
they are declared in my models.py), the template doesn't work.
I have a feeling this has something to do with the templates dealing
with 'Objects' and when an object is instantiated from a class it's
first letter is automatically converted to lower case.
Am I on the right lines here? If so, what happens if you declare your
classes with all lower case letters in models.py?
Thanks,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---