Domain model - opxz7148/ku-polls GitHub Wiki

Domain model

Iteration-1 domain model

domain model

Question has 1 to many relation to choice, which mean 1 question wll associated with 1 or more question but 1 question will associated to only one question

Iteration-2 domain model

domain model

Iteration-3 domain model

domain model

With this model Vote act as a medium between 2 models. Each record will associated to 1 user and 1 choice. This model are able to count number of vote by filter UserVote with primary keys of choice then count number of record.

def votes(choice: Choice) -> int:
        return UserVote.filter(choice=choice).count()