django_program.registration.letter

Visa invitation letter request model for conference attendees.

Tracks the lifecycle of invitation letter requests from submission through review, PDF generation, and delivery. Used by attendees who need a formal invitation letter for visa applications.

Classes

LetterRequest

A request for a visa invitation letter from a conference attendee.

class django_program.registration.letter.LetterRequest[source]

Bases: Model

A request for a visa invitation letter from a conference attendee.

Captures passport and travel details needed to produce a formal letter for embassy submission. Progresses through a review workflow from SUBMITTED to SENT (or REJECTED).

class Status[source]

Bases: TextChoices

Workflow states for a letter request.

SUBMITTED = 'submitted'
UNDER_REVIEW = 'under_review'
APPROVED = 'approved'
GENERATED = 'generated'
SENT = 'sent'
REJECTED = 'rejected'
__new__(value)
ALLOWED_TRANSITIONS: dict[str, set[str]] = {LetterRequest.Status.APPROVED: {LetterRequest.Status.GENERATED}, LetterRequest.Status.GENERATED: {LetterRequest.Status.SENT}, LetterRequest.Status.SUBMITTED: {LetterRequest.Status.APPROVED, LetterRequest.Status.REJECTED, LetterRequest.Status.UNDER_REVIEW}, LetterRequest.Status.UNDER_REVIEW: {LetterRequest.Status.APPROVED, LetterRequest.Status.REJECTED}}
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.

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.

attendee

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.

passport_name

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

passport_number

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

nationality

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

date_of_birth

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

travel_from

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

travel_until

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

destination_address

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

embassy_name

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

status

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

rejection_reason

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

generated_pdf

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
reviewed_by

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.

reviewed_at

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

sent_at

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.

transition_to(new_status)[source]

Transition this request to a new workflow status.

Validates that the transition is allowed before applying it.

Parameters:

new_status (str) – The target status value (one of Status choices).

Raises:

ValueError – If the transition from the current status to new_status is not permitted.

Return type:

None

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

attendee_id
conference_id
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_travel_from(*, field=<django.db.models.fields.DateField: travel_from>, is_next=True, **kwargs)
get_next_by_travel_until(*, field=<django.db.models.fields.DateField: travel_until>, 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_travel_from(*, field=<django.db.models.fields.DateField: travel_from>, is_next=False, **kwargs)
get_previous_by_travel_until(*, field=<django.db.models.fields.DateField: travel_until>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
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>
reviewed_by_id
user_id