You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[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.
16
39
17
40
## pinax-likes
18
41
19
42
`pinax-likes` is a liking app for Django, allowing users to "like" and "unlike"
20
43
any model instance in your project. Template tags provide the ability to see who
21
44
liked an object, what objects a user liked, and more.
22
45
46
+
### Overview
23
47
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 | | * | * | *
25
54
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)
37
55
56
+
## Documentation
38
57
39
-
## Installation
58
+
###Installation
40
59
41
60
To install pinax-likes:
42
61
@@ -75,9 +94,9 @@ Lastly add `pinax.likes.urls` to your project urlpatterns:
75
94
]
76
95
77
96
78
-
## Usage
97
+
###Usage
79
98
80
-
### Settings
99
+
####Settings
81
100
82
101
Add each model that you want to be likable to the `PINAX_LIKES_LIKABLE_MODELS` setting:
83
102
@@ -87,7 +106,7 @@ Add each model that you want to be likable to the `PINAX_LIKES_LIKABLE_MODELS` s
87
106
"biblion.Post": {},
88
107
}
89
108
90
-
### Templates
109
+
####Templates
91
110
92
111
Let's say you have a detail page for a blog post. First load the template tags:
93
112
@@ -99,7 +118,7 @@ In the body where you want the liking widget to go, add:
99
118
100
119
Finally, ensure you have `eldarion-ajax` installed:
101
120
102
-
#### Eldarion AJAX
121
+
#####Eldarion AJAX
103
122
104
123
The `likes_widget` templatetag above and the "toggle like" view both conform
105
124
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
120
139
perform a redirect.
121
140
122
141
123
-
## Signals
142
+
###Signals
124
143
125
144
Both of these signals are sent from the `Like` model in the view that
126
145
processes the toggling of likes and unlikes.
127
146
128
-
### pinax.likes.signals.object_liked
147
+
####pinax.likes.signals.object_liked
129
148
130
149
This signal is sent immediately after the object is liked and provides
131
150
the single `kwarg` of `like` which is the created `Like` instance.
132
151
133
-
### pinax.likes.signals.object_unliked
152
+
####pinax.likes.signals.object_unliked
134
153
135
154
This signal is sent immediately after the object is unliked and provides
136
155
the single `kwarg` of `object` which is the object that was just unliked.
137
156
138
157
139
-
## Filters
158
+
###Filters
140
159
141
-
#### likes_count
160
+
#####likes_count
142
161
143
162
Returns the number of likes for a given object:
144
163
145
164
146
165
{{ obj|likes_count }}
147
166
148
-
## Template Tags
167
+
###Template Tags
149
168
150
-
### who_likes
169
+
####who_likes
151
170
152
171
An assignment tag that fetches a list of likes for a given object:
153
172
@@ -157,7 +176,7 @@ An assignment tag that fetches a list of likes for a given object:
157
176
<div class="like">{{ like.sender.get_full_name }} likes {{ car }}</div>
158
177
{% endfor %}
159
178
160
-
### likes
179
+
####likes
161
180
162
181
The `likes` tag will fetch into a context variable a list of objects
163
182
that the given user likes. This tag has two forms:
@@ -171,14 +190,14 @@ that the given user likes. This tag has two forms:
171
190
172
191
{% likes user "app.Model" as objs %}
173
192
174
-
#### Example:
193
+
#####Example:
175
194
176
195
{% likes request.user "app.Model" as objs %}
177
196
{% for obj in objs %}
178
197
<div>{{ obj }}</div>
179
198
{% endfor %}
180
199
181
-
### render_like
200
+
####render_like
182
201
183
202
This renders a like. It combines well with the `likes` templatetag
184
203
for showing a list of likes:
@@ -199,7 +218,7 @@ basis:
199
218
-`pinax/likes/app_name/like.html`
200
219
-`pinax/likes/_like.html`
201
220
202
-
### likes_widget
221
+
####likes_widget
203
222
204
223
This renders a fragment of HTML the user clicks on
205
224
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:
212
231
213
232
{% likes_widget request.user post "pinax/likes/_widget_brief.html" %}
214
233
215
-
### liked
234
+
####liked
216
235
217
236
This template tag decorates an iterable of objects with a
218
237
`liked` boolean indicating whether or not the specified
@@ -226,6 +245,11 @@ user likes each object in the iterable:
226
245
227
246
## ChangeLog
228
247
248
+
## 3.0.0
249
+
250
+
* Drop Django 1.8 and 1.10 support
251
+
* Improve documentation
252
+
229
253
### 2.2.1
230
254
231
255
* Correct LONG_DESCRIPTION app title
@@ -365,24 +389,32 @@ user likes each object in the iterable:
365
389
- Initial release
366
390
367
391
368
-
## About Pinax
392
+
## Contribute
369
393
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.
371
398
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.
373
402
374
-
For updates and news regarding the Pinax Project, please follow us on Twitter at @pinaxprojectand 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/).
375
404
405
+
## Code of Conduct
376
406
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.
378
410
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.
380
411
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
382
413
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).
384
416
385
417
386
-
## Code of Conduct
418
+
## License
387
419
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).
0 commit comments