adhocracy_core.sheets.badge module

Badge sheet.

interface IBadge[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for badge data sheet.

interface IHasBadgesPool[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for resources that have a badge datas pool.

interface ICanBadge[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for principals that can assign badges.

interface IBadgeable[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for resources that can be badged.

interface IBadgeAssignment[source]

Extends: adhocracy_core.interfaces.ISheet, adhocracy_core.interfaces.ISheetReferenceAutoUpdateMarker

Marker interface for the badge assignment sheet.

interface BadgeReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Reference from badge to badge data resource.

interface BadgeSubjectReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Reference from badge to assigning user.

interface BadgeObjectReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Reference from badge to badged content.

interface BadgeGroupReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Reference from badge to badge group.

class BadgeSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Badge sheet data structure.

class HasBadgesPoolSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Data structure pointing to a badges post pool.

class CanBadgeSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

CanBadge sheet data structure.

class BadgeableSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Badgeable sheet data structure.

post_pool: Pool to post new
adhocracy_sample.resource.IBadgeAssignment.
create_unique_badge_assignment_validator(badge_ref: adhocracy_core.schema.Reference, object_ref: adhocracy_core.schema.Reference, kw: dict) → <built-in function callable>[source]

Create validator to check that a badge assignment is unique.

Badge assignments is considered unique if there is at most one for each badge in post_pool.

Parameters:
  • badge – Reference to a sheet with post_pool field.
  • kw (dict) – dictionary with keys context and registry.
class BadgeAssignmentSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Badge sheet data structure.

validator = <colander.deferred object>[source]
get_assignable_badges(context: <InterfaceClass adhocracy_core.sheets.badge.IBadgeable>, request: pyramid.request.Request) → [<InterfaceClass adhocracy_core.sheets.badge.IBadge>][source]

Get assignable badges for the IBadgeAssignment sheet.

includeme(config)[source]

Register sheets, adapters and index views.