loefsys.events.models.registration module

Module containing the model for an event registration.

class loefsys.events.models.registration.EventRegistration(*args, **kwargs)

Bases: Model Extensions

Registration model for an event.

Registering for an event lets you claim a spot in the event. If an event is full, the registration is put in a queue. The registration can be also be cancelled, with a possible fine if it is cancelled late. Registrations can also come with a price.

created

The timestamp of the creation of this model.

Type:

datetime

modified

The timestamp of last modification of this model.

Type:

datetime

event

The event to which the registration applies.

Type:

Event

contact

The contact that the registration is for.

Type:

Contact

status

The status is active, in the queue, or cancelled, either with or without fine.

Type:

RegistrationStatus

price_at_registration

The agreed price of the event at the time of registration.

Type:

Decimal

fine_at_registration

The agreed fine for cancellation at the time of registration.

Type:

Decimal

costs

The cost for this event, automatically calculated from the status.

Type:

Decimal

costs_paid

The amount paid for this registration by the contact.

Type:

Decimal

event

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.

contact

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.

status

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

price_at_registration

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

fine_at_registration

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

costs

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

costs_paid

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

property form_fields

Get form fields and their values on the registration form.

objects = <loefsys.events.models.managers.EventRegistrationManager object>
save(**kwargs: Any) None

Save the model to the database.

When creating a new registration, the attributes price_at_registration and fine_at_registration are copied from the :attr`.event`.

Return type:

None

Parameters:

kwargs (Any)

costs_to_pay() Decimal

Calculate the amount needed to be paid by the registration contact.

TODO See if this function can be converted into a GeneratedField as well.

Returns:

The amount of money in Euro’s.

Return type:

Decimal

cancel() None

Cancel a registration.

Upon cancellation, it is calculated whether a fine will be applied. The status of the registration is then either changed to loefsys.events.models.choices.RegistrationStatus.CANCELLED_FINE or loefsys.events.models.choices.RegistrationStatus.CANCELLED_NOFINE. Afterwards, the event is notified to potentially activate a registration in the queue.

Return type:

None

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

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

contact_id
created

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

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

event_id
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)
get_status_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: status>)
id

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

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

modified

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

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