intranet.apps.polls package¶
Submodules¶
intranet.apps.polls.admin module¶
intranet.apps.polls.forms module¶
-
class
intranet.apps.polls.forms.
PollForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]¶ Bases:
django.forms.models.ModelForm
-
class
Meta
[source]¶ Bases:
object
-
fields
= ['title', 'description', 'start_time', 'end_time', 'visible', 'is_secret', 'groups']¶
-
help_texts
= {'is_secret': "This will prevent Ion administrators from viewing individual users' votes."}¶
-
labels
= {'is_secret': 'Secret'}¶
-
model
¶ alias of
intranet.apps.polls.models.Poll
-
widgets
= {'description': <django.forms.widgets.Textarea object>}¶
-
-
declared_fields
= {}¶
-
class
intranet.apps.polls.models module¶
-
class
intranet.apps.polls.models.
Answer
(id, question, user, choice, answer, clear_vote, weight)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
answer
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
choice
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
choice_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
clear_vote
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
question
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
question_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
user_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
weight
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
intranet.apps.polls.models.
AnswerVote
(id, question, choice, votes, is_writing)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
choice
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
choice_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_writing
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
question
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
question_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
users
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
votes
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
intranet.apps.polls.models.
AnswerVote_users
(id, answervote, user)¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
answervote
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
answervote_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
user_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
intranet.apps.polls.models.
Choice
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
A choice for a Question.
-
question
¶ A ForeignKey to the question this choice is for.
-
num
¶ An integer order in which the question should appear; the primary sort.
-
info
¶ Textual information about this answer choice.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
answer_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
answervote_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
info
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
num
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
question
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
question_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
class
intranet.apps.polls.models.
Poll
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
A Poll, for the TJ community.
-
title
¶ A title for the poll, that will be displayed to identify it uniquely.
-
description
¶ A longer description, possibly explaining how to complete the poll.
-
start_time
¶ A time that the poll should open.
-
end_time
¶ A time that the poll should close.
-
visible
¶ Whether the poll is visible to the users it is for.
-
is_secret
¶ Whether the poll is a ‘secret’ poll. Poll admins will not be able to view individual user responses for secret polls.
-
groups
¶ The Group’s that can view–and vote in–the poll. Like Announcements, if there are none set, then it is public to all.
Access questions for the poll through poll.question_set.all()
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
end_time
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_end_time
(*, field=<django.db.models.fields.DateTimeField: end_time>, is_next=True, **kwargs)¶
-
get_next_by_start_time
(*, field=<django.db.models.fields.DateTimeField: start_time>, is_next=True, **kwargs)¶
-
get_previous_by_end_time
(*, field=<django.db.models.fields.DateTimeField: end_time>, is_next=False, **kwargs)¶
-
get_previous_by_start_time
(*, field=<django.db.models.fields.DateTimeField: start_time>, is_next=False, **kwargs)¶
-
groups
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_secret
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <intranet.apps.polls.models.PollManager object>¶
-
question_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
start_time
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
title
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
visible
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
class
intranet.apps.polls.models.
PollQuerySet
(model=None, query=None, using=None, hints=None)[source]¶
-
class
intranet.apps.polls.models.
Poll_groups
(id, poll, group)¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
group
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
group_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
poll
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
poll_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
intranet.apps.polls.models.
Question
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
A question for a Poll.
-
poll
¶ A ForeignKey to the Poll object the question is for.
-
question
¶ A text field for entering the question, of which there are choices the user can make.
-
num
¶ An integer order in which the question should appear; the primary sort.
-
type
¶ - One of:
Question.STD: Standard Question.ELECTION: Election (randomized choice order) Question.APP: Approval (can select up to max_choices entries) Question.SPLIT_APP: Split approval Question.FREE_RESP: Free response Question.STD_OTHER: Standard Other field
-
max_choices
¶ The maximum number of choices that can be selected. Only applies for approval questions.
-
Access possible choices for this question through question.choice_set.all()
-
APP
= 'APP'¶
-
exception
DoesNotExist
¶
-
ELECTION
= 'ELC'¶
-
FREE_RESP
= 'FRE'¶
-
exception
MultipleObjectsReturned
¶
-
SHORT_RESP
= 'SRE'¶
-
SPLIT_APP
= 'SAP'¶
-
STD
= 'STD'¶
-
STD_OTHER
= 'STO'¶
-
TYPE
= (('STD', 'Standard'), ('ELC', 'Election'), ('APP', 'Approval'), ('SAP', 'Split approval'), ('FRE', 'Free response'), ('SRE', 'Short response'), ('STO', 'Standard other'))¶
-
answer_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
answervote_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
choice_set
¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
get_type_display
(*, field=<django.db.models.fields.CharField: type>)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
max_choices
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
num
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
poll
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
poll_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
question
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
random_choice_set
¶
-
type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-