Thursday, August 4, 2016

Re: QuerySet for related models

Please check my notes below:

On Thu, Aug 4, 2016 at 10:42 PM, M Hashmi <mhashmi1979@gmail.com> 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.
Sorry but I do not see how Product model will have many hit records.
May be you should change it on:

hits = models.ManyToMany(Hitcount)

 
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+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/81557c06-29ac-44d0-b76c-b3fea37c83f2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAK52boXSLH1E9CA0cAF6gJp0LowWs3Znj%2BQXEC12_6HFXkwedQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment