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:

Relationship fields:

Parameters:

question (ForeignKey to Question) – Question (related name: choice)

Reverse relationships:

Parameters:
  • answer (Reverse ForeignKey from Answer) – All answers of this choice (related name of choice)

  • answervote (Reverse ForeignKey from AnswerVote) – All answer votes of this choice (related name of choice)

Methods

display_name

trunc_info

Attributes

answer_set

Type: Reverse ForeignKey from Answer

answervote_set

Type: Reverse ForeignKey from AnswerVote

id

Type: AutoField

info

Type: CharField

num

Type: IntegerField

objects

question

Type: ForeignKey to Question

question_id

Internal field, use question instead.