Skip to content

Object.votes.all(user_id) only returns a queryset of objects that I have Up voted #73

@Ronster2018

Description

@Ronster2018

I have a user who has up-voted 4 items in total. When I then use object1.votes.down(user_id), it does decrement the vote as it should but then, If I make the query Objects.votes.all(user_id), that query only returns 3 items. I'm using the django shell and this is the exact code that I am executing.

>>> toppings = Toppings.votes.all(1)
>>> toppings
    <QuerySet [<Toppings: sprinkles>, <Toppings: hot fudge>, <Toppings: whipped cream>, <Toppings: cherries>] >
>>> t1 = toppings[0]
>>> t1
    <QuerySet [<Toppings: sprinkles>]>
>>> t1.votes.down(1)
   True
>>> Toppings.votes.all(1)
    <QuerySet [<Toppings: hot fudge>, <Toppings: whipped cream>, <Toppings: cherries>] >

Can someone let me know if I am using this incorrectly please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions