Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated code on existing branch #543

Merged
merged 105 commits into from
Sep 5, 2024
Merged
Changes from 5 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
28485e0
use python base image for simplicity
justquick Feb 20, 2022
22ebf59
updating dev env w/ helpers
justquick Feb 20, 2022
27eeff1
wip: actstream/registered models as factories for DRF
justquick Feb 20, 2022
5a3832b
DRF testing and updates
justquick Feb 27, 2022
ccff3c6
drf extras for package
justquick Feb 27, 2022
53a9e7e
default permissions, custom viewsets
justquick Feb 27, 2022
253b93a
allow a 'my actions' view as viewset action
justquick Feb 28, 2022
4fc902e
settings refactor
justquick Feb 28, 2022
5bb3c7b
testing fix, user serializer to hide password
justquick Feb 28, 2022
803ada1
dont require drf for testing app
justquick Feb 28, 2022
99a4a40
install drf for actions
justquick Mar 1, 2022
9ede96d
install drf generics for actions
justquick Mar 1, 2022
fc55be7
Merge branch 'main' into drf
justquick Mar 1, 2022
322d27c
action posting and model/object drf feeds
justquick Mar 1, 2022
72f386f
weird ordering issues in tests
justquick Mar 1, 2022
ea9701a
viewset ordering, test debugging for gh actions
justquick Mar 1, 2022
954181a
weird db auto id bug? hope this works
justquick Mar 1, 2022
0500bf9
drf following
justquick Mar 1, 2022
908c58d
add drf urlconf to actstream.urls
justquick Mar 1, 2022
1c3e46f
Merge branch 'main' into drf
justquick Mar 1, 2022
ea5ad39
drf-spectacular in runtests
justquick Mar 1, 2022
05aa909
weird recursion error on urls
justquick Mar 1, 2022
704f1f3
use expand fields as default behavior
justquick Mar 1, 2022
9e427a3
use pytest finally
justquick Mar 2, 2022
ca45077
set sane ordering in qs, not on drf ordering fields
justquick Mar 2, 2022
2d0391d
runtest project changes, more granular custom permissions/viewsets
justquick Mar 5, 2022
31e5913
dont load test data 2x
justquick Mar 5, 2022
8048985
Merge branch 'drf' of github.com:justquick/django-activity-stream int…
justquick Mar 5, 2022
1ded0cf
fugly settings remvoed
justquick Mar 5, 2022
1594566
Merge branch 'drf' of github.com:justquick/django-activity-stream int…
justquick Mar 5, 2022
3fbf85f
Merge branch 'drf' of github.com:justquick/django-activity-stream int…
justquick Mar 5, 2022
ca57f70
label model url names
justquick Mar 5, 2022
9139521
testing restricted permissions
justquick Mar 5, 2022
d7af261
MODEL_FIELDS setting/testing
justquick Mar 5, 2022
6487dff
test fix
justquick Mar 5, 2022
2a9327d
+pytest.ini
justquick Mar 5, 2022
46b67c7
renamed to streams
justquick Mar 5, 2022
f883751
renamed to streams
justquick Mar 5, 2022
b0e0035
old decorators for compat.
justquick Mar 6, 2022
ef6ae8f
readonly + public
justquick Mar 6, 2022
db6687d
manager arg typing
justquick Mar 6, 2022
df4b569
fixing test warnings
justquick Mar 6, 2022
ff88265
adding more streams from managers to views
justquick Mar 7, 2022
81f202b
views for following/follows/is_following
justquick Mar 7, 2022
9f61e59
testfix for missing field
justquick Mar 7, 2022
5eaee08
check post vs get for action sending
justquick Mar 7, 2022
c29787c
spectacular in runtests
justquick Mar 7, 2022
3a11e1b
dont require drf-spectacular for runtests
justquick Mar 7, 2022
a572c33
only test on push to main
justquick Mar 7, 2022
d8da187
test fix
justquick Mar 7, 2022
20201ab
local db setting overrides
justquick Mar 7, 2022
8856b37
move testapp tests to testapp and out of actstream
justquick Mar 7, 2022
06e43fc
wip: using drf-spectacular to autogen api docs
justquick Mar 19, 2022
ba3f5b6
Merge branch 'main' into drf
justquick May 20, 2022
4edf4a2
use drf-spectacular
justquick May 20, 2022
ec5cd26
Merge branch 'main' into drf
auvipy Jun 14, 2022
bb5c80b
Django>=3.2
auvipy Jun 14, 2022
2875fd1
Remove mysql details from docstring (#511)
cb109 Jul 5, 2022
9115494
docs: Fix a few typos
timgates42 Jul 17, 2022
5cfbf9a
+drf module to setup
justquick Aug 7, 2022
304f10f
new api docs
justquick Aug 7, 2022
dfa3eb4
Merge branch 'main' into drf
justquick Aug 7, 2022
e30d1cb
s/master/main/g trying coverage
justquick Aug 7, 2022
4eed673
v2 codeql, no coverage
justquick Aug 7, 2022
4cb8a83
new github workflow badge query
justquick Aug 7, 2022
c796efc
github actions + coveralls?
justquick Aug 7, 2022
89d8eb2
coveralls?
justquick Aug 7, 2022
c0e4efe
parallel coverage?
justquick Aug 7, 2022
c39808d
no custom coverage file name
justquick Aug 7, 2022
d065ef8
Merge branch 'main' into drf
justquick Aug 7, 2022
25b6e83
coveralls
justquick Aug 7, 2022
78149ff
Fixes #515 - Make it work with Django 4.1
marcusaram Aug 16, 2022
5503483
Fixes #515 - Change comment to the change
marcusaram Aug 16, 2022
1e1b16f
Merge pull request #516 from marcusaram/main
justquick Aug 18, 2022
a0d669d
Merge branch 'main' into drf
justquick Aug 18, 2022
7a5f3e8
django 4.1 in tox
justquick Aug 18, 2022
dd097fc
Merge branch 'main' of github.com:marcusaram/django-activity-stream
justquick Sep 16, 2022
674126a
Merge branch 'main' into drf
auvipy Oct 15, 2022
4fa7754
Merge branch 'drf' of github.com:justquick/django-activity-stream int…
justquick Oct 15, 2022
93940ba
separate django from drf tests
justquick Oct 15, 2022
b0affd7
fix typo in installation docs.
khialb32 Oct 19, 2022
848d46d
strip out drf spectacular for now
justquick Nov 20, 2022
1995c65
remove json field compatibility, force django 3.2, refs #480
lociii Nov 24, 2022
75e2310
start of drf docs
justquick Dec 19, 2022
7927e97
1.4.2 prep
justquick Dec 19, 2022
890d13f
updating authors and changelog ln
justquick Dec 19, 2022
299dc37
Merge branch 'main' into drf
justquick Dec 19, 2022
1d7b225
updating drf docs
justquick Feb 11, 2023
c58a281
Create SECURITY.md
auvipy Mar 24, 2023
2561372
fix for #524 datetime_safe removal
justquick Mar 25, 2023
b894d76
Merge tag '1.4.3'
justquick Mar 25, 2023
d06e7e2
feat(follows): delete object-orphaned Follows...
David-Guillot Dec 21, 2022
58aa178
Update codeql-analysis.yml
auvipy May 19, 2023
ca77897
Create dependabot.yml
justquick May 22, 2023
3898576
Bump actions/checkout from 2 to 3
dependabot[bot] May 22, 2023
b86fa91
Bump actions/upload-artifact from 2 to 3
dependabot[bot] May 22, 2023
6f9d634
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 11, 2023
cacfd7b
changelog entry for v2.0.0 release
auvipy Oct 4, 2023
a7df85e
Bump version to v2.0.0
auvipy Oct 4, 2023
1814460
Merge remote-tracking branch 'origin/add-swappable-models'
artushghazaryan Nov 24, 2023
370037c
remove unused imports
artushghazaryan Nov 24, 2023
04aeac1
add swappable models for drf part
artushghazaryan Nov 27, 2023
3a93700
add swappable models for drf part
artushghazaryan Nov 27, 2023
c0f3547
Merge remote-tracking branch 'origin/main'
artushghazaryan Nov 27, 2023
96cac83
release 2.0.1
artushghazaryan Dec 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 56 additions & 53 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1,105 +1,108 @@
Justin Quick <justquick@gmail.com>
Asif Saifuddin Auvi <auvipy@gmail.com>
Chris Beaven <smileychris@gmail.com>
ehsabd <ehsabd@outlook.com>
yangxg <zmrenwu@163.com>
Ben Slavin <benjamin.slavin@gmail.com>
Deepak Prakash <dp@deepakprakash.com>
Frank Wickström <frank.wickstrom@anders.fi>
Nick Sandford <nick@sandford.id.au>
Manuel Aristarán <jazzido@jazzido.com>
Alexey Boriskin <sun.void@gmail.com>
Jason Culverhouse <jason@mischievous.org>
Michael Jones <m.pricejones@gmail.com>
Piet Delport <piet@byteorbit.com>
Wade Williams <wade@wadewilliams.com>
jordan <jordan@192.168.1.5>
Bruno Amaral <mail@brunoamaral.eu>
Christoph Heer <Christoph.Heer@gmail.com>
Jens Nistler <opensource@jensnistler.de>
Josh Ourisman <josh@joshourisman.com>
Nolan Brubaker <nolan@nbrubaker.com>
Trever Shick <trevershick@gmail.com>
Artem Khurshudov <art1783@gmail.com>
Benjamin Kampmann <ben.kampmann@googlemail.com>
Chris <chris@piemonster.me>
Christoph Bülter <cb109@users.noreply.github.com>
David Gouldin <david@gould.in>
Dmitriy Narkevich <github@dimier.org>
Herman Schaaf <herman@herman-Latitude-E6500.(none)>
Jocelyn Delalande <jdelalande@oasiswork.fr>
Matt Katz <gitorious@morelightmorelight.com>
Natan Yellin <aantny@gmail.com>
Patrick Altman <paltman@gmail.com>
Paul Collins <paul.collins.iii@gmail.com>
Ryan Allen <ryan@ryangallen.com>
Steve Ivy <steve@wallrazer.com>
Tiago Henriques <trinosauro@gmail.com>
Walter Scheper <scheper@unc.edu>
artscoop <artscoop93.info@gmail.com>
cmwaura <cmmwaura@ucdavis.edu>
hugokernel <hugo@digitalspirit.org>
jbsag <joshjb1991@gmail.com>
moritz <moritz.fickenscher@fau.de>
neelesh <neelesh@gmail.com>
Aaron Williamson <aaron@copiesofcopies.org>
Alejandro Seguí <alesegdia@gmail.com>
Alexey Boriskin <sun.void@gmail.com>
anka-sirota <176934+anka-sirota@users.noreply.github.com>
Anwesha Das <anwesha@das.community>
Artem Khurshudov <art1783@gmail.com>
artscoop <artscoop93.info@gmail.com>
Asif Saifuddin Auvi <auvipy@gmail.com>
Aziz M. Bookwala <aziz.mansur@gmail.com>
Benjamin Kampmann <ben.kampmann@googlemail.com>
Ben Lopatin <ben.lopatin@wellfireinteractive.com>
Ben Slavin <benjamin.slavin@gmail.com>
Bob Cribbs <bcribbs@zehnergroup.com>
Bojan Mihelac <bmihelac@mihelac.org>
Brian Slater <36425025+slater-brian-john@users.noreply.github.com>
Bruno Amaral <mail@brunoamaral.eu>
Can Burak Cilingir <can@canb.net>
Chris Beaven <smileychris@gmail.com>
Chris <chris@piemonster.me>
Christoph Buelter <christoph.buelter@myshopradio.de>
Christoph Bülter <cb109@users.noreply.github.com>
Christoph Heer <Christoph.Heer@gmail.com>
cmwaura <cmmwaura@ucdavis.edu>
David Burke <dmbst32@gmail.com>
David Gouldin <david@gould.in>
Deepak Prakash <dp@deepakprakash.com>
Denis <denis_davidyuk@hotmail.com>
Denis Surkov <surkov0denis@yandex.ru>
Dex Bleeker <dex@bleeker.nl>
Dmitriy Narkevich <github@dimier.org>
Donald Stufft <donald.stufft@gmail.com>
ehsabd <ehsabd@outlook.com>
Elf M. Sternberg <elf.sternberg@gmail.com>
Filip Wasilewski <en@ig.ma>
fossabot <badges@fossa.io>
Frank Wickström <frank@bambuser.com>
Frank Wickström <frank.wickstrom@anders.fi>
Gilberto Magalhães <g.magalhaes@consultoriasigma.com.br>
Hameed Gifford <giff.h92@gmail.com>
Hanu Prateek Kunduru <hanuprateek@users.noreply.github.com>
Herman Schaaf <herman@herman-Latitude-E6500.(none)>
hugokernel <hugo@digitalspirit.org>
James <12661555+jmsmkn@users.noreply.github.com>
Jannon Frank <jannon.frank@tellagami.com>
Jason Culverhouse <jason@mischievous.org>
jbsag <joshjb1991@gmail.com>
Jeff Gordon <jgordon005@gmail.com>
Jens Nistler <opensource@jensnistler.de>
jess <jessachandler@gmail.com>
Jj <jjdelc@gmail.com>
joaoxsouls <joaoxsouls@gmail.com>
Jocelyn Delalande <jdelalande@oasiswork.fr>
JocelynDelalande <JocelynDelalande@users.noreply.github.com>
jordan <jordan@192.168.1.5>
Josh Ourisman <josh@joshourisman.com>
jpic <jamespic@gmail.com>
Justin Quick <justquick@gmail.com>
Keith Bussell <kbussell@gmail.com>
khial mustapha <khial.mustaphab32@gmail.com>
Kris Ciccarello <kmctown@users.noreply.github.com>
laginha <diogo.laginha.machado@gmail.com>
Luis <luis@wikirealty.com>
Lutaaya Idris <lutaaya.idris@captiq.com>
Manuel Aristarán <jazzido@jazzido.com>
Marc Fargas <telenieko@telenieko.com>
Marcus Aram <marcus@oxar.nl>
Matt Katz <gitorious@morelightmorelight.com>
Michael Bertolacci <m.bertolacci@gmail.com>
Michael Jones <m.pricejones@gmail.com>
Missuor4ever <sayseesea@vip.qq.com>
moritz <moritz.fickenscher@fau.de>
Muhammed Kaplan <gokdeniz91@gmail.com>
Natan Yellin <aantny@gmail.com>
neelesh <neelesh@gmail.com>
Nick Parsons <nparsons08@gmail.com>
Nick Sandford <nick@sandford.id.au>
Nolan Brubaker <nolan@nbrubaker.com>
odeson24 <odeson24@gmail.com>
Patrick Altman <paltman@gmail.com>
Patrick Sier <pjsier@users.noreply.github.com>
Paul Collins <paul.collins.iii@gmail.com>
Paul Nicolet <nicoletpaul@orange.fr>
Pedro Alcocer <pealco@gmail.com>
Pedro Burón <pedro@witoi.com>
Peter Walker <peterw@suprafax.net>
Piet Delport <piet@byteorbit.com>
riazanovslv <30866558+riazanovslv@users.noreply.github.com>
Rob Terhaar <rob@atlanticdynamic.com>
Rodrigo Suárez <rodrigosrz12@gmail.com>
Ryan Allen <ryan@ryangallen.com>
Sandip Agrawal <s@sandipagrawal.com>
Santiago Piccinini <spiccinini@codigosur.org>
Steve Ivy <steve@wallrazer.com>
Tamas Leposa <lt@lab85.com>
The Gitter Badger <badger@gitter.im>
Tiago Henriques <trinosauro@gmail.com>
Tim Gates <tim.gates@iress.com>
Tom Clancy <tclancy@gmail.com>
Tony Narlock <tony@git-pull.com>
Trever Shick <trevershick@gmail.com>
uy-rrodriguez <5296200+uy-rrodriguez@users.noreply.github.com>
Victor Munene <victor@regulusweb.com>
Vineet <naikvin@gmail.com>
Wade Williams <wade@wadewilliams.com>
Walter Scheper <scheper@unc.edu>
Xavier L <xavier.l@magnax.ca>
yangxg <zmrenwu@163.com>
Zbigniew Siciarz <antyqjon@gmail.com>
anka-sirota <176934+anka-sirota@users.noreply.github.com>
fossabot <badges@fossa.io>
jess <jessachandler@gmail.com>
joaoxsouls <joaoxsouls@gmail.com>
jpic <jamespic@gmail.com>
laginha <diogo.laginha.machado@gmail.com>
odeson24 <odeson24@gmail.com>
riazanovslv <30866558+riazanovslv@users.noreply.github.com>
uy-rrodriguez <5296200+uy-rrodriguez@users.noreply.github.com>
2 changes: 1 addition & 1 deletion actstream/__init__.py
Original file line number Diff line number Diff line change
@@ -12,5 +12,5 @@
default_app_config = 'actstream.apps.ActstreamConfig'


__version__ = '1.4.1'
__version__ = '1.4.2'
__author__ = 'Asif Saif Uddin, Justin Quick <justquick@gmail.com>'
11 changes: 0 additions & 11 deletions actstream/apps.py
Original file line number Diff line number Diff line change
@@ -25,14 +25,3 @@ def ready(self):
DataField(blank=True, null=True).contribute_to_class(
action_class, 'data'
)

# dynamically load django_jsonfield_backport to INSTALLED_APPS
if django.VERSION < (3, 1) and 'django_jsonfield_backport' not in settings.INSTALLED_APPS:
settings.INSTALLED_APPS += ('django_jsonfield_backport', )
# reset loaded apps
apps.app_configs = OrderedDict()
# reset initialization status
apps.apps_ready = apps.models_ready = apps.loading = apps.ready = False
apps.clear_cache()
# re-initialize all apps
apps.populate(settings.INSTALLED_APPS)
38 changes: 6 additions & 32 deletions actstream/jsonfield.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
'''

Decide on a JSONField implementation based on available packages.

These are the options:
- With recent Django >= 3.1 use Django's builtin JSONField.
- For Django versions < 3.1 we need django-jsonfield-backport
and will use its JSONField instead.

Raises an ImportError if USE_JSONFIELD is True, but none of the above
apply.

Falls back to a simple Django TextField if USE_JSONFIELD is False,
however that field will be removed by migration 0002 directly
afterwards.
django-activity-stream offered support for an optional JSON data field from 0.4.4 up until 1.4.0.
This was accomplished by overloading DataField with different model field types.
As of Django 3.2, the JSONField is supported by default.
However we need to keep this mapping to not break migrations.

'''
import django
from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.db.models import JSONField

from actstream.settings import USE_JSONFIELD


__all__ = ('DataField', )


DataField = models.TextField

if USE_JSONFIELD:
if django.VERSION >= (3, 1):
from django.db.models import JSONField
DataField = JSONField
else:
try:
from django_jsonfield_backport.models import JSONField
DataField = JSONField
except ImportError:
raise ImproperlyConfigured(
'You must install django-jsonfield-backport, '
'if you wish to use a JSONField on your actions '
'and run Django < 3.1'
)
DataField = JSONField
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -8,6 +8,12 @@ Changelog

- Added django-rest-framework support

1.4.2
----------

- Django 4.1 support, dropping support for EOL versions of Django - 3.2 and older
- Remove JSONField compatibility, extras and autoloading

1.4.0
------

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -139,8 +139,8 @@ def init():
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'DjangoActivityStream.tex', 'Django Activity Stream Documentation',
'Justin Quick', 'manual'),
('index', 'DjangoActivityStream.tex', 'Django Activity Stream Documentation',
'Justin Quick', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
13 changes: 0 additions & 13 deletions docs/data.rst
Original file line number Diff line number Diff line change
@@ -11,13 +11,6 @@ This uses a ``data`` JSONField on every Action where you can insert and delete v
This behavior is disabled by default but just set ``ACTSTREAM_SETTINGS['USE_JSONFIELD'] = True`` in your
settings.py to enable it.

.. note::

If you're running Django < 3.1 you must install django-jsonfield-backport or the extra ``jsonfield`` of this package.
"django_jsonfield_backport" gets dynamically added to the INSTALLED_APPS of your Django application if not yet done manually.

Please make sure to remove both the django-jsonfield-backport package and the ``django_jsonfield_backport`` INSTALLED_APPS entry (if manually added) after upgrading to Django >= 3.1

You can send the custom data as extra keyword arguments to the ``action`` signal.

.. code-block:: python
@@ -49,12 +42,6 @@ Adding to Existing Project

If you start out your project with ``USE_JSONFIELD=False``, dont worry you can add it afterwards.

Make sure you have the latest JSONField implementation

.. code-block::

pip install django-activity-stream[jsonfield]

Make sure ``USE_JSONFIELD`` is non-existent or set to False then do the initial migration

.. code-block:: bash
19 changes: 2 additions & 17 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ or get it from source
Basic app configuration
-----------------------

Then to add the Django Activity Stream to your project add the app ``actstream`` and ``django.contib.sites`` to your ``INSTALLED_APPS`` and urlconf. In addition to, add the setting ``SITE_ID = 1`` below the installed apps.
Then to add the Django Activity Stream to your project add the app ``actstream`` and ``django.contrib.sites`` to your ``INSTALLED_APPS`` and urlconf. In addition to, add the setting ``SITE_ID = 1`` below the installed apps.


.. code-block:: python
@@ -46,20 +46,6 @@ Add the activity urls to your urlconf

The activity urls are not required for basic usage but provide activity :ref:`feeds` and handle following, unfollowing and querying of followers.


Add extra data to actions
-------------------------

If you want to use custom data on your actions and are running Django < 3.1, then make sure you have
`django-jsonfield-backport <https://pypi.org/project/django-jsonfield-backport/>`_ installed.

.. code-block:: bash

$ pip install django-activity-stream[jsonfield]

You can learn more at :ref:`custom-data`


Supported Environments
----------------------

@@ -74,14 +60,13 @@ Make sure to pick the version of Django and django-activity-stream that supports
Python
******


* **Python 3**: 3.6 to 3.9
* **PyPy**: 3

Django
******

* **Django**: 2.2+ only
* **Django**: 3.2+ only

Databases
*********
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
license='BSD 3-Clause',
author_email='justquick@gmail.com',
url='http://github.com/justquick/django-activity-stream',
install_requires=['Django>=3.2'],
packages=['actstream',
'actstream.migrations',
'actstream.drf',
@@ -31,7 +32,6 @@
'Programming Language :: Python :: 3',
'Topic :: Utilities'],
extras_require={
'jsonfield': ['django-jsonfield-backport>=1.0.2,<2.0'],
'drf': ['django-rest-framework', 'rest-framework-generic-relations'],
},
)