Thursday, September 22, 2016

Foreign key set template

I have a question about using model.foreignkey_set in Django templates. I was trying to use model.foreignkey_set to determine if there were any foreign keys for this model, but it appears that model.foreignkey_set returns something different than model.foreignkey_set.all - why is that? Shouldn't both return None if there are no foreign keys?

Just curious :)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2121cdf4-9a32-4d0e-a107-03b5e9b3fd08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment