diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml
index 3c4fb1e..e4c99b7 100644
--- a/.github/workflows/actions.yml
+++ b/.github/workflows/actions.yml
@@ -22,26 +22,20 @@ jobs:
matrix:
django-version:
- "4.2"
- - "5.0"
- "5.1"
+ - "5.2"
python-version:
- - "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
+ - "3.13"
exclude:
# Django 5.0 is compatible with Python 3.10+
- - python-version: "3.8"
- django-version: "5.0"
- python-version: "3.9"
- django-version: "5.0"
- # Django 5.1 is compatible with Python 3.10+
- - python-version: "3.8"
django-version: "5.1"
- python-version: "3.9"
- django-version: "5.1"
-
+ django-version: "5.2"
steps:
- uses: actions/checkout@v4
diff --git a/LICENSE.txt b/LICENSE.txt
index 43898e3..29afb8d 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -6,7 +6,7 @@ are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
@@ -25,4 +25,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
diff --git a/README.md b/README.md
index 919297d..ba4b5ec 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ This application enables you to create and manage follows, blocks and bi-directi
Django 5.0 and 5.1 + Python 3.11 and Python 3.12 support added **>v1.9.6**
-Previously:
+Previously:
- **Django 3.2 since v1.9.1**
- **Django 1.11+** since v1.7.0 (latest release supporting **Django 1.10** is v1.6.0)
@@ -29,9 +29,8 @@ Previously:
```python
urlpatterns = [
- ...
- path('friendship/', include('friendship.urls'))
- ...
+ # other paths
+ path("friendship/", include("friendship.urls"))
]
```
@@ -87,9 +86,10 @@ from friendship.models import Friend, Follow, Block
```python
other_user = User.objects.get(pk=1)
Friend.objects.add_friend(
- request.user, # The sender
- other_user, # The recipient
- message='Hi! I would like to add you') # This message is optional
+ request.user, # The sender
+ other_user, # The recipient
+ message="Hi! I would like to add you",
+) # This message is optional
```
#### Let the user who received the request respond:
@@ -97,7 +97,9 @@ Friend.objects.add_friend(
```python
from friendship.models import FriendshipRequest
-friend_request = FriendshipRequest.objects.get(from_user=request.user, to_user=other_user)
+friend_request = FriendshipRequest.objects.get(
+ from_user=request.user, to_user=other_user
+)
friend_request.accept()
# or friend_request.reject()
```
@@ -167,9 +169,11 @@ Then use any of the following:
`django-friendship` supports the following settings:
```python
-FRIENDSHIP_CONTEXT_OBJECT_NAME = 'user'
-FRIENDSHIP_CONTEXT_OBJECT_LIST_NAME = 'users'
-FRIENDSHIP_MANAGER_FRIENDSHIP_REQUEST_SELECT_RELATED_STRATEGY = 'select_related' # ('select_related', 'prefetch_related', 'none')
+FRIENDSHIP_CONTEXT_OBJECT_NAME = "user"
+FRIENDSHIP_CONTEXT_OBJECT_LIST_NAME = "users"
+FRIENDSHIP_MANAGER_FRIENDSHIP_REQUEST_SELECT_RELATED_STRATEGY = (
+ "select_related" # ('select_related', 'prefetch_related', 'none')
+)
```
### Contributing
diff --git a/docs/index.rst b/docs/index.rst
index 0fde331..8331bc7 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -20,4 +20,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
-
+
diff --git a/friendship/migrations/0001_initial.py b/friendship/migrations/0001_initial.py
index 34241a1..ce55ff4 100644
--- a/friendship/migrations/0001_initial.py
+++ b/friendship/migrations/0001_initial.py
@@ -5,7 +5,7 @@
class Migration(migrations.Migration):
-
+
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
diff --git a/friendship/migrations/0002_block.py b/friendship/migrations/0002_block.py
index f2c4759..1ed1934 100644
--- a/friendship/migrations/0002_block.py
+++ b/friendship/migrations/0002_block.py
@@ -5,7 +5,7 @@
class Migration(migrations.Migration):
-
+
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("friendship", "0001_initial"),
diff --git a/friendship/migrations/0003_block_unique_together.py b/friendship/migrations/0003_block_unique_together.py
index 9ed4277..f6f4752 100644
--- a/friendship/migrations/0003_block_unique_together.py
+++ b/friendship/migrations/0003_block_unique_together.py
@@ -7,7 +7,7 @@
class Migration(migrations.Migration):
-
+
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("friendship", "0002_block"),
diff --git a/friendship/migrations/0004_auto_20200408_1844.py b/friendship/migrations/0004_auto_20200408_1844.py
index 992fccd..227b3c2 100644
--- a/friendship/migrations/0004_auto_20200408_1844.py
+++ b/friendship/migrations/0004_auto_20200408_1844.py
@@ -4,7 +4,7 @@
class Migration(migrations.Migration):
-
+
dependencies = [
("friendship", "0003_block_unique_together"),
]
diff --git a/friendship/migrations/0005_auto_20211005_1716.py b/friendship/migrations/0005_auto_20211005_1716.py
index b3dbcae..cb02ad5 100644
--- a/friendship/migrations/0005_auto_20211005_1716.py
+++ b/friendship/migrations/0005_auto_20211005_1716.py
@@ -4,7 +4,7 @@
class Migration(migrations.Migration):
-
+
dependencies = [
('friendship', '0004_auto_20200408_1844'),
]
diff --git a/friendship/templates/friendship/block/add.html b/friendship/templates/friendship/block/add.html
index 24d707b..0b8766a 100644
--- a/friendship/templates/friendship/block/add.html
+++ b/friendship/templates/friendship/block/add.html
@@ -5,4 +5,4 @@
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/friendship/templates/friendship/block/blocked_list.html b/friendship/templates/friendship/block/blocked_list.html
index dd5b720..0fbaa85 100644
--- a/friendship/templates/friendship/block/blocked_list.html
+++ b/friendship/templates/friendship/block/blocked_list.html
@@ -3,4 +3,4 @@
Blocking
{% get_by_name friendship_context_object_name as var %}
{% blocking var %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/friendship/templates/friendship/block/blockers_list.html b/friendship/templates/friendship/block/blockers_list.html
index dd5b720..0fbaa85 100644
--- a/friendship/templates/friendship/block/blockers_list.html
+++ b/friendship/templates/friendship/block/blockers_list.html
@@ -3,4 +3,4 @@
Blocking
{% get_by_name friendship_context_object_name as var %}
{% blocking var %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/friendship/templates/friendship/block/blocking_list.html b/friendship/templates/friendship/block/blocking_list.html
index f190721..d4b60c1 100644
--- a/friendship/templates/friendship/block/blocking_list.html
+++ b/friendship/templates/friendship/block/blocking_list.html
@@ -3,4 +3,4 @@
Blockers
{% get_by_name friendship_context_object_name as var %}
{% blockers var %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/friendship/templates/friendship/follow/add.html b/friendship/templates/friendship/follow/add.html
index 2e2af2e..48eb83a 100644
--- a/friendship/templates/friendship/follow/add.html
+++ b/friendship/templates/friendship/follow/add.html
@@ -5,4 +5,4 @@
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/friendship/templates/friendship/follow/followers_list.html b/friendship/templates/friendship/follow/followers_list.html
index 1bedc3c..6dbebe8 100644
--- a/friendship/templates/friendship/follow/followers_list.html
+++ b/friendship/templates/friendship/follow/followers_list.html
@@ -3,4 +3,4 @@
Followers
{% get_by_name friendship_context_object_name as var %}
{% followers var %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/friendship/templates/friendship/follow/following_list.html b/friendship/templates/friendship/follow/following_list.html
index 1993c03..bd82f1b 100644
--- a/friendship/templates/friendship/follow/following_list.html
+++ b/friendship/templates/friendship/follow/following_list.html
@@ -3,4 +3,4 @@
Following
{% get_by_name friendship_context_object_name as var %}
{% following var %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/friendship/templates/friendship/friend/add.html b/friendship/templates/friendship/friend/add.html
index 7d2f6fa..126c88c 100644
--- a/friendship/templates/friendship/friend/add.html
+++ b/friendship/templates/friendship/friend/add.html
@@ -5,4 +5,4 @@
-{% endif %}
\ No newline at end of file
+{% endif %}
diff --git a/friendship/templates/friendship/friend/user_list.html b/friendship/templates/friendship/friend/user_list.html
index 687fc44..09905ed 100644
--- a/friendship/templates/friendship/friend/user_list.html
+++ b/friendship/templates/friendship/friend/user_list.html
@@ -3,4 +3,4 @@
Your Friends
{% get_by_name friendship_context_object_name as var %}
{% friends var %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/friendship/templates/friendship/templatetags/blockers.html b/friendship/templates/friendship/templatetags/blockers.html
index bd61376..d15f9b3 100644
--- a/friendship/templates/friendship/templatetags/blockers.html
+++ b/friendship/templates/friendship/templatetags/blockers.html
@@ -1,5 +1,5 @@