fairdm.contrib.identity.models#

Singleton models holding the portal’s branding and governing authority.

Module Contents#

Classes#

BrandAssets

Abstract model adding light and dark theme variants of a logo and an icon.

Authority

Governing authority or organization managing the portal.

Identity

Portal identity configuration including branding and metadata.

Functions#

brand_asset_path

Return the upload path for a brand asset (logo or icon).

API#

brand_asset_path(instance, filename: str) → str#

Return the upload path for a brand asset (logo or icon).

Args: instance: The Authority or Identity being saved. filename: The uploaded file’s name.

Returns: identity/<model name>_<filename>, for example identity/portal-identity_logo.svg.

class BrandAssets(*args, **kwargs)#

Bases: django.db.models.Model

Abstract model adding light and dark theme variants of a logo and an icon.

Attributes: logo_light: Logo for light theme backgrounds. logo_dark: Logo for dark theme backgrounds. icon_light: Small icon or favicon for the light theme. icon_dark: Small icon or favicon for the dark theme.

Initialization

logo_light#

‘ThumbnailerImageField(…)’

logo_dark#

‘ThumbnailerImageField(…)’

icon_light#

‘ThumbnailerImageField(…)’

icon_dark#

‘ThumbnailerImageField(…)’

class Meta#
abstract#

True

class Authority(*args, **kwargs)#

Bases: fairdm.contrib.identity.models.BrandAssets, solo.models.SingletonModel, parler.models.TranslatableModel

Governing authority or organization managing the portal.

Initialization

url#

‘URLField(…)’

contact#

‘EmailField(…)’

translations#

‘TranslatedFields(…)’

class Meta#
verbose_name#

‘_(…)’

class Identity(*args, **kwargs)#

Bases: fairdm.contrib.identity.models.BrandAssets, solo.models.SingletonModel, parler.models.TranslatableModel

Portal identity configuration including branding and metadata.

Initialization

keywords#

‘MultiConceptField(…)’

translations#

‘TranslatedFields(…)’

class Meta#
db_table#

‘identity_database’

verbose_name#

‘_(…)’

save(*args, **kwargs)#

Save, then use the portal name as the admin site header and title.