> > My field hits=models.ForeignKey(Hitcount) means that my Product model has > a related model with multiple fields and all the products in Product model > will have one or more hit records. Instance of Product model will save a > hit from end user by session/ip/user etc.
Honestly, I don't understand that. The HitCount class already has a GenericForeignKey, maybe you are looking for a Reverse Generic Relation <https://docs.djangoproject.com/ja/1.9/ref/contrib/contenttypes/#reverse-generic-relations> class in order to get the Hits for a product. On Thursday, August 4, 2016 at 10:42:58 PM UTC+3, M Hashmi wrote: > > My field hits=models.ForeignKey(Hitcount) means that my Product model has > a related model with multiple fields and all the products in Product model > will have one or more hit records. Instance of Product model will save a > hit from end user by session/ip/user etc. > -- 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+unsubscr...@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/a681e317-a71e-41fb-93e7-eaf411a15729%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.