django_program.registration.badge¶
Badge models for generating attendee badges with QR codes.
Provides a configurable badge template system and a model for tracking generated badge files (PDF or PNG) per attendee.
Classes
A generated badge for a specific attendee. |
|
Configurable badge layout template for a conference. |
- class django_program.registration.badge.BadgeTemplate[source]¶
Bases:
ModelConfigurable badge layout template for a conference.
Defines dimensions, visible fields, color scheme, and optional logo for generating attendee badges. Each conference can have multiple templates but only one may be marked as the default.
- 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.parentis aForwardManyToOneDescriptorinstance.
- 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.
- is_default¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- width_mm¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- height_mm¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class BannerPosition[source]¶
Bases:
TextChoicesWhere to place the ticket type banner on the badge.
- BELOW_HEADER = 'below_header'¶
- ABOVE_NAME = 'above_name'¶
- BELOW_NAME = 'below_name'¶
- BOTTOM = 'bottom'¶
- __new__(value)¶
- ticket_banner_position¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_email¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_company¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_ticket_type¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_qr_code¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- show_conference_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- background_color¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- text_color¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- accent_color¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- font_name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- font_body¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- logo¶
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- background_image¶
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- 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
- 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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
- conference_id¶
- 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_ticket_banner_position_display(*, field=<django.db.models.fields.CharField: ticket_banner_position>)¶
- 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.registration.badge.Badge[source]¶
Bases:
ModelA generated badge for a specific attendee.
Tracks the generated file, format, and timestamp so badges can be cached and regenerated on demand.
- class Format[source]¶
Bases:
TextChoicesSupported badge output formats.
- PDF = 'pdf'¶
- PNG = 'png'¶
- __new__(value)¶
- 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.parentis aForwardManyToOneDescriptorinstance.
- template¶
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.parentis aForwardManyToOneDescriptorinstance.
- format¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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)
- generated_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.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- attendee_id¶
- get_format_display(*, field=<django.db.models.fields.CharField: format>)¶
- 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)¶
- 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>¶
- template_id¶