Choice¶
Qualified name: intranet.apps.polls.models.Choice
- class intranet.apps.polls.models.Choice(*args, **kwargs)[source]¶
Bases:
Model
A choice for a Question.
- question¶
A ForeignKey to the question this choice is for.
- num¶
An integer order in which the choice should appear; the primary sort.
- info¶
Textual information about this answer choice.
- Parameters:
id (AutoField) – Primary key: ID
num (IntegerField) – Num
info (CharField) – Info
Relationship fields:
- Parameters:
question (
ForeignKey
toQuestion
) – Question (related name:choice
)
Reverse relationships:
- Parameters:
answer (Reverse
ForeignKey
fromAnswer
) – All answers of this choice (related name ofchoice
)answervote (Reverse
ForeignKey
fromAnswerVote
) – All answer votes of this choice (related name ofchoice
)
Methods
display_name
trunc_info
Attributes
answer_set
Type: Reverse
ForeignKey
fromAnswer
answervote_set
Type: Reverse
ForeignKey
fromAnswerVote
id
Type:
AutoField
Type:
CharField
Type:
IntegerField
objects
Type:
ForeignKey
toQuestion
question_id
Internal field, use
question
instead.