Skip to main content

A basic member badge system for Plone

Project description

https://travis-ci.org/collective/collective.badge.svg?branch=master

collective.badge

Introduction

This package adds a content type for representing badges that can be assigned to users.

Each badge has an image and a roster (provided using collective.workspace) which includes:

  • User

  • Date Assigned

  • Assigned By

  • Expiration

The package is developed and tested on Plone 5.

Installation

  • Add collective.badge to your buildout eggs.

  • Activate collective.badge in the ‘Add-ons’ section of Plone’s Site Setup.

API

Assign a badge to a user:

>>> badge.assign_to_user(user_id='admin')

Check if a badge is active for a user (includes checking that the badge has not expired):

>>> badge.is_assigned_to_user(user_id='admin')
True

List user ids of all active users for a badge:

>>> badge.list_active_users()
['admin']

Remove a badge from a user:

>>> badge.remove_from_user(user_id='admin')

Get a user’s active badges (sorted alphabetically):

>>> from collective.badge.api import badges_for_user
>>> badges_for_user(user_id='admin')
[<Badge at /Plone/badges/awesome-badge>]

Contributors

  • David Glick - Original Author

Changelog

1.0 (unreleased)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.badge-1.0.dev0.tar.gz (15.1 kB view details)

Uploaded Source

File details

Details for the file collective.badge-1.0.dev0.tar.gz.

File metadata

File hashes

Hashes for collective.badge-1.0.dev0.tar.gz
Algorithm Hash digest
SHA256 53bca79f74d101241b025670870a6f86e2257ac1a6c4f12ea8d2a5252268786b
MD5 f6755cadd81bfdab6995dd6c675f4455
BLAKE2b-256 4bf52388ce09fe8caa7e749fa72f77c776ad615c60dc22121c74cf099277cc3c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page