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']¶
-
-
class
cycle_storage.admin.PlaceAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdmin-
list_display= ('__str__', 'bicycle')¶
-
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-
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¶
-
class
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_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.
-
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.parentis aForwardManyToOneDescriptorinstance.
-
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.restaurantis aReverseOneToOneDescriptorinstance.
-
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.placeis aForwardOneToOneDescriptorinstance.
-
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.parentis aForwardManyToOneDescriptorinstance.
-
storage_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
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
-
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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
total_places¶
-
exception
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-
form_class¶ alias of
BicycleCreateForm
-
model¶ alias of
Bicycle
-
success_url= '/bicycle/my'¶
-
-
class
cycle_storage.views.BicycleDelete(**kwargs)[source]¶ Bases:
django.views.generic.edit.DeleteView-
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-
form_class¶ alias of
BicycleCreateForm
-
model¶ alias of
Bicycle
-
success_url= '/bicycle/my'¶
-