loefsys.reservations.models package
Module defining models for the reservations app.
- class loefsys.reservations.models.Boat(*args, **kwargs)
Bases:
ReservableItem
Describes a boat that can be reserved.
A boat is part of our or any external fleet of boats. It can be any type of boat. A boat requires a certain skipper’s certificate. It has a limited capacity and can possibly have an engine.
- fleet
The provider of the boat.
- Type:
- requires_skippership
The skippership needed to reserve the boat. Can be none.
- Type:
- capacity
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- has_engine
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- fleet
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- requires_skippership
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 aForwardManyToOneDescriptor
instance.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_fleet_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: fleet>)
- requires_skippership_id
- reservableitem_ptr
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 aForwardOneToOneDescriptor
instance.
- reservableitem_ptr_id
- class loefsys.reservations.models.Material(*args, **kwargs)
Bases:
ReservableItem
Describes a material item that can be reserved.
A gear-piece is any wearable item used for sailing. It is of a type and has a size measure.
- size
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- reservableitem_ptr
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 aForwardOneToOneDescriptor
instance.
- reservableitem_ptr_id
- class loefsys.reservations.models.ReservableItem(*args, **kwargs)
Bases:
Model Extensions
The base model for a reservable item.
A reservable item is an object that can be reserved. It can be set as non-reservable, for example due to maintenance. Additionally, it has a location and has a list of known complications.
TODO Add complications.
- reservable_type
The type for which the pricing is set.
- Type:
- is_reservable
Flag to show availability.
For example, if an item is unavailable due to maintenance, the value is set to False.
- Type:
- name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- reservable_type
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 aForwardManyToOneDescriptor
instance.
- location
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_reservable
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- boat
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 aReverseOneToOneDescriptor
instance.
- created
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_location_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: location>)
- get_next_by_created(*, field=<django_extensions.db.fields.CreationDateTimeField: created>, is_next=True, **kwargs)
- get_next_by_modified(*, field=<django_extensions.db.fields.ModificationDateTimeField: modified>, is_next=True, **kwargs)
- get_previous_by_created(*, field=<django_extensions.db.fields.CreationDateTimeField: created>, is_next=False, **kwargs)
- get_previous_by_modified(*, field=<django_extensions.db.fields.ModificationDateTimeField: modified>, is_next=False, **kwargs)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- material
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 aReverseOneToOneDescriptor
instance.
- modified
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>
- reservable_type_id
- reservation_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- room
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 aReverseOneToOneDescriptor
instance.
- class loefsys.reservations.models.ReservableType(*args, **kwargs)
Bases:
Model Extensions
Model representing a type of reservable.
This model exists to be able to make a collection of all reservables of the same type. Examples are wetsuits of the same size or the two ‘valkjes’ Scylla and Charybdis.
- category
The category that the type falls under.
- Type:
- name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- category
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- created
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_category_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: category>)
- get_next_by_created(*, field=<django_extensions.db.fields.CreationDateTimeField: created>, is_next=True, **kwargs)
- get_next_by_modified(*, field=<django_extensions.db.fields.ModificationDateTimeField: modified>, is_next=True, **kwargs)
- get_previous_by_created(*, field=<django_extensions.db.fields.CreationDateTimeField: created>, is_next=False, **kwargs)
- get_previous_by_modified(*, field=<django_extensions.db.fields.ModificationDateTimeField: modified>, is_next=False, **kwargs)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- log_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- modified
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>
- reservableitem_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reservabletypepricing
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 aReverseOneToOneDescriptor
instance.
- class loefsys.reservations.models.ReservableTypePricing(*args, **kwargs)
Bases:
Model Extensions
Pricing for the type of reservable.
With this model, the pricing for a given ReservableType can be set for any membership defined by the Memberships enum.
- reservable_type
The type for which the pricing is set.
- Type:
- membership_type
The membership type for which the pricing is set.
- Type:
MembershipTypes
- reservable_type
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 aForwardOneToOneDescriptor
instance.
- membership_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- price
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- created
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_membership_type_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: membership_type>)
- get_next_by_created(*, field=<django_extensions.db.fields.CreationDateTimeField: created>, is_next=True, **kwargs)
- get_next_by_modified(*, field=<django_extensions.db.fields.ModificationDateTimeField: modified>, is_next=True, **kwargs)
- get_previous_by_created(*, field=<django_extensions.db.fields.CreationDateTimeField: created>, is_next=False, **kwargs)
- get_previous_by_modified(*, field=<django_extensions.db.fields.ModificationDateTimeField: modified>, is_next=False, **kwargs)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- modified
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>
- reservable_type_id
- class loefsys.reservations.models.Reservation(*args, **kwargs)
Bases:
Model
Model describing a reservation of a reservable item.
A reservation is a ‘time-claim’ anyone can put on a reservable item. It has a start time and end time which is after the start time. The start time may be in the past, but only an admin can create reservation that ends in the past. The start time and end time may be on different dates, as long as the start time is earlier than the end time. A reservation has a reference to a person (or possibly to a group). A reservation has a function which can calculate any costs related to that reservation. A reservation has a log, which the user must fill in after the reservation has ended. A reservation can be linked to a group, training or event.
A boat reservation can be linked to a training (or event). If it is not then it must be reserved by a person with the required skipper’s certificate. If the boat has an engine, then the user can set an amount of engine-hours used.
- reserved_item
The ForeignKey.
- Type:
- reservee_member
The person reserving the item, is null if a group is reserving the item.
- Type:
- reservee_group
The group reserving the item, is null if a person is reserving the item.
- Type:
LoefBijterGroup
- authorized_userskippership
The person who is the authorized skipper for a boat.
- Type:
UserSkippership
- reserved_item
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 aForwardManyToOneDescriptor
instance.
- reservee_user
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 aForwardManyToOneDescriptor
instance.
- authorized_userskippership
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 aForwardManyToOneDescriptor
instance.
- start
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- end
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_of_creation
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()
Return the detail page url for this reservation.
- clean()
Check whether any of the other reservations overlap and if the boat requires a skippership.
- Raises:
ValidationError – This item has already been reserved during this timeslot.:
ValidationError – This item is not reservable at the moment.:
ValidationError – The boat selected requires an authorized skipper to be set.:
ValidationError – The skipper set is not authorized for this boat.:
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- authorized_userskippership_id
- get_next_by_date_of_creation(*, field=<django.db.models.fields.DateTimeField: date_of_creation>, is_next=True, **kwargs)
- get_next_by_end(*, field=<django.db.models.fields.DateTimeField: end>, is_next=True, **kwargs)
- get_next_by_start(*, field=<django.db.models.fields.DateTimeField: start>, is_next=True, **kwargs)
- get_previous_by_date_of_creation(*, field=<django.db.models.fields.DateTimeField: date_of_creation>, is_next=False, **kwargs)
- get_previous_by_end(*, field=<django.db.models.fields.DateTimeField: end>, is_next=False, **kwargs)
- get_previous_by_start(*, field=<django.db.models.fields.DateTimeField: start>, is_next=False, **kwargs)
- 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>
- reserved_item_id
- reservee_user_id
- class loefsys.reservations.models.Room(*args, **kwargs)
Bases:
ReservableItem
Model defining a room that can be reserved.
A room is a place the Loefbijter owns which can be used by any part within Loefbijter (this does not include the VvS). It has a limited capacity and has required permission.
- capacity
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- reservableitem_ptr
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 aForwardOneToOneDescriptor
instance.
- reservableitem_ptr_id
Submodules
- loefsys.reservations.models.boat module
- loefsys.reservations.models.choices module
- loefsys.reservations.models.forms module
- loefsys.reservations.models.log module
Log
Question
Question.log
Question.log
Question.BOOLEAN_FIELD
Question.INTEGER_FIELD
Question.TEXT_FIELD
Question.DATETIME_FIELD
Question.FIELD_TYPES
Question.type
Question.subject
Question.description
Question.required
Question.DoesNotExist
Question.MultipleObjectsReturned
Question.get_type_display()
Question.id
Question.log_id
Question.objects
- loefsys.reservations.models.material module
- loefsys.reservations.models.reservable module
ReservableType
ReservableType.name
ReservableType.category
ReservableType.description
ReservableType.name
ReservableType.category
ReservableType.description
ReservableType.DoesNotExist
ReservableType.MultipleObjectsReturned
ReservableType.created
ReservableType.get_category_display()
ReservableType.get_next_by_created()
ReservableType.get_next_by_modified()
ReservableType.get_previous_by_created()
ReservableType.get_previous_by_modified()
ReservableType.id
ReservableType.log_set
ReservableType.modified
ReservableType.objects
ReservableType.reservableitem_set
ReservableType.reservabletypepricing
ReservableTypePricing
ReservableTypePricing.reservable_type
ReservableTypePricing.membership_type
ReservableTypePricing.price
ReservableTypePricing.reservable_type
ReservableTypePricing.membership_type
ReservableTypePricing.price
ReservableTypePricing.DoesNotExist
ReservableTypePricing.MultipleObjectsReturned
ReservableTypePricing.created
ReservableTypePricing.get_membership_type_display()
ReservableTypePricing.get_next_by_created()
ReservableTypePricing.get_next_by_modified()
ReservableTypePricing.get_previous_by_created()
ReservableTypePricing.get_previous_by_modified()
ReservableTypePricing.id
ReservableTypePricing.modified
ReservableTypePricing.objects
ReservableTypePricing.reservable_type_id
ReservableItem
ReservableItem.name
ReservableItem.description
ReservableItem.reservable_type
ReservableItem.location
ReservableItem.is_reservable
ReservableItem.name
ReservableItem.description
ReservableItem.reservable_type
ReservableItem.location
ReservableItem.is_reservable
ReservableItem.DoesNotExist
ReservableItem.MultipleObjectsReturned
ReservableItem.boat
ReservableItem.created
ReservableItem.get_location_display()
ReservableItem.get_next_by_created()
ReservableItem.get_next_by_modified()
ReservableItem.get_previous_by_created()
ReservableItem.get_previous_by_modified()
ReservableItem.id
ReservableItem.material
ReservableItem.modified
ReservableItem.objects
ReservableItem.reservable_type_id
ReservableItem.reservation_set
ReservableItem.room
- loefsys.reservations.models.reservation module
Reservation
Reservation.reserved_item
Reservation.reservee_member
Reservation.reservee_group
Reservation.authorized_userskippership
Reservation.start
Reservation.end
Reservation.reserved_item
Reservation.reservee_user
Reservation.authorized_userskippership
Reservation.start
Reservation.end
Reservation.date_of_creation
Reservation.get_absolute_url()
Reservation.clean()
Reservation.DoesNotExist
Reservation.MultipleObjectsReturned
Reservation.authorized_userskippership_id
Reservation.get_next_by_date_of_creation()
Reservation.get_next_by_end()
Reservation.get_next_by_start()
Reservation.get_previous_by_date_of_creation()
Reservation.get_previous_by_end()
Reservation.get_previous_by_start()
Reservation.id
Reservation.objects
Reservation.reserved_item_id
Reservation.reservee_user_id
- loefsys.reservations.models.room module
- loefsys.reservations.models.user_log module