senate package

Subpackages

Submodules

senate.admin module

class senate.admin.CategoryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ['name', 'department']
list_filter = ['department']
media
class senate.admin.DepartmentAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ['name', 'group', 'head']
media
readonly_fields = ['members']
class senate.admin.EmployeeAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ['person', 'department', 'position', 'phone', 'public', 'importance']
list_editable = ['public', 'importance']
list_filter = ['department', 'public']
media
search_fields = ['person__first_name', 'person__last_name']
class senate.admin.EventInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.StackedInline

can_delete = True
media
model

alias of Event

readonly_fields = ['images_tags']
class senate.admin.IssueAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

inlines = [<class 'senate.admin.EventInline'>]
list_display = ['category', 'name', 'author', 'status', 'add_dttm', 'last_event', 'want_to_help', 'assigned_dept']
list_filter = ['category', 'status', 'want_to_help', 'assigned_dept']
media

senate.app module

class senate.app.SenateConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'senate'
ready()[source]
verbose_name = 'Сенат'

senate.forms module

class senate.forms.DeptEventCreateForm(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

class Meta[source]

Bases: object

fields = ['cls', 'info', 'new_status', 'new_dept']
model

alias of Event

widgets = {'info': <class 'django.forms.widgets.Textarea'>}
base_fields = OrderedDict([('cls', <django.forms.fields.TypedChoiceField object>), ('info', <django.forms.fields.CharField object>), ('new_status', <django.forms.fields.TypedChoiceField object>), ('new_dept', <django.forms.models.ModelChoiceField object>), ('photo1', <django.forms.fields.ImageField object>), ('photo2', <django.forms.fields.ImageField object>), ('photo3', <django.forms.fields.ImageField object>)])
declared_fields = OrderedDict([('photo1', <django.forms.fields.ImageField object>), ('photo2', <django.forms.fields.ImageField object>), ('photo3', <django.forms.fields.ImageField object>)])
media
class senate.forms.IssueCreateForm(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

class Meta[source]

Bases: object

fields = ['name', 'category', 'want_to_help']
model

alias of Issue

base_fields = OrderedDict([('name', <django.forms.fields.CharField object>), ('category', <django.forms.models.ModelChoiceField object>), ('want_to_help', <django.forms.fields.BooleanField object>), ('issue_descr', <django.forms.fields.CharField object>), ('photo1', <django.forms.fields.ImageField object>), ('photo2', <django.forms.fields.ImageField object>), ('photo3', <django.forms.fields.ImageField object>)])
declared_fields = OrderedDict([('issue_descr', <django.forms.fields.CharField object>), ('photo1', <django.forms.fields.ImageField object>), ('photo2', <django.forms.fields.ImageField object>), ('photo3', <django.forms.fields.ImageField object>)])
media
class senate.forms.UserEventCreateForm(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

class Meta[source]

Bases: object

fields = ['info']
model

alias of Event

widgets = {'info': <class 'django.forms.widgets.Textarea'>}
base_fields = OrderedDict([('info', <django.forms.fields.CharField object>), ('photo1', <django.forms.fields.ImageField object>), ('photo2', <django.forms.fields.ImageField object>), ('photo3', <django.forms.fields.ImageField object>)])
declared_fields = OrderedDict([('photo1', <django.forms.fields.ImageField object>), ('photo2', <django.forms.fields.ImageField object>), ('photo3', <django.forms.fields.ImageField object>)])
media

senate.models module

class senate.models.Category(id, name, department, public)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

department

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 a ForwardManyToOneDescriptor instance.

department_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.

issue_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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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>
public

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class senate.models.Department(id, group, name, head)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_member(user)[source]
employee_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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

group

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

restaurant.place is a ForwardOneToOneDescriptor 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.

head

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 a ForwardManyToOneDescriptor instance.

head_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.

members
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>
class senate.models.Employee(id, person, position, department, public, phone, importance)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

department

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 a ForwardManyToOneDescriptor instance.

department_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.

importance

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>
person

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 a ForwardManyToOneDescriptor instance.

person_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

phone

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

position

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.

class senate.models.Event(id, issue, author, add_dttm, cls, info, new_dept, new_worker, new_status)[source]

Bases: django.db.models.base.Model

ASSIGNEE_CHANGE = 2
CLASS = ((1, 'Обновление'), (2, 'Смена ответственного'), (3, 'Изменение статуса'), (4, 'Запрос сведений'), (5, 'Создание обращения'))
DETAILS_REQUEST = 4
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

MAX_INFO_LEN = 2048
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OPEN = 5
STATUS_CHANGE = 3
UPDATE = 1
add_dttm

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

author

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 a ForwardManyToOneDescriptor instance.

author_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

cls

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eventdocument_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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_cls_display(*moreargs, **morekwargs)
get_new_status_display(*moreargs, **morekwargs)
get_next_by_add_dttm(*moreargs, **morekwargs)
get_previous_by_add_dttm(*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.

images_tags()[source]
info

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

issue

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 a ForwardManyToOneDescriptor instance.

issue_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

new_dept

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 a ForwardManyToOneDescriptor instance.

new_dept_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

new_status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

new_worker

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 a ForwardManyToOneDescriptor instance.

new_worker_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>
class senate.models.EventDocument(id, file, event)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

event

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 a ForwardManyToOneDescriptor instance.

event_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

file

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

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>
class senate.models.Issue(id, author, category, name, status, add_dttm, last_event, close_dttm, want_to_help, assigned_dept, assigned_worker)[source]

Bases: django.db.models.base.Model

ACCEPTED = 3
CLOSED = 2
DECLINED = 4
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OPEN = 1
STATUS = ((1, 'Открыто'), (2, 'Закрыто'), (3, 'Инициатива одобрена'), (4, 'Инициатива отклонена'))
add_dttm

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

assigned_dept

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 a ForwardManyToOneDescriptor instance.

assigned_dept_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

assigned_worker

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 a ForwardManyToOneDescriptor instance.

assigned_worker_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

author

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 a ForwardManyToOneDescriptor instance.

author_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

category

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 a ForwardManyToOneDescriptor instance.

category_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

close_dttm

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

event_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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_absolute_url()[source]
get_next_by_add_dttm(*moreargs, **morekwargs)
get_previous_by_add_dttm(*moreargs, **morekwargs)
get_status_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.

last_event

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>
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

want_to_help

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

senate.signals module

senate.signals.employee_create(sender, instance: senate.models.Employee, created, **kwargs)[source]
senate.signals.event_save(sender, instance: senate.models.Event, created, **kwargs)[source]
senate.signals.issue_update_text(event: senate.models.Event)[source]
senate.signals.new_issue_text(issue: senate.models.Issue)[source]

senate.tests module

senate.urls module

senate.views module

class senate.views.DeptIssueList(**kwargs)[source]

Bases: django.contrib.auth.mixins.UserPassesTestMixin, django.views.generic.list.ListView

dispatch(request, *args, **kwargs)
get_queryset()[source]
model

alias of Issue

template_name = 'senate/issue_list.html'
test_func()[source]
class senate.views.EmployeeList(**kwargs)[source]

Bases: django.views.generic.list.ListView

model

alias of Employee

ordering = ['-importance', 'department', 'position']
class senate.views.FullIssueList(**kwargs)[source]

Bases: django.views.generic.list.ListView

get_queryset()[source]
model

alias of Issue

template_name = 'senate/issue_list.html'
class senate.views.IssueCreate(**kwargs)[source]

Bases: django.views.generic.edit.CreateView

dispatch(request, *args, **kwargs)
form_class

alias of IssueCreateForm

form_valid(form)[source]
get_initial()[source]
get_success_url()[source]
model

alias of Issue

class senate.views.IssueDetail(**kwargs)[source]

Bases: django.views.generic.base.View

get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]
class senate.views.IssueDisplay(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

dispatch(request, *args, **kwargs)
get_context_data(**kwargs)[source]
model

alias of Issue

class senate.views.MyIssueList(**kwargs)[source]

Bases: django.views.generic.list.ListView

dispatch(request, *args, **kwargs)
get_queryset()[source]
model

alias of Issue

template_name = 'senate/issue_list.html'
class senate.views.UserEventCreate(**kwargs)[source]

Bases: django.views.generic.detail.SingleObjectMixin, django.views.generic.edit.FormView

dispatch(request, *args, **kwargs)
form_valid(form)[source]
get_form_class()[source]
get_success_url()[source]
model

alias of Issue

post(request, *args, **kwargs)[source]
template_name = 'senate/issue_detail.html'

Module contents