djblets.avatars.settings¶
Settings managers for avatar service registries.
- class AvatarSettingsManager(user)¶
Bases:
object
The settings manager is responsible for loading and saving settings.
Each user can have different avatar configuration and the settings manager is responsible for loading and saving per-user configuration for services.
This class is intended to be sub-classed to be able to provide configuration management for individual users.
- __init__(user)¶
Initialize the settings manager.
- Parameters:
user (
django.contrib.auth.models.User
) – The user.
- property avatar_service_id¶
The service ID for the user’s selected avatar service.
- Returns:
The avatar service ID for the user’s selected avatar service, or
None
if they have not selected one.- Return type:
- property configuration¶
The user’s configuration for the service.
This must be implemented in a subclasses.
- Returns:
The user’s configuration.
- Return type:
- configuration_for(avatar_service_id)¶
Get the configuration for the requested avatar service.
- Parameters:
avatar_service_id (
unicode
) – The ID of theavatar service
to retrieve configuration for.
- save()¶
Save the configuration.
This must be implemented in a subclass.