Skip to content

Commit

Permalink
Merge pull request #25 from pinax/django-req
Browse files Browse the repository at this point in the history
add django>=1.11 requirement
  • Loading branch information
grahamu authored Jan 20, 2018
2 parents 9ea136e + 7652786 commit 9b4b67e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ common: &common
- restore_cache:
keys:
- v2-deps-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- v2-deps-
- run:
name: install dependencies
command: pip install --user tox
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,22 @@ Install the development version:
Add `pinax.badges` to your `INSTALLED_APPS` setting:

```python
INSTALLED_APPS = (
INSTALLED_APPS = [
# other apps
"pinax.badges",
)
]
```

Add entry to your `urls.py`:
Add `pinax.badges.urls` to your project urlpatterns:

```python
url(r"^badges/", include("pinax.badges.urls", namespace="pinax_badges"))
urlpatterns = [
# other urls
url(r"^badges/", include("pinax.badges.urls", namespace="pinax_badges")),
]
```


### Usage

#### `pinax.badges.base.Badge`
Expand Down Expand Up @@ -180,9 +184,10 @@ By default badges will be awarded at the current time, if you need to overide
the award time of the badge you can pass a `force_timestamp` keyword argument
to `possibly_award_badge()`.


### Asynchronous Badges

!!! important
**Important**
To use asynchronous badges you must have [celery](http://github.com/ask/celery)
installed and configured.

Expand All @@ -200,7 +205,6 @@ compute `award()` correctly. This may be necessary because your `Badge`
requires some mutable state.

```python

class AddictBadge(Badge):
# stuff
async = True
Expand Down Expand Up @@ -238,7 +242,7 @@ additional state to the `award()` method.
##### `badge_awarded`

This signal is sent whenever a badge is awarded to a user. It provides a
single argument, `badge`, which is an instance of `pinax.badges.models.BadgeAwarded`.
single argument, `badge`, which is an instance of `pinax.badges.models.BadgeAward`.

### Template Tags

Expand Down Expand Up @@ -267,7 +271,7 @@ To get the count as a template variable:

This tag provides a `QuerySet` of all of a user's badges, ordered by when
they were awarded, descending, and makes them available as a template variable.
The `QuerySet` is composed of `pinax.badges.models.BadgeAwarded` instances.
The `QuerySet` is composed of `pinax.badges.models.BadgeAward` instances.

```django
{% badges_for_user user as badges %}
Expand Down
1 change: 0 additions & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"pinax.badges",
"pinax.badges.tests"
],
MIDDLEWARE_CLASSES=[],
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"Topic :: Software Development :: Libraries :: Python Modules",
],
install_requires=[
"Django>=1.8"
"django>=1.11",
],
tests_require=[
],
Expand Down

0 comments on commit 9b4b67e

Please sign in to comment.