rpaper.apps.reservations package

Submodules

rpaper.apps.reservations.admin module

class rpaper.apps.reservations.admin.RecordAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media
readonly_fields = ('pk', 'owner')
save_model(request, obj, form, change)[source]
class rpaper.apps.reservations.admin.ThingAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

media
readonly_fields = ('pk', 'owner')
save_model(request, obj, form, change)[source]

rpaper.apps.reservations.apps module

rpaper.apps.reservations.middleware module

class rpaper.apps.reservations.middleware.RecordCredentialMiddleware(get_response)[source]

Bases: object

rpaper.apps.reservations.middleware.get_record_credential()[source]
rpaper.apps.reservations.middleware.set_record_credential(value)[source]

rpaper.apps.reservations.models module

class rpaper.apps.reservations.models.Record(hashid, name, contact, remarks, thing, owner, start_at, end_at, credential, ipaddress, created_at, updated_at)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Record.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Record.TIMESPAN_MAX_HOURS = 24
Record.TIMESPAN_THRESHOLD = datetime.timedelta(1)
Record.clean()[source]
Record.contact

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

Record.created_at

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

Record.credential

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

Record.end_at

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

Record.get_next_by_created_at(*moreargs, **morekwargs)
Record.get_next_by_end_at(*moreargs, **morekwargs)
Record.get_next_by_start_at(*moreargs, **morekwargs)
Record.get_next_by_updated_at(*moreargs, **morekwargs)
Record.get_previous_by_created_at(*moreargs, **morekwargs)
Record.get_previous_by_end_at(*moreargs, **morekwargs)
Record.get_previous_by_start_at(*moreargs, **morekwargs)
Record.get_previous_by_updated_at(*moreargs, **morekwargs)
Record.get_timespan_display()[source]

Return a human readable time-span string

Record.hashid
Record.ipaddress

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

Record.is_collided(other)[source]

Return if the record is collided with other

Record.name

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

Record.objects = <rpaper.apps.reservations.models.RecordManager object>
Record.owner

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

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Record.owner_id

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

Record.remarks

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

Record.save(force_insert=False, force_update=False, using=None, update_fields=None)

Saves the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

Record.start_at

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

Record.thing

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

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Record.thing_id

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

Record.updated_at

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

class rpaper.apps.reservations.models.RecordManager[source]

Bases: django.db.models.manager.Manager

A management class of Record model

collide_with(record)[source]

Return records queryset which collide with a record

class rpaper.apps.reservations.models.Thing(hashid, name, remarks, thumbnail, owner, ipaddress, created_at, updated_at)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Thing.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Thing.created_at

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

Thing.get_absolute_url()[source]
Thing.get_next_by_created_at(*moreargs, **morekwargs)
Thing.get_next_by_updated_at(*moreargs, **morekwargs)
Thing.get_previous_by_created_at(*moreargs, **morekwargs)
Thing.get_previous_by_updated_at(*moreargs, **morekwargs)
Thing.hashid
Thing.ipaddress

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

Thing.name

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

Thing.objects = <django.db.models.manager.Manager object>
Thing.owner

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

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

Thing.owner_id

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

Thing.records

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.

Thing.remarks

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

Thing.thumbnail

Enhanced ImageFileDescriptor

Just like the ImageFileDescriptor, but for ThumbnailField. The only difference is removing previous Image and Thumbnails from storage when the value has changed.

Thing.updated_at

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

rpaper.apps.reservations.perms module

class rpaper.apps.reservations.perms.RecordPermissionLogic[source]

Bases: permission.logics.base.PermissionLogic

has_perm(user_obj, perm, obj=None)[source]
class rpaper.apps.reservations.perms.ThingPermissionLogic[source]

Bases: permission.logics.base.PermissionLogic

has_perm(user_obj, perm, obj=None)[source]

Module contents