fairdm.contrib.identity.models#
Singleton models holding the portal’s branding and governing authority.
Module Contents#
Classes#
Abstract model adding light and dark theme variants of a logo and an icon. |
|
Governing authority or organization managing the portal. |
|
Portal identity configuration including branding and metadata. |
Functions#
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 exampleidentity/portal-identity_logo.svg.
- class BrandAssets(*args, **kwargs)#
Bases:
django.db.models.ModelAbstract 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 Authority(*args, **kwargs)#
Bases:
fairdm.contrib.identity.models.BrandAssets,solo.models.SingletonModel,parler.models.TranslatableModelGoverning authority or organization managing the portal.
Initialization
- url#
‘URLField(…)’
- contact#
‘EmailField(…)’
- translations#
‘TranslatedFields(…)’
- class Identity(*args, **kwargs)#
Bases:
fairdm.contrib.identity.models.BrandAssets,solo.models.SingletonModel,parler.models.TranslatableModelPortal identity configuration including branding and metadata.
Initialization
- keywords#
‘MultiConceptField(…)’
- translations#
‘TranslatedFields(…)’
- save(*args, **kwargs)#
Save, then use the portal name as the admin site header and title.