Skip to content

Polls Model

Noah Huppert edited this page Jun 16, 2018 · 1 revision

Polls

Polls present a set of options which users can vote for. Polls can be attached to squads, events, or cars.

Models

Poll

Represents a set of questions users can interact with.

  • owner_type: string
    • Either squad, event, or car depending on if an squad, event or car that owns the poll.
    • The term "owns" is used to signify that the poll is displayed as part of a squad, event, or car ride. The creator_id field below specifies the user who created the poll.
  • owner_id: int
    • Id of either squad, event or car depending on owner_type's value.
  • creator_id: int
    • Id of user who created poll

Poll Option

Individual option for poll.

  • poll_id: int
    • Id of poll option is for.
  • order: int
    • Order in overall poll that option is in
  • name: string
    • Name of the poll option
  • type: string
    • Type of poll, put in place to support future more complicated polls
    • Currently only valid value is text
  • data: string
    • Marshalled data for poll option, interpreted based on type.

Poll Vote

Vote for poll option by user.

  • user_id: int
  • poll_id: int
  • poll_option_id: int
    • Id of poll option they voted for

Clone this wiki locally