Answer

Qualified name: intranet.apps.polls.models.Answer

class intranet.apps.polls.models.Answer(id, question, user, choice, answer, clear_vote, other_vote, weight, rank)[source]

Bases: Model

Parameters:

Relationship fields:

Parameters:

Methods

display_votes

Convert rank to votes for displaying by assigning rank 1 the max number of votes and continuing down.

Attributes

answer

Type: CharField

choice

Type: ForeignKey to Choice

choice_id

Internal field, use choice instead.

clear_vote

Type: BooleanField

id

Type: AutoField

objects

other_vote

Type: BooleanField

question

Type: ForeignKey to Question

question_id

Internal field, use question instead.

rank

Type: IntegerField

user

Type: ForeignKey to User

user_id

Internal field, use user instead.

weight

Type: DecimalField

display_votes()[source]

Convert rank to votes for displaying by assigning rank 1 the max number of votes and continuing down.