polls package¶
Subpackages¶
Submodules¶
polls.admaking module¶
polls.admin module¶
-
class
polls.admin.ChoiceInline(parent_model, admin_site)[source]¶ Bases:
nested_inline.admin.NestedTabularInline-
exclude= ('votes',)¶
-
extra= 1¶
-
media¶
-
model¶ alias of
Choice
-
-
class
polls.admin.ParticipantAdmin(model, admin_site)[source]¶ Bases:
nested_inline.admin.NestedModelAdmin-
list_display= ['user_information', 'poll', 'voted']¶
-
list_editable= ['voted']¶
-
list_filter= ['voted', 'poll']¶
-
media¶
-
search_fields= ['user_information__fio']¶
-
-
class
polls.admin.ParticipantInline(parent_model, admin_site)[source]¶ Bases:
nested_inline.admin.NestedTabularInline-
exclude= ('user_information',)¶
-
fields= ('voted',)¶
-
list_dispay= ['userprofile']¶
-
media¶
-
model¶ alias of
Participant
-
ordering= ('user_information',)¶
-
-
class
polls.admin.PollAdmin(model, admin_site)[source]¶ Bases:
nested_inline.admin.NestedModelAdmin-
exclude= ('voted_users', 'times_mailed', 'last_mailing')¶
-
inlines= [<class 'polls.admin.ParticipantInline'>, <class 'polls.admin.QuestionInline'>]¶
-
list_display= ['name', 'pdf_button', 'audit_button', 'mailing_button']¶
-
media¶
-
polls.app module¶
polls.forms module¶
-
class
polls.forms.UserForm(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)[source]¶ Bases:
django.forms.models.ModelForm-
base_fields= OrderedDict([('last_name', <django.forms.fields.CharField object>), ('first_name', <django.forms.fields.CharField object>)])¶
-
declared_fields= OrderedDict()¶
-
media¶
-
-
class
polls.forms.UserProfileForm(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)[source]¶ Bases:
polls.forms.UserProfileFormReduced-
base_fields= OrderedDict([('room', <django.forms.fields.CharField object>), ('cardnumber', <django.forms.fields.CharField object>)])¶
-
declared_fields= OrderedDict([('cardnumber', <django.forms.fields.CharField object>)])¶
-
media¶
-
-
class
polls.forms.UserProfileFormReduced(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)[source]¶ Bases:
django.forms.models.ModelForm-
base_fields= OrderedDict([('room', <django.forms.fields.CharField object>)])¶
-
declared_fields= OrderedDict()¶
-
media¶
-
polls.mailing module¶
polls.models module¶
-
class
polls.models.Choice(id, question, choice_text, votes, created)[source]¶ Bases:
django.db.models.base.Model-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
choice_text¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
question_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
userhash_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.childrenis aReverseManyToOneDescriptorinstance.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
polls.models.Participant(id, user_information, poll, voted)[source]¶ Bases:
django.db.models.base.Model-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
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.parentis aForwardManyToOneDescriptorinstance.
-
poll_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user_information¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
user_information_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
voted¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
polls.models.Poll(id, name, begin_date, end_date, target_room, target_group, target_course, public, times_mailed, last_mailing, poll_type, only_for_staff)[source]¶ Bases:
django.db.models.base.Model-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
POLL_TYPE= (('WITHOUT_TARGET_LIST', 'WITHOUT TARGET LIST'), ('TARGET_LIST', 'TARGET LIST'))¶
-
TARGET_LIST= 'TARGET_LIST'¶
-
WITHOUT_TARGET_LIST= 'WITHOUT_TARGET_LIST'¶
-
begin_date¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
create_target_list_from_group_room_course(group=None, room=None, course=None, only_staff=False)[source]¶
-
end_date¶ 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_begin_date(*moreargs, **morekwargs)¶
-
get_next_by_end_date(*moreargs, **morekwargs)¶
-
get_poll_type_display(*moreargs, **morekwargs)¶
-
get_previous_by_begin_date(*moreargs, **morekwargs)¶
-
get_previous_by_end_date(*moreargs, **morekwargs)¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
last_mailing¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name¶ 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>¶
-
only_for_staff¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
participant_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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
poll_type¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
public¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
target_course¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
target_group¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
target_room¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
times_mailed¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
voted_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.toppingsandtopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
exception
-
class
polls.models.Question(id, poll, question, answer_type, choices_order, required)[source]¶ Bases:
django.db.models.base.Model-
ANSWER_TYPE_CHOICES= (('ONE', 'Выбор одного варианта'), ('MANY', 'Выбор нескольких вариантов'), ('OWN', 'Свой вариант'))¶
-
CREATION= 'created'¶
-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
MANY= 'MANY'¶
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
ONE= 'ONE'¶
-
ORDER_TYPES= (('created', 'В порядке добавления'), ('?', 'В случайном порядке'))¶
-
OWN= 'OWN'¶
-
RANDOM= '?'¶
-
answer_type¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
choices_order¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_answer_type_display(*moreargs, **morekwargs)¶
-
get_choices_order_display(*moreargs, **morekwargs)¶
-
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.parentis aForwardManyToOneDescriptorinstance.
-
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.
-
required¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
-
class
polls.models.UserHash(id, value, choice, user)[source]¶ Bases:
django.db.models.base.Model-
exception
DoesNotExist¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned¶ Bases:
django.core.exceptions.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.parentis aForwardManyToOneDescriptorinstance.
-
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.
-
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.parentis aForwardManyToOneDescriptorinstance.
-
user_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
value¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
polls.tests module¶
polls.urls module¶
polls.views module¶
-
class
polls.views.Available(**kwargs)[source]¶ Bases:
polls.views.IndexBase
-
class
polls.views.Closed(**kwargs)[source]¶ Bases:
polls.views.IndexBase
-
class
polls.views.Detail(**kwargs)[source]¶ Bases:
django.views.generic.detail.DetailView-
model¶ alias of
Poll
-
template_name= 'polls/detail.html'¶
-
-
class
polls.views.IndexBase(**kwargs)[source]¶ Bases:
django.views.generic.list.ListView-
context_object_name= 'poll_list'¶
-
paginate_by= 10¶
-
template_name= 'polls/index.html'¶
-
-
class
polls.views.Results(**kwargs)[source]¶ Bases:
django.views.generic.detail.DetailView-
model¶ alias of
Poll
-
template_name= 'polls/results.html'¶
-
-
class
polls.views.Voted(**kwargs)[source]¶ Bases:
polls.views.IndexBase