- About Pinax
- Important Links
- Overview
- Documentation
- Change Log
- History
- Contribute
- Code of Conduct
- Connect with Pinax
- License
Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com.
Where you can find what you need:
- Releases: published to PyPI or tagged in app repos in the Pinax GitHub organization
- Global documentation: Pinax documentation website
- App specific documentation: app repos in the Pinax GitHub organization
- Support information: SUPPORT.md file in the Pinax default community health file repo
- Contributing information: CONTRIBUTING.md file in the Pinax default community health file repo
- Current and historical release docs: Pinax Wiki
pinax-points
is a points, positions and levels app for Django.
pinax-points
provides the ability to track points on arbitrary
objects in your system. The common case being User
instances. It can
additionally keep track of positions for these objects to produce leaderboards.
Django / Python | 3.6 | 3.7 | 3.8 |
---|---|---|---|
2.2 | * | * | * |
3.0 | * | * | * |
To install pinax-points:
$ pip install pinax-points
Add pinax.points
to your INSTALLED_APPS
setting:
INSTALLED_APPS = [
# other apps
"pinax.points",
]
Award points to any model instance by invoking award_points()
.
from pinax.points.models import award_points
award_points(user, 50)
Obtain points awarded based on argument criteria.
from pinax.points.models import points_awarded
points = points_awarded(user)
To display overall points for an object, use templatetag points_for_object
to set and display a context variable:
{% load pinax_points_tags %}
{% points_for_object user as points %}
<div class="user-points">{{ points }}</div>
Although this example shows points for a User, any type of model instance is valid. For example if you want to display points for a blog post:
{% load pinax_points_tags %}
{% points_for_object post as points %}
<div class="post-points">{{ points }}</div>
Triggered when points are awarded to an object.
providing_args=["target", "key", "points", "source"]
Returns the current points for an object.
Usage:
{% points_for_object user %}
or
{% points_for_object user as points %}
or
{% points_for_object user limit 7 days as points %}
Returns a queryset of the model passed in with points annotated.
Usage:
{% top_objects "auth.User" as top_users limit 10 %}
or
{% top_objects "auth.User" as top_users %}
or
{% top_objects "auth.User" as top_users limit 10 timeframe 7 days %}
Returns True if user
has voted on obj
, False otherwise.
Usage:
{% user_has_voted user obj as var %}
- Drop Django 1.11, 2.0, and 2.1, and Python 2,7, 3.4, and 3.5 support
- Add Django 2.2 and 3.0, and Python 3.6, 3.7, and 3.8 support
- Update packaging configs
- Direct users to community resources
- Improve usage documentation
- Improving tox.ini syntax
- Standardizing setup.py and docs
- Improving .gitignore
- Standardize documentation layout
- Drop Django v1.8, 1.9, 1.10 support
- Drop Python 3.3 support
- Add Django 2.0 support
- Move documentation into README.md
- Convert CI and coverage to CircleCi and CodeCov
- Add PyPi-compatible long description
- updated to
pinax-points
was formerly known as agon
. The code was mostly extracted from typewar and made slightly more
generic to work well.
Contributing information can be found in the Pinax community health file repo.
In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a Code of Conduct. We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you.
For updates and news regarding the Pinax Project, please follow us on Twitter @pinaxproject and check out our Pinax Project blog.
Copyright (c) 2012-present James Tauber and contributors under the MIT license.