lck.django 0.8.5 documentation

This Page

lck.django.badges.models

lck.django.badges.models

Models holding badges.

Functions

update_group(group, *args, **kwargs)

Send a badge group callback task through Celery.

update_type(type, *args, **kwargs)

Send a badge type callback task through Celery.

Classes

class BadgeGroup(*args, **kwargs)

Bases: lck.django.badges.models.BadgeMetadata

Owners can be awarded only a single badge of a specified group at a time.

class BadgeType(*args, **kwargs)

Bases: lck.django.badges.models.BadgeMetadata

Describes a specific badge type.

class Badge(*args, **kwargs)

Bases: lck.django.common.models.TimeTrackable, lck.django.common.models.EditorTrackable

A single badge given to an owner for a certain action on a subject.

classmethod award(type, owner, subject=None)

Award a badge of a specified type to an owner for actions on a specific subject.

If there is an existing badge of the same group and the same type, no other badge is awarded unless multiple_allowed is set on the badge group.

If there is an existing badge of the same group but of a different type, it is “upgraded” to the current type unless multiple_allowed is set on the badge group. In the latter case a duplicate badge is awarded.

class BadgeIcon(*args, **kwargs)

Bases: lck.django.common.models.ImageModel

Image representation of the badge.