A Django application that allows users to follow django model objects
Project description
The followit django app allows for the site users to follow various instances of Django models, represented by django model followit.models.FollowRecord using the django.contrib.models.ContentTypes system.
Release Notes
The list below shows compatibility of django-followit with versions of Django and Python. Python version compatibility was thoroughly tested only with release 0.4.0:
* ``0.6.x`` supports Django 1.10 to 4.x * ``0.5.x`` supports Django versions 1.10 up to 3.2 * ``0.4.x`` Django 1.7(**) - 1.9. Python 2 and 3. * ``0.3.x`` - Django 1.9 - 1.11 * ``0.2.x`` - Django 1.8 * ``0.1.x`` - Django 1.7 * ``0.0.9`` can be used for the earlier versions
(**) versions 0.4.x do not support Django 1.7 with Python 3.
Setup
To the INSTALLED_APPS in your settings.py add entry 'followit'.
Run python manage.py migrate followit
Then, in the body of AppConfig.ready method, add:
import followit followit.register(Thing)
Not it will be possible for the user to follow instances of SomeModel.
If you decide to allow following another model, just add another followit.register(...) statement.
Usage
Examples below show how to use followit:
bob.follow_thing(x) bob.unfollow_thing(x) things = bob.get_followed_things() x_followers = x.get_followers()
To follow/unfollow items via the HTTTP, make AJAX post requests at urls, available urls followit/urls.py:
/follow/<model_name>/<item_id>/ {% url follow_object "somemodel" item_id %} #model name lower case /unfollow/<model_name>/<item_id>/ {% url unfollow_object "somemodel" item_id %} #lower case model name /toggle-follow/<model_name>/<item_id>/ {% url toggle_follow_object "somemodel" item_id %} #lower case model name
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-followit-0.6.0.tar.gz
.
File metadata
- Download URL: django-followit-0.6.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07a9ba15c85f5545c4da48bc63f74314a10265fdd3b123c990422d82bb8d5280 |
|
MD5 | eea54c078f830b7645d439655ad22102 |
|
BLAKE2b-256 | b6d2a3cad6a9d9d1518950646066fee4132117992655e9b9b35ac13f4d46293b |