Sunday, March 31, 2013

How do I get these field values in my template?

cat = Product.objects.values_list('category__image_path','category__id')

outputs;
(u'category/goodyear logo.jpg', 13) 

I tried for c in cat:
c.image_path
c.id

Thanks

--
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment