django_program.programs.models

Activity, signup, and travel grant models for django-program.

Functions

receipt_upload_path(instance, filename)

Build per-user upload path: travel_grant_receipts/<username>/<filename>.

Classes

Activity

A conference activity such as a sprint, workshop, or social event.

ActivitySignup

A user's signup for an activity.

PaymentInfo

Secure payment details for travel grant reimbursement.

Receipt

An expense receipt uploaded by a travel grant recipient.

TravelGrant

A travel grant application for a conference.

TravelGrantMessage

Message attached to a travel grant application.

class django_program.programs.models.Activity[source]

Bases: Model

A conference activity such as a sprint, workshop, or social event.

Represents a scheduled or unscheduled activity that attendees can sign up for. The max_participants field caps signups when set, and spots_remaining computes the live availability.

Activities can be linked to Pretalx submission types via the pretalx_submission_type field. When set, the talks M2M is populated during sync with all talks of that submission type.

class ActivityType[source]

Bases: TextChoices

Classification of conference activities.

SPRINT = 'sprint'
WORKSHOP = 'workshop'
TUTORIAL = 'tutorial'
LIGHTNING_TALK = 'lightning_talk'
SOCIAL = 'social'
OPEN_SPACE = 'open_space'
SUMMIT = 'summit'
OTHER = 'other'
__new__(value)
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.

name

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

slug

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

activity_type

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.

location

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

room

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.

pretalx_submission_type

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

talks

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

start_time

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

end_time

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

max_participants

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

requires_ticket

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

external_url

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

is_active

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

organizers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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

property spots_remaining: int | None

Return the number of remaining confirmed spots, or None if unlimited.

promote_next_waitlisted()[source]

Promote the oldest waitlisted signup to confirmed.

Must be called inside a transaction. Returns the promoted signup or None if no one is waitlisted.

Return type:

ActivitySignup | None

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

conference_id
get_activity_type_display(*, field=<django.db.models.fields.CharField: activity_type>)
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.

objects = <django.db.models.manager.Manager object>
room_id
signups

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.

class django_program.programs.models.ActivitySignup[source]

Bases: Model

A user’s signup for an activity.

Each user may have at most one non-cancelled signup per activity, enforced by a conditional UniqueConstraint. The status field tracks whether the signup is confirmed, waitlisted, or cancelled.

class SignupStatus[source]

Bases: TextChoices

Lifecycle states for an activity signup.

CONFIRMED = 'confirmed'
WAITLISTED = 'waitlisted'
CANCELLED = 'cancelled'
__new__(value)
activity

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.

status

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

note

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

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

property is_confirmed: bool

Whether this signup is confirmed.

property is_waitlisted: bool

Whether this signup is on the waitlist.

property is_cancelled: bool

Whether this signup has been cancelled.

property can_cancel: bool

Whether this signup can be cancelled (confirmed or waitlisted).

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

activity_id
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_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>
user_id
class django_program.programs.models.TravelGrant[source]

Bases: Model

A travel grant application for a conference.

Modeled after PyCon US’s travel grant system. Tracks the full application lifecycle from submission through review, offer, and acceptance. Sensitive reimbursement details (bank info) are NOT stored here — they belong in a separate secure model collected only after acceptance.

class GrantStatus[source]

Bases: TextChoices

Lifecycle states for a travel grant application.

SUBMITTED = 'submitted'
WITHDRAWN = 'withdrawn'
INFO_NEEDED = 'info_needed'
OFFERED = 'offered'
NEED_MORE = 'need_more'
REJECTED = 'rejected'
DECLINED = 'declined'
ACCEPTED = 'accepted'
DISBURSED = 'disbursed'
__new__(value)
class RequestType[source]

Bases: TextChoices

What the applicant is requesting.

TICKET_ONLY = 'ticket_only'
TICKET_AND_GRANT = 'ticket_and_grant'
__new__(value)
class ExperienceLevel[source]

Bases: TextChoices

Python experience level of the applicant.

BEGINNER = 'beginner'
INTERMEDIATE = 'intermediate'
EXPERT = 'expert'
__new__(value)
class ApplicationType[source]

Bases: TextChoices

Classification of the grant application.

GENERAL = 'general'
STAFF = 'staff'
SPEAKER = 'speaker'
CORE_DEV = 'core_dev'
PSF_BOARD = 'psf_board'
COMMUNITY = 'community'
EDUCATION = 'education'
PYLADIES = 'pyladies'
OTHER = 'other'
__new__(value)
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.

status

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

application_type

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

request_type

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.

international

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

first_time

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

travel_plans_airfare_description

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

travel_plans_airfare_amount

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

travel_plans_lodging_description

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

travel_plans_lodging_amount

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

travel_plans_transit_description

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

travel_plans_transit_amount

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

travel_plans_visa_description

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

travel_plans_visa_amount

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

requested_amount

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

approved_amount

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

experience_level

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

occupation

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

involvement

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

reason

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

days_attending

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

sharing_expenses

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

traveling_with

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

reviewer_notes

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

promo_code

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

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.

disbursed_amount

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

disbursed_at

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

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

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.

property travel_plans_total: Decimal

Sum of airfare and lodging breakdown amounts.

property is_editable: bool

Whether the applicant can still edit their application.

property is_actionable: bool

Whether the applicant can accept/decline (offered state).

property show_accept_button: bool

Show accept button only when grant is offered.

property show_decline_button: bool

Show decline button only when grant is offered.

property show_withdraw_button: bool

Show withdraw button for submitted or info-needed grants.

property show_edit_button: bool

Show edit button for submitted or info-needed grants.

property is_ready_for_disbursement: bool

Whether grant has approved receipts and payment info, ready to disburse.

property show_provide_info_button: bool

Show provide-info button when reviewers request more info.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

conference_id
disbursed_by_id
get_application_type_display(*, field=<django.db.models.fields.CharField: application_type>)
get_experience_level_display(*, field=<django.db.models.fields.CharField: experience_level>)
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)
get_request_type_display(*, field=<django.db.models.fields.CharField: request_type>)
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.

messages

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>
payment_info

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

receipts

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.

reviewed_by_id
user_id
class django_program.programs.models.TravelGrantMessage[source]

Bases: Model

Message attached to a travel grant application.

Reviewers can leave internal notes (visible=False) or messages visible to the applicant (visible=True). Applicant messages are always visible to reviewers.

grant

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.

visible

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

message

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.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
grant_id
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>
user_id
django_program.programs.models.receipt_upload_path(instance, filename)[source]

Build per-user upload path: travel_grant_receipts/<username>/<filename>.

Parameters:
Return type:

str

class django_program.programs.models.Receipt[source]

Bases: Model

An expense receipt uploaded by a travel grant recipient.

class ReceiptType[source]

Bases: TextChoices

AIRFARE = 'airfare'
LODGING = 'lodging'
__new__(value)
grant

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.

receipt_type

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.

amount

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

date

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

receipt_file

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)
approved

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

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

approved_at

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

flagged

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

flagged_reason

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

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

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

property status: str

Return the current review status of this receipt.

property can_delete: bool

Whether this receipt can be deleted by the applicant.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

approved_by_id
flagged_by_id
get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_next_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_date(*, field=<django.db.models.fields.DateField: date>, is_next=False, **kwargs)
get_receipt_type_display(*, field=<django.db.models.fields.CharField: receipt_type>)
grant_id
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>
class django_program.programs.models.PaymentInfo[source]

Bases: Model

Secure payment details for travel grant reimbursement.

class PaymentMethod[source]

Bases: TextChoices

ZELLE = 'zelle'
PAYPAL = 'paypal'
ACH = 'ach'
WIRE = 'wire'
WISE = 'wise'
CHECK = 'check'
__new__(value)
grant

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.

payment_method

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

legal_name

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

address_street

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

address_city

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

address_state

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

address_zip

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

address_country

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

paypal_email

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

zelle_email

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

wise_email

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

bank_name

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

bank_account_number

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

bank_routing_number

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

bank_holder_name

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

bank_holder_address

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

bank_address

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

bank_additional

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.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

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_payment_method_display(*, field=<django.db.models.fields.CharField: payment_method>)
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)
grant_id
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>