django_program.registration.attendee

Attendee profile models for conference registration.

Provides an abstract base for projects that need custom attendee profile fields, and a concrete Attendee model that links users to conferences with check-in tracking and access codes.

Functions

generate_access_code(*[, max_retries])

Generate an 8-character uppercase alphanumeric access code.

Classes

Attendee

Links a user to a conference with registration state and check-in tracking.

AttendeeProfileBase

Abstract base for attendee profiles.

django_program.registration.attendee.generate_access_code(*, max_retries=10)[source]

Generate an 8-character uppercase alphanumeric access code.

Retries on collision up to max_retries times. The keyspace is 36^8 (~2.8 trillion), so collisions are extremely unlikely.

Parameters:

max_retries (int) – Maximum retry attempts on collision.

Return type:

str

Returns:

A unique random string of 8 uppercase letters and digits.

Raises:

RuntimeError – If a unique code cannot be generated after retries.

class django_program.registration.attendee.AttendeeProfileBase[source]

Bases: Model

Abstract base for attendee profiles.

Projects extend this with custom fields (e.g. dietary restrictions, t-shirt size) by subclassing and pointing DJANGO_PROGRAM.attendee_profile_model at the concrete subclass.

user

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.

access_code

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

completed_registration

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

created_at

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

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 Meta[source]

Bases: object

abstract = False
save(*args, **kwargs)[source]

Auto-generate access code on first save if not already set.

Parameters:
Return type:

None

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
user_id
class django_program.registration.attendee.Attendee[source]

Bases: Model

Links a user to a conference with registration state and check-in tracking.

Unlike AttendeeProfileBase, this uses a ForeignKey to the user because a single user can attend multiple conferences. The order field is also a ForeignKey (not OneToOne) so that replacement/upgrade orders can update the link without constraint violations.

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 a ForwardManyToOneDescriptor instance.

conference

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.

order

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.

access_code

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

checked_in_at

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

completed_registration

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

created_at

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

updated_at

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

save(*args, **kwargs)[source]

Auto-generate access code on first save if not already set.

Parameters:
Return type:

None

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

badges

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.

checkins

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.

conference_id
door_checks

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.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, 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.

letter_requests

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.

objects = <django.db.models.manager.Manager object>
order_id
redemptions

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.

user_id