Closed nickb4 closed 4 years ago
Hi.
I had the same problem. In your view you need to do Thing.objects_with_scores.all()
to make it work.
Hope it helps,
actually, it happens on me too, but i couldn't realize why it does :o) i'm open for any suggestions about that issue.
We have to add objects before all other managers to avoid issues mention in http://stackoverflow.com/a/4455374/1462141
Try like this:
class MyModel(models.Model):
votes = VotesField()
objects = models.Manager()
objects_with_scores = ObjectsWithScoresManager()
(Step 2 at README.rst is updated with that information)
Hi,
I believe that I have configured my project according to your tutorial and demo project, but I am encountering an error:
which references a call in my view to:
This error only occurs when the qhonuskan_votes 'VotesField' and 'ObjectsWithScoresManager' fields are included in my model
Thing
:I believe that I set up my template properly, as well:
In the view I am trying to call
Thing.objects.all()
to use in a different part of the template, but including theVotesField
andObjectsWithScoresManager
in my model for Thing results in the AttributeError described above.Am I doing something wrong in my use of the app? Perhaps, do I need to create a separate model
Vote
Then reference its relation toThing
by using a FK?Thanks for any clarification on this issue!