Jump to >

djblets.avatars.settings

Settings managers for avatar service registries.

class AvatarSettingsManager(user)[source]

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)[source]

Initialize the settings manager.

Parameters:user (django.contrib.auth.models.User) – The user.
avatar_service_id[source]

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:unicode
configuration[source]

The user’s configuration for the service.

This must be implemented in a subclasses.

Returns:The user’s configuration.
Return type:dict
configuration_for(avatar_service_id)[source]

Get the configuration for the requested avatar service.

Parameters:avatar_service_id (unicode) – The ID of the avatar service to retrieve configuration for.
save()[source]

Save the configuration.

This must be implemented in a subclass.