Skip to content

Commit a327f9d

Browse files
authored
Merge pull request #52 from pinax/upgrading-docs
Upgrading docs and dropping support
2 parents 833e753 + 5d785b7 commit a327f9d

File tree

13 files changed

+95
-233
lines changed

13 files changed

+95
-233
lines changed

.circleci/config.yml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,12 @@ jobs:
3939
environment:
4040
- TOXENV=checkqa
4141
- UPLOAD_COVERAGE=0
42-
py27dj18:
43-
<<: *common
44-
docker:
45-
- image: circleci/python:2.7
46-
environment:
47-
TOXENV=py27-dj18
48-
py27dj110:
49-
<<: *common
50-
docker:
51-
- image: circleci/python:2.7
52-
environment:
53-
TOXENV=py27-dj110
5442
py27dj111:
5543
<<: *common
5644
docker:
5745
- image: circleci/python:2.7
5846
environment:
5947
TOXENV=py27-dj111
60-
py34dj18:
61-
<<: *common
62-
docker:
63-
- image: circleci/python:3.4
64-
environment:
65-
TOXENV=py34-dj18
66-
py34dj110:
67-
<<: *common
68-
docker:
69-
- image: circleci/python:3.4
70-
environment:
71-
TOXENV=py34-dj110
7248
py34dj111:
7349
<<: *common
7450
docker:
@@ -81,18 +57,6 @@ jobs:
8157
- image: circleci/python:3.4
8258
environment:
8359
TOXENV=py34-dj20
84-
py35dj18:
85-
<<: *common
86-
docker:
87-
- image: circleci/python:3.5
88-
environment:
89-
TOXENV=py35-dj18
90-
py35dj110:
91-
<<: *common
92-
docker:
93-
- image: circleci/python:3.5
94-
environment:
95-
TOXENV=py35-dj110
9660
py35dj111:
9761
<<: *common
9862
docker:
@@ -123,15 +87,9 @@ workflows:
12387
test:
12488
jobs:
12589
- lint
126-
- py27dj18
127-
- py27dj110
12890
- py27dj111
129-
- py34dj18
130-
- py34dj110
13191
- py34dj111
13292
- py34dj20
133-
- py35dj18
134-
- py35dj110
13593
- py35dj111
13694
- py35dj20
13795
- py36dj111

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ var/
2525
*.eggs
2626
.python-version
2727

28+
# Pipfile
29+
Pipfile
30+
Pipfile.lock
31+
2832
# Installer logs
2933
pip-log.txt
3034
pip-delete-this-directory.txt

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Jacob Wegner
1111
Thomas Schreiber
1212
arthur
1313
Graham Ullrich
14+
Katherine “Kati” Michel

README.md

Lines changed: 72 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Pinax Likes
44

55
[![](https://img.shields.io/pypi/v/pinax-likes.svg)](https://pypi.python.org/pypi/pinax-likes/)
6-
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://pypi.python.org/pypi/pinax-likes/)
76

87
[![CircleCi](https://img.shields.io/circleci/project/github/pinax/pinax-likes.svg)](https://circleci.com/gh/pinax/pinax-likes)
98
[![Codecov](https://img.shields.io/codecov/c/github/pinax/pinax-likes.svg)](https://codecov.io/gh/pinax/pinax-likes)
@@ -12,31 +11,51 @@
1211
[![](https://img.shields.io/github/issues-pr-closed/pinax/pinax-likes.svg)](https://github.com/pinax/pinax-likes/pulls?q=is%3Apr+is%3Aclosed)
1312

1413
[![](http://slack.pinaxproject.com/badge.svg)](http://slack.pinaxproject.com/)
14+
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
1515

16+
## Table of Contents
17+
18+
* [About Pinax](#about-pinax)
19+
* [Overview](#overview)
20+
* [Supported Django and Python versions](#supported-django-and-python-versions)
21+
* [Documentation](#documentation)
22+
* [Installation](#installation)
23+
* [Usage](#usage)
24+
* [Settings](#settings)
25+
* [Templates](#templates)
26+
* [Signals](#signals)
27+
* [Filters](#filters)
28+
* [TemplateTags](#template-tags)
29+
* [Change Log](#change-log)
30+
* [Contribute](#contribute)
31+
* [Code of Conduct](#code-of-conduct)
32+
* [Connect with Pinax](#connect-with-pinax)
33+
* [License](#license)
34+
35+
## About Pinax
36+
37+
Pinax is an open-source platform built on the Django Web Framework. It is an ecosystem of reusable
38+
Django apps, themes, and starter project templates. This collection can be found at http://pinaxproject.com.
1639

1740
## pinax-likes
1841

1942
`pinax-likes` is a liking app for Django, allowing users to "like" and "unlike"
2043
any model instance in your project. Template tags provide the ability to see who
2144
liked an object, what objects a user liked, and more.
2245

46+
### Overview
2347

24-
## Table of Contents
48+
#### Supported Django and Python versions
49+
50+
Django \ Python | 2.7 | 3.4 | 3.5 | 3.6
51+
--------------- | --- | --- | --- | ---
52+
1.11 | * | * | * | *
53+
2.0 | | * | * | *
2554

26-
* [Installation](#installation)
27-
* [Usage](#usage)
28-
* [Settings](#settings)
29-
* [Templates](#templates)
30-
* [Signals](#signals)
31-
* [Filters](#filters)
32-
* [TemplateTags](#template-tags)
33-
* [Change Log](#change-log)
34-
* [About Pinax](#about-pinax)
35-
* [Contribute](#contribute)
36-
* [Code of Conduct](#code-of-conduct)
3755

56+
## Documentation
3857

39-
## Installation
58+
### Installation
4059

4160
To install pinax-likes:
4261

@@ -75,9 +94,9 @@ Lastly add `pinax.likes.urls` to your project urlpatterns:
7594
]
7695

7796

78-
## Usage
97+
### Usage
7998

80-
### Settings
99+
#### Settings
81100

82101
Add each model that you want to be likable to the `PINAX_LIKES_LIKABLE_MODELS` setting:
83102

@@ -87,7 +106,7 @@ Add each model that you want to be likable to the `PINAX_LIKES_LIKABLE_MODELS` s
87106
"biblion.Post": {},
88107
}
89108

90-
### Templates
109+
#### Templates
91110

92111
Let's say you have a detail page for a blog post. First load the template tags:
93112

@@ -99,7 +118,7 @@ In the body where you want the liking widget to go, add:
99118

100119
Finally, ensure you have `eldarion-ajax` installed:
101120

102-
#### Eldarion AJAX
121+
##### Eldarion AJAX
103122

104123
The `likes_widget` templatetag above and the "toggle like" view both conform
105124
to an `AJAX` response that [eldarion-ajax](https://github.com/eldarion/eldarion-ajax) understands.
@@ -120,34 +139,34 @@ you don't want `ajax` at all the view will handle a regular `POST` and
120139
perform a redirect.
121140

122141

123-
## Signals
142+
### Signals
124143

125144
Both of these signals are sent from the `Like` model in the view that
126145
processes the toggling of likes and unlikes.
127146

128-
### pinax.likes.signals.object_liked
147+
#### pinax.likes.signals.object_liked
129148

130149
This signal is sent immediately after the object is liked and provides
131150
the single `kwarg` of `like` which is the created `Like` instance.
132151

133-
### pinax.likes.signals.object_unliked
152+
#### pinax.likes.signals.object_unliked
134153

135154
This signal is sent immediately after the object is unliked and provides
136155
the single `kwarg` of `object` which is the object that was just unliked.
137156

138157

139-
## Filters
158+
### Filters
140159

141-
#### likes_count
160+
##### likes_count
142161

143162
Returns the number of likes for a given object:
144163

145164

146165
{{ obj|likes_count }}
147166

148-
## Template Tags
167+
### Template Tags
149168

150-
### who_likes
169+
#### who_likes
151170

152171
An assignment tag that fetches a list of likes for a given object:
153172

@@ -157,7 +176,7 @@ An assignment tag that fetches a list of likes for a given object:
157176
<div class="like">{{ like.sender.get_full_name }} likes {{ car }}</div>
158177
{% endfor %}
159178

160-
### likes
179+
#### likes
161180

162181
The `likes` tag will fetch into a context variable a list of objects
163182
that the given user likes. This tag has two forms:
@@ -171,14 +190,14 @@ that the given user likes. This tag has two forms:
171190

172191
{% likes user "app.Model" as objs %}
173192

174-
#### Example:
193+
##### Example:
175194

176195
{% likes request.user "app.Model" as objs %}
177196
{% for obj in objs %}
178197
<div>{{ obj }}</div>
179198
{% endfor %}
180199

181-
### render_like
200+
#### render_like
182201

183202
This renders a like. It combines well with the `likes` templatetag
184203
for showing a list of likes:
@@ -199,7 +218,7 @@ basis:
199218
- `pinax/likes/app_name/like.html`
200219
- `pinax/likes/_like.html`
201220

202-
### likes_widget
221+
#### likes_widget
203222

204223
This renders a fragment of HTML the user clicks on
205224
to unlike or like objects. It only has two required parameters,
@@ -212,7 +231,7 @@ A second form for this templatetag specifies the template to be rendered:
212231

213232
{% likes_widget request.user post "pinax/likes/_widget_brief.html" %}
214233

215-
### liked
234+
#### liked
216235

217236
This template tag decorates an iterable of objects with a
218237
`liked` boolean indicating whether or not the specified
@@ -226,6 +245,11 @@ user likes each object in the iterable:
226245

227246
## ChangeLog
228247

248+
## 3.0.0
249+
250+
* Drop Django 1.8 and 1.10 support
251+
* Improve documentation
252+
229253
### 2.2.1
230254

231255
* Correct LONG_DESCRIPTION app title
@@ -365,24 +389,32 @@ user likes each object in the iterable:
365389
- Initial release
366390

367391

368-
## About Pinax
392+
## Contribute
369393

370-
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.
394+
For an overview on how contributing to Pinax works read this [blog post](http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/)
395+
and watch the included video, or read our [How to Contribute](http://pinaxproject.com/pinax/how_to_contribute/) section.
396+
For concrete contribution ideas, please see our
397+
[Ways to Contribute/What We Need Help With](http://pinaxproject.com/pinax/ways_to_contribute/) section.
371398

372-
The Pinax documentation is available at http://pinaxproject.com/pinax/. If you would like to help us improve our documentation or write more documentation, please join our Pinax Project Slack team and let us know!
399+
In case of any questions we recommend you join our [Pinax Slack team](http://slack.pinaxproject.com)
400+
and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course
401+
also valid but we are usually able to help you faster if you ping us in Slack.
373402

374-
For updates and news regarding the Pinax Project, please follow us on Twitter at @pinaxproject and check out our [blog](http://blog.pinaxproject.com).
403+
We also highly recommend reading our blog post on [Open Source and Self-Care](http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/).
375404

405+
## Code of Conduct
376406

377-
## Contribute
407+
In order to foster a kind, inclusive, and harassment-free community, the Pinax Project
408+
has a [code of conduct](http://pinaxproject.com/pinax/code_of_conduct/).
409+
We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you.
378410

379-
See [this blog post](http://blog.pinaxproject.com/2016/02/26/recap-february-pinax-hangout/) including a video, or our [How to Contribute](http://pinaxproject.com/pinax/how_to_contribute/) section for an overview on how contributing to Pinax works. For concrete contribution ideas, please see our [Ways to Contribute/What We Need Help With](http://pinaxproject.com/pinax/ways_to_contribute/) section.
380411

381-
In case of any questions we recommend you [join our Pinax Slack team](http://slack.pinaxproject.com) and ping us there instead of creating an issue on GitHub. Creating issues on GitHub is of course also valid but we are usually able to help you faster if you ping us in Slack.
412+
## Connect with Pinax
382413

383-
We also highly recommend reading our [Open Source and Self-Care blog post](http://blog.pinaxproject.com/2016/01/19/open-source-and-self-care/).
414+
For updates and news regarding the Pinax Project, please follow us on Twitter [@pinaxproject](https://twitter.com/pinaxproject)
415+
and check out our [Pinax Project blog](http://blog.pinaxproject.com).
384416

385417

386-
## Code of Conduct
418+
## License
387419

388-
In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a code of conduct, which can be found [here](http://pinaxproject.com/pinax/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.
420+
Copyright (c) 2012-2018 James Tauber and contributors under the [MIT license](https://opensource.org/licenses/MIT).

pinax/likes/auth_backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def is_allowed(self, obj):
1212

1313
def has_perm(self, user, perm, obj=None):
1414
if perm == "likes.can_like":
15-
if not user.is_authenticated():
15+
if not user.is_authenticated:
1616
return False
1717
return (self.is_allowed(obj) and per_model_perm_check(user, obj))
1818
return super(CanLikeBackend, self).has_perm(user, perm, obj)

0 commit comments

Comments
 (0)