cycle_storage package

Subpackages

Submodules

cycle_storage.admin module

class cycle_storage.admin.BicycleAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

form

alias of BicycleAdminForm

list_display = ('owner', 'manufacturer', 'model', 'place', 'verified', 'request_status')
list_filter = ('verified', 'request_status', <class 'cycle_storage.admin.PlaceFilter'>)
media
readonly_fields = ['image_tag']
save_model(request, obj, form, change)[source]
class cycle_storage.admin.PlaceAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('__str__', 'bicycle')
media
class cycle_storage.admin.PlaceFilter(request, params, model, model_admin)[source]

Bases: django.contrib.admin.filters.SimpleListFilter

lookups(request, model_admin)[source]
parameter_name = 'place'
queryset(request, queryset)[source]
title = 'Присвоено место'
class cycle_storage.admin.StorageAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('dorm', 'name', 'total_places', 'free_places')
media

cycle_storage.forms module

class cycle_storage.forms.BicycleAdminForm(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

exclude = ['image_tag', 'photo']
model

alias of Bicycle

base_fields = OrderedDict([('owner', <django.forms.models.ModelChoiceField object>), ('manufacturer', <django.forms.fields.CharField object>), ('model', <django.forms.fields.CharField object>), ('info', <django.forms.fields.CharField object>), ('verified', <django.forms.fields.BooleanField object>), ('request_status', <django.forms.fields.TypedChoiceField object>), ('place', <django.forms.models.ModelChoiceField object>)])
declared_fields = OrderedDict([('place', <django.forms.models.ModelChoiceField object>)])
media
class cycle_storage.forms.BicycleCreateForm(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 = ['manufacturer', 'model', 'info', 'photo']
model

alias of Bicycle

base_fields = OrderedDict([('manufacturer', <django.forms.fields.CharField object>), ('model', <django.forms.fields.CharField object>), ('info', <django.forms.fields.CharField object>), ('photo', <django.forms.fields.ImageField object>)])
declared_fields = OrderedDict()
media

cycle_storage.models module

class cycle_storage.models.Bicycle(id, owner, manufacturer, model, info, add_dttm, photo, verified, request_status)[source]

Bases: django.db.models.base.Model

ACCEPTED = 2
BIKE_STATUS = ((1, 'Заявка рассматривается'), (2, 'Одобрено'), (3, 'Отказано'), (4, 'Нет мест'))
DECLINED = 3
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

NO_PLACE = 4
WAITING = 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.

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

image_tag()[source]
info

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

manufacturer

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

model

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

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.

owner_id

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

photo

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

place

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

In the example:

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

place.restaurant is a ReverseOneToOneDescriptor instance.

request_status

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

verified

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

class cycle_storage.models.Place(id, storage, name, bicycle)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

bicycle

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.

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

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

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.

storage_id

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

class cycle_storage.models.Storage(id, dorm, name)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

create_places(num)[source]
dorm

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

free_places
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>
place_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.

randomly_fill()[source]
total_places
cycle_storage.models.bike_photo_path(instance, filename)[source]

cycle_storage.tests module

cycle_storage.urls module

cycle_storage.views module

class cycle_storage.views.BicycleCreate(**kwargs)[source]

Bases: django.views.generic.edit.CreateView

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

alias of BicycleCreateForm

form_valid(form)[source]
model

alias of Bicycle

success_url = '/bicycle/my'
class cycle_storage.views.BicycleDelete(**kwargs)[source]

Bases: django.views.generic.edit.DeleteView

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

alias of Bicycle

success_url = '/bicycle/'
class cycle_storage.views.BicycleDetail(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

model

alias of Bicycle

class cycle_storage.views.BicycleUpdate(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

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

alias of BicycleCreateForm

form_valid(form)[source]
model

alias of Bicycle

success_url = '/bicycle/my'
class cycle_storage.views.MyBicycleDetail(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

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

alias of Bicycle

template = 'bicycle/bicycle_detail.html'
cycle_storage.views.has_bike(user)[source]

Module contents