Choice¶
Qualified name: intranet.apps.polls.models.Choice
- class intranet.apps.polls.models.Choice(*args, **kwargs)[source]¶
Bases:
ModelA 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 (
ForeignKeytoQuestion) – Question (related name:choice)
Reverse relationships:
- Parameters:
answer (Reverse
ForeignKeyfromAnswer) – All answers of this choice (related name ofchoice)answervote (Reverse
ForeignKeyfromAnswerVote) – All answer votes of this choice (related name ofchoice)
Methods
display_nametrunc_infoAttributes
answer_setType: Reverse
ForeignKeyfromAnsweranswervote_setType: Reverse
ForeignKeyfromAnswerVoteidType:
AutoFieldType:
CharFieldType:
IntegerFieldobjectsType:
ForeignKeytoQuestionquestion_idInternal field, use
questioninstead.