variable name collision.
caused by locals()
On May 18, 8:05 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote:
> Very odd. On a whim, I changed:
>
>
> {% for instructor in instructors %}
> {{ instructor.first_name }} #there is no value output
> here
> {% endif %}
>
>
> to
>
>
> {% for i in
Very odd. On a whim, I changed:
{% for instructor in instructors %}
{{ instructor.first_name }} #there is no value output
here
{% endif %}
to
{% for i in instructors %}
{{ i.first_name }} #this works?!
here
{% endif %}
Can anyone offer some reason why that would work? Just for my
Here is my code:
#in models.py
class Instructor(models.Model):
prefix = models.CharField(max_length=50, blank=True, null=True)
first_name = models.CharField(max_length=50)
middle_name = models.CharField(max_length=50, blank=True,
null=True)
last_name =
Hi everyone,
I have a ManyToMany field on a model, and when I want to get the
related items and display them in a template in a for loop, the loop
executes the correct number of times, but in my output blocks there
are no values.
If I print the object, I get an array of values, same as any
4 matches
Mail list logo