fin_aid package

Submodules

fin_aid.admin module

class fin_aid.admin.AidDocumentInline(parent_model, admin_site)[source]

Bases: django.contrib.admin.options.TabularInline

media
model

alias of AidDocument

class fin_aid.admin.AidRequestAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

class Media[source]

Bases: object

css = {'all': ('//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css',)}
js = ('//code.jquery.com/jquery-2.1.1.min.js', '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js')
change_view(request, object_id, form_url='', extra_context=None)[source]
date_hierarchy = 'add_dttm'
fieldsets = [(None, {'fields': (('applicant', 'author'), ('category', 'urgent'), 'reason', ('req_sum', 'accepted_sum'), 'status', ('month_of_payment', 'payment_dt'), 'examination_comment', ('submitted_paper', 'paid_with_cash', 'verified'), 'vk_link')}), ('Изображения', {'fields': ('images_tags',), 'classes': ('collapse',)})]
form

alias of AidRequestAdminForm

get_applicant_name(obj)[source]
get_changelist(request, **kwargs)[source]
get_readonly_fields(request, obj=None)[source]

Can change applicant only if request is created by another person

inlines = [<class 'fin_aid.admin.AidDocumentInline'>]
list_display = ['get_applicant_name', 'add_dttm', 'category', 'req_sum', 'urgent', 'status', 'accepted_sum', 'payment_dt', 'submitted_paper']
list_editable = ['status', 'accepted_sum', 'payment_dt', 'submitted_paper']
list_filter = [<class 'fin_aid.admin.PaymentMonthFilter'>, 'status', 'category', 'urgent', 'submitted_paper', 'paid_with_cash', 'verified']
media
save_model(request, obj, form, change)[source]
search_fields = ['applicant__first_name', 'applicant__last_name', 'reason']
class fin_aid.admin.AidRequestChangeList(*args, **kwargs)[source]

Bases: django.contrib.admin.views.main.ChangeList

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

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('name', 'reason', 'max_sum', 'max_quantity', 'notifications')
media
class fin_aid.admin.MonthlyDataAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('year', 'month', 'limit', 'deadline_dt', 'student_deadline_dt', 'payment_dt')
media
class fin_aid.admin.PaymentMonthFilter(request, params, model, model_admin)[source]

Bases: django.contrib.admin.filters.SimpleListFilter

lookups(request, model_admin)[source]
parameter_name = 'payment_dt'
queryset(request, queryset)[source]
title = 'Месяц выплаты'
class fin_aid.admin.ScholarAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ['student', 'scholarship']
list_filter = ['scholarship']
media
class fin_aid.admin.ScholarshipAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ['name', 'sum', 'frequency']
list_filter = ['frequency']
media

fin_aid.create_paper module

fin_aid.create_paper.create_paper(aid_request: fin_aid.models.AidRequest)[source]
fin_aid.create_paper.get_sex(user: django.contrib.auth.models.User)[source]

fin_aid.forms module

class fin_aid.forms.AidRequestAdminForm(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

FOLLOWING = 3
MONTHS = [(1, 'Ближайший месяц'), (2, 'Следующий месяц'), (3, 'Через месяц')]
class Meta[source]

Bases: object

exclude = ['examination_dttm']
model

alias of AidRequest

widgets = {'applicant': <django_select2.forms.ModelSelect2Widget object>, 'author': <django_select2.forms.ModelSelect2Widget object>}
NEXT = 2
THIS = 1
base_fields = OrderedDict([('author', <django.forms.models.ModelChoiceField object>), ('applicant', <django.forms.models.ModelChoiceField object>), ('category', <django.forms.models.ModelChoiceField object>), ('reason', <django.forms.fields.CharField object>), ('req_sum', <django.forms.fields.FloatField object>), ('urgent', <django.forms.fields.BooleanField object>), ('accepted_sum', <django.forms.fields.FloatField object>), ('status', <django.forms.fields.TypedChoiceField object>), ('payment_dt', <django.forms.fields.DateField object>), ('examination_comment', <django.forms.fields.CharField object>), ('submitted_paper', <django.forms.fields.BooleanField object>), ('paid_with_cash', <django.forms.fields.BooleanField object>), ('verified', <django.forms.fields.BooleanField object>), ('month_of_payment', <django.forms.fields.ChoiceField object>)])
declared_fields = OrderedDict([('month_of_payment', <django.forms.fields.ChoiceField object>)])
media
class fin_aid.forms.AidRequestCreateForm(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 = ['category', 'reason', 'req_sum', 'urgent']
model

alias of AidRequest

base_fields = OrderedDict([('category', <django.forms.models.ModelChoiceField object>), ('reason', <django.forms.fields.CharField object>), ('req_sum', <django.forms.fields.FloatField object>), ('urgent', <django.forms.fields.BooleanField object>), ('document1', <django.forms.fields.FileField object>), ('document2', <django.forms.fields.FileField object>), ('document3', <django.forms.fields.FileField object>)])
declared_fields = OrderedDict([('document1', <django.forms.fields.FileField object>), ('document2', <django.forms.fields.FileField object>), ('document3', <django.forms.fields.FileField object>)])
media
class fin_aid.forms.SelectExportMonthForm(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, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = OrderedDict([('year', <django.forms.fields.IntegerField object>), ('month', <django.forms.fields.ChoiceField object>)])
declared_fields = OrderedDict([('year', <django.forms.fields.IntegerField object>), ('month', <django.forms.fields.ChoiceField object>)])
media

fin_aid.models module

class fin_aid.models.AidDocument(id, file, request, is_application_paper, is_image)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

file

The descriptor for the file attribute on the model instance. Returns a FieldFile when accessed so you can do stuff like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assigns a file object on assignment so you can do:

>>> with open('/path/to/hello.world', 'r') as f:
...     instance.file = File(f)
id

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

is_application_paper

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

is_image

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

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.

request_id

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

class fin_aid.models.AidRequest(id, author, applicant, category, reason, req_sum, urgent, accepted_sum, status, add_dttm, examination_dttm, payment_dt, examination_comment, submitted_paper, paid_with_cash, verified)[source]

Bases: django.db.models.base.Model

ACCEPTED = 2
AID_REQUEST_STATUS = ((1, 'Заявление рассматривается'), (2, 'Заявление одобрено'), (3, 'В заявлении отказано'), (4, 'Необходимо уточнить данные'), (5, 'Предварительно одобрено'))
DECLINED = 3
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

INFO_NEEDED = 4
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PRE_ACCEPTED = 5
WAITING = 1
accepted_sum

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

add_dttm

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

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

applicant

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.

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

can_view(user)[source]
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.

examination_comment

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

examination_dttm

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

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.

images_tags()[source]
objects = <django.db.models.manager.Manager object>
paid_with_cash

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

payment_dt

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

reason

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

req_sum

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

status

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

status_text
submitted_paper

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

static to_csv(filename, year=None, month=None)[source]
urgent

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

classmethod user_requests(user: django.contrib.auth.models.User)[source]
verified

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

class fin_aid.models.Category(id, name, reason, max_sum, max_quantity, notifications, show_to_students, is_senate)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

id

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

is_senate

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

max_quantity

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

max_sum

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.

notifications

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

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

show_to_students

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

class fin_aid.models.MonthlyData(id, year, month, limit, deadline_dt, student_deadline_dt, payment_dt)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

MONTH = [(1, 'Январь'), (2, 'Февраль'), (3, 'Март'), (4, 'Апрель'), (5, 'Май'), (6, 'Июнь'), (7, 'Июль'), (8, 'Август'), (9, 'Сентябрь'), (10, 'Октябрь'), (11, 'Ноябрь'), (12, 'Декабрь')]
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

classmethod current()[source]
deadline_dt

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

get_month_display(*moreargs, **morekwargs)
get_next_by_deadline_dt(*moreargs, **morekwargs)
get_next_by_payment_dt(*moreargs, **morekwargs)
get_next_by_student_deadline_dt(*moreargs, **morekwargs)
get_previous_by_deadline_dt(*moreargs, **morekwargs)
get_previous_by_payment_dt(*moreargs, **morekwargs)
get_previous_by_student_deadline_dt(*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.

limit

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

month

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

classmethod next()[source]
objects = <django.db.models.manager.Manager object>
payment_dt

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

student_deadline_dt

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

sum_used
year

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

class fin_aid.models.Scholar(id, student, scholarship)[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>
scholarship

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.

scholarship_id

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

student

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.

student_id

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

class fin_aid.models.Scholarship(id, name, sum, frequency)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

MONTH = 1
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PAYMENT_FREQUENCY = ((1, 'Раз в месяц'), (2, 'Раз в семестр'), (3, 'Раз в год'))
SEMESTER = 2
YEAR = 3
frequency

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

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

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

sum

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

fin_aid.models.document_path(instance, filename)[source]
fin_aid.models.get_name(self: django.contrib.auth.models.User)[source]
fin_aid.models.get_next_date(dt=None, t='payment')[source]
fin_aid.models.is_image(file)[source]
fin_aid.models.user_hash(user)[source]

fin_aid.tests module

fin_aid.urls module

fin_aid.views module

class fin_aid.views.AidRequestCreate(**kwargs)[source]

Bases: fin_aid.views.AidRequestCreateUpdate, django.views.generic.edit.BaseCreateView

get_success_message(cleaned_data)[source]
class fin_aid.views.AidRequestCreateUpdate(**kwargs)[source]

Bases: django.contrib.messages.views.SuccessMessageMixin, django.views.generic.detail.SingleObjectTemplateResponseMixin, django.views.generic.base.TemplateResponseMixin, django.views.generic.edit.ModelFormMixin, django.views.generic.edit.FormMixin, django.views.generic.detail.SingleObjectMixin, django.views.generic.edit.ProcessFormView, django.views.generic.base.View

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

alias of AidRequestCreateForm

form_valid(form)[source]
get_context_data(**kwargs)[source]
get_success_url()[source]
model

alias of AidRequest

template_name = 'fin_aid/aidrequest_form.html'
class fin_aid.views.AidRequestDelete(**kwargs)[source]

Bases: django.views.generic.edit.DeleteView

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

alias of AidRequest

success_url = '/aid/requests'
class fin_aid.views.AidRequestDetail(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

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

alias of AidRequest

class fin_aid.views.AidRequestList(**kwargs)[source]

Bases: django.views.generic.list.ListView

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

alias of AidRequest

class fin_aid.views.AidRequestUpdate(**kwargs)[source]

Bases: fin_aid.views.AidRequestCreateUpdate, django.views.generic.edit.BaseUpdateView

dispatch(request, *args, **kwargs)[source]
success_message = 'Заявление на матпомощь изменено. Результаты рассмотрения будут доступны в личном кабинете'
class fin_aid.views.ExportAidRequest(**kwargs)[source]

Bases: django.views.generic.edit.BaseFormView, django.views.generic.edit.FormMixin, django.views.generic.edit.ProcessFormView, django.views.generic.base.View

dispatch(request, *args, **kwargs)[source]
form_class

alias of SelectExportMonthForm

form_invalid(form)[source]
form_valid(form)[source]
success_url = '/admin/fin_aid/aidrequest/'

Module contents