Domain Model - KhunakornP/ku-polls GitHub Wiki

Domain models for KU polls

Iteration 1&2 domain model

Iteration1 domain model

Questions represent the poll questions on the site.
Each Question can have many Choices but Choices may only have 1 Question associated with it.

Iteration 3 domain model

Iteration3 domain model

Each User may only have one vote per question, and each Vote has a choice associated with it. In order to count the votes for each choice the Choice class uses this method:

@property
def votes(choice: Choice) -> int:
        """Returns the vote count of the choice"""
        return choice.vote_set.count()