Designer

Todo

Docstrings (module, models, utilities)

Models

class indico.modules.designer.models.images.DesignerImageFile(**kwargs)

Bases: indico.core.storage.models.StoredFileMixin, sqlalchemy.ext.declarative.api.Model

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

content_type

The MIME type of the file.

created_dt

The date/time when the file was uploaded.

download_url
extension

The extension of the file.

filename

The name of the file.

id

The ID of the file

locator
md5

An MD5 hash of the file.

Automatically assigned when save() is called.

size

The size of the file (in bytes).

Automatically assigned when save() is called.

storage_backend
storage_file_id
template
template_id

The designer template the image belongs to

version_of = None
class indico.modules.designer.models.templates.DesignerTemplate(**kwargs)

Bases: sqlalchemy.ext.declarative.api.Model

background_image
background_image_id
backside_template
backside_template_id
category
category_id
data
event
event_id
id
is_clonable
is_system_template
is_ticket
locator

Define a smart locator property.

This behaves pretty much like a normal read-only property and the decorated function should return a dict containing the necessary data to build a URL for the object.

This decorator should usually be applied to a method named locator as this name is required for get_locator to find it automatically when just passing the object.

If you need more than one locator, you can define it like this:

@locator_property
def locator(self):
    return {...}

@locator.other
def locator(self):
    return {...}

The other locator can then be accessed by passing obj.locator.other to the code expecting an object with a locator.

owner
title
type

Utilities

indico.modules.designer.util.get_all_templates(obj)

Get all templates usable by an event/category.

indico.modules.designer.util.get_default_badge_on_category(category, only_inherited=False)
indico.modules.designer.util.get_default_ticket_on_category(category, only_inherited=False)
indico.modules.designer.util.get_image_placeholder_types()
indico.modules.designer.util.get_inherited_templates(obj)

Get all templates inherited by a given event/category.

indico.modules.designer.util.get_nested_placeholder_options()
indico.modules.designer.util.get_not_deletable_templates(obj)

Get all non-deletable templates for an event/category.

indico.modules.designer.util.get_placeholder_options()
class indico.modules.designer.pdf.DesignerPDFBase(template, config)

Bases: object

get_pdf()
class indico.modules.designer.pdf.TplData(width, height, items, background_position, width_cm, height_cm)

Bases: tuple

Create new instance of TplData(width, height, items, background_position, width_cm, height_cm)

background_position

Alias for field number 3

height

Alias for field number 1

height_cm

Alias for field number 5

items

Alias for field number 2

width

Alias for field number 0

width_cm

Alias for field number 4

Placeholders

class indico.modules.designer.placeholders.EventDatesPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Dates'
group = u'event'
name = u'event_dates'
classmethod render(event)
class indico.modules.designer.placeholders.EventDescriptionPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Description'
group = u'event'
name = u'event_description'
classmethod render(event)
class indico.modules.designer.placeholders.RegistrationFullNamePlaceholder

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name'
name = u'full_name'
name_options = {}
with_title = True
class indico.modules.designer.placeholders.EventOrgTextPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Organizers'
group = u'event'
name = u'event_organizers'
classmethod render(event)
class indico.modules.designer.placeholders.RegistrationFullNameNoTitlePlaceholder

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name (no title)'
name = u'full_name_no_title'
name_options = {}
with_title = False
class indico.modules.designer.placeholders.RegistrationFullNamePlaceholderB

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name B'
name = u'full_name_b'
name_options = {u'last_name_first': False}
with_title = True
class indico.modules.designer.placeholders.RegistrationFullNameNoTitlePlaceholderB

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name B (no title)'
name = u'full_name_b_no_title'
name_options = {u'last_name_first': False}
with_title = False
class indico.modules.designer.placeholders.RegistrationFullNamePlaceholderC

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name C'
name = u'full_name_c'
name_options = {u'last_name_first': False, u'last_name_upper': True}
with_title = True
class indico.modules.designer.placeholders.RegistrationFullNameNoTitlePlaceholderC

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name C (no title)'
name = u'full_name_no_title_c'
name_options = {u'last_name_upper': True}
with_title = False
class indico.modules.designer.placeholders.RegistrationFullNamePlaceholderD

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name D (abbrev.)'
name = u'full_name_d'
name_options = {u'abbrev_first_name': True, u'last_name_first': False, u'last_name_upper': True}
with_title = True
class indico.modules.designer.placeholders.RegistrationFullNameNoTitlePlaceholderD

Bases: indico.modules.designer.placeholders.FullNamePlaceholderBase

description = lu'Full Name D (abbrev., no title)'
name = u'full_name_no_title_d'
name_options = {u'abbrev_first_name': True, u'last_name_upper': True}
with_title = False
class indico.modules.designer.placeholders.RegistrationTitlePlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPDPlaceholder

description = lu'Title'
field = u'title'
name = u'title'
class indico.modules.designer.placeholders.RegistrationFirstNamePlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPlaceholder

description = lu'First Name'
field = u'first_name'
name = u'first_name'
class indico.modules.designer.placeholders.RegistrationLastNamePlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPlaceholder

description = lu'Last Name'
field = u'last_name'
name = u'last_name'
class indico.modules.designer.placeholders.RegistrationTicketQRPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Ticket QR Code'
group = u'registrant'
is_image = True
is_ticket = True
name = u'ticket_qr_code'
classmethod render(registration)
class indico.modules.designer.placeholders.RegistrationEmailPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPlaceholder

description = lu'E-mail'
field = u'email'
name = u'email'
class indico.modules.designer.placeholders.RegistrationAmountPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPlaceholder

description = lu'Price (no currency)'
name = u'amount'
classmethod render(registration)
class indico.modules.designer.placeholders.RegistrationPricePlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPlaceholder

description = lu'Price (with currency)'
name = u'price'
classmethod render(registration)
class indico.modules.designer.placeholders.RegistrationFriendlyIDPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPlaceholder

description = lu'Registration ID'
field = u'friendly_id'
name = u'registration_friendly_id'
class indico.modules.designer.placeholders.RegistrationAffiliationPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPDPlaceholder

description = lu'Institution'
field = u'affiliation'
name = u'affiliation'
class indico.modules.designer.placeholders.RegistrationPositionPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPDPlaceholder

description = lu'Position'
field = u'position'
name = u'position'
class indico.modules.designer.placeholders.RegistrationAddressPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPDPlaceholder

description = lu'Address'
field = u'address'
name = u'address'
class indico.modules.designer.placeholders.RegistrationCountryPlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPDPlaceholder

description = lu'Country'
field = u'country'
name = u'country'
class indico.modules.designer.placeholders.RegistrationPhonePlaceholder

Bases: indico.modules.designer.placeholders.RegistrationPDPlaceholder

description = lu'Phone'
field = u'phone'
name = u'phone'
class indico.modules.designer.placeholders.EventTitlePlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Title'
group = u'event'
name = u'event_title'
classmethod render(event)
class indico.modules.designer.placeholders.CategoryTitlePlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Category Title'
group = u'event'
name = u'category_title'
classmethod render(event)
class indico.modules.designer.placeholders.EventRoomPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Room'
group = u'event'
name = u'event_room'
classmethod render(event)
class indico.modules.designer.placeholders.EventVenuePlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Venue'
group = u'event'
name = u'event_venue'
classmethod render(event)
class indico.modules.designer.placeholders.EventSpeakersPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Speakers/Chairs'
group = u'event'
name = u'event_speakers'
classmethod render(event)
class indico.modules.designer.placeholders.EventLogoPlaceholder

Bases: indico.modules.designer.placeholders.DesignerPlaceholder

description = lu'Event Logo'
group = u'event'
is_image = True
name = u'event_logo'
classmethod render(event)