gt; Hi there, I am trying to list in a template a bunch of fields of the
> model (PagosDetail) that is related to another one (PagosHead) via
> numero_pago field.
>
> I am able to list the PagosHead items in the template but when I use the
> " _set.all" in order to get t
Hi there, I am trying to list in a template a bunch of fields of the
model (PagosDetail) that is related to another one (PagosHead) via
numero_pago field.
I am able to list the PagosHead items in the template but when I use the "
_set.all" in order to get those fields from PagosD
Perfect, thanks
On Thursday, November 29, 2012 3:48:41 PM UTC, ke1g wrote:
>
> You have specified related_name to the foreign key in HotTopic. Try
> either taking that out, or using newsletter_instance.letter_set.all .
>
--
You received this message because you are subscribed to the Google Gro
You have specified related_name to the foreign key in HotTopic. Try either
taking that out, or using newsletter_instance.letter_set.all .
--
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@googlegr
{% for x in list %}
{{x.text}}
{% for t in x.hot_topic_set.all %}
{{ t.topic }}
{% endfor %}
{% endfor %}
try only erase the if tag work for me !!
On Thu, Nov 29, 2012 at 9:17 AM, MikeKJ wrote:
> Good question, I have attempted to shell the problem out and no I dont get
Good question, I have attempted to shell the problem out and no I dont get
a dataset returned, I should do as NewsLetter is foreignkeyed to Hot_Topic
and Hot_Topic_Inline is an inlines to NewsLetterAdmin so the models are
definately related
--
You received this message because you are subscrib
I dont get the hot_topic_set.all from the newsletter instance x and I
really don't see why can anyone else please?
model:
class NewsLetter(models.Model):
title = models.CharField(max_length=200)
text = models.TextField(null=True, blank=True)
document = models.FileField(upload_to="news
hmm nvm
print unicode(a)
seems to do the trick.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/KR3z7jzCPusJ.
To post to this group, send email to django-
Hello
This may be more of a Python question that a Django question, but ... I am
trying to make one of my apps more abstract.
Using _set.all() I can return all of the m2m relations. I can then loop
through them doing what I like *providing *I know the model field names.
if not isinstance(f
t; Hi All,
>>
>> I have a model where it can link to itself using ForeignKey('self'). This
>> is so I can have parent and child objects.
>>
>> I have called the parent and in the template I want to be able to access
>> all the child objects.
>>
> all the child objects.
>
> I have been using the _set.all template command on the field but it
> returns no results.
>
> Any ideas why this would happen? This is the first time I have used
> ForeignKey('self') so I am a bit clueless.
>
> Thank you all
>
Hi All,
I have a model where it can link to itself using ForeignKey('self'). This
is so I can have parent and child objects.
I have called the parent and in the template I want to be able to access
all the child objects.
I have been using the _set.all template command on the fi
Hi.
Assuming I have these models:
#models.py
class Publisher(models.Model):
name = models.CharField(maxlength=30)
street = models.CharField(maxlength=30)
class Book(models.Model):
name = models.CharField(maxlength=30)
publisher = models.ForeignKey(Publisher)
What do I have to
13 matches
Mail list logo