Skip to content

Clear separation of the count functions/one count function for allΒ #71

@edegeyer

Description

@edegeyer

To me it didn't seem very obvious to me, that it only counts the UP votes if no parameter is given.
The Code snippet I'm talking about is the following:

    def count(self, action=UP):
        return self.through.votes_for(self.model,
                                      self.instance, action).count()

My suggestion would be, to introduce 2 new functions:
count_up(self)
and
count_down(self)

I would still keep the count function, but modify it in a way, that leads to it counting the up and down votes, by just calling the two other functions and returning them as a dict to the caller

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