Skip to content

Commit bc442cd

Browse files
committed
updates docs and CI
1 parent 891cb63 commit bc442cd

15 files changed

+166
-68
lines changed

.github/file-filters.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ package:
2525

2626
docs:
2727
- added|modified: './docs/**/*'
28-
- modified: './src/birder/config/__init__.py'
28+
- modified: './README.md'
2929
- modified: './github/workflows/docs.yml'
3030
- modified: './github/file-filters.yml'

.github/workflows/docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run:
2626
shell: bash
2727
outputs:
28-
run_tests: ${{ steps.changes.outputs.docs }}
28+
docs: ${{ steps.changes.outputs.docs }}
2929
steps:
3030
- name: Checkout code
3131
uses: actions/[email protected]
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@v4
4949

5050
- name: Set up Python
51-
uses: actions/setup-python@v4
51+
uses: actions/setup-python@v5
5252
with:
5353
python-version: "3.12"
5454

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.pyc
66
*.egg-info
77
*.sqlite
8+
*.inv
89
src/adminactions/version.py
910
/dist
1011
/build

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Collection of useful actions to use with `django.contrib.admin.ModelAdmin` and/o
2525

2626
#### Project Links
2727

28-
- Code: https://github.com/saxix/django-adminactions
29-
- Documentation: https://saxix.github.io/django-adminactions/
30-
- Issue Tracker: https://github.com/saxix/django-adminactions/issues?sort
31-
- Download Package: https://pypi.org/project/django-adminactions/
28+
- Code: [https://github.com/saxix/django-adminactions](https://github.com/saxix/django-adminactions)
29+
- Documentation:[https://saxix.github.io/django-adminactions/](https://saxix.github.io/django-adminactions/)
30+
- Issue Tracker: [https://github.com/saxix/django-adminactions/issues](https://github.com/saxix/django-adminactions/issues?sort)
31+
- Download Package: [https://pypi.org/project/django-adminactions/](https://pypi.org/project/django-adminactions/)

docs/src/actions/bulk_update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Updates queryset using csv file
55

66
**Screenshots**
77

8-
![bulk_update](_static/bulk_update.png)
8+
![bulk_update](../_static/bulk_update.png)

docs/src/actions/export_as_csv.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Available options: (see [csv][csv]).
2222

2323
**Screenshot**
2424

25-
![export_as_csv](_static/export_as_csv.png){ align=left }
25+
![export_as_csv](../_static/export_as_csv.png){ align=left }
2626

2727

2828
## Customize Options Form

docs/src/actions/export_as_fixture.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Export selected queryset as fixtures using any registered Serializer.
1818

1919
**Screenshot**
2020

21-
![img_export_as_fixture](_static/export_as_fixture.png)
21+
![img_export_as_fixture](../_static/export_as_fixture.png)

docs/src/actions/find_duplicates.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Note: This can be used to count records based on simple grouping
1414

1515
**Screenshots**
1616

17-
![find_duplicates](_static/find_duplicates.png)
17+
![find_duplicates](../_static/find_duplicates.png)

docs/src/actions/graph_queryset.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Graph selected queryset.
1010

1111
**Screenshot**
1212

13-
![graph_pie](_static/graph_pie.png)
13+
![graph_pie](../_static/graph_pie.png)
1414

15-
![graph_bar](_static/graph_bar.png)
15+
![graph_bar](../_static/graph_bar.png)

docs/src/actions/mass_update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Update one or more fields of the selected queryset to a common value and/or appl
1212

1313
**Screenshot**
1414

15-
![Mass Update](_static/mass_update.png){ align=left }
15+
![Mass Update](../_static/mass_update.png){ align=left }
1616

1717

1818
## Ignore Fields

docs/src/actions/merge.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ from one record to the other one.
1212

1313
### Step 1
1414

15-
![graph_bar](_static/merge_1.png)
15+
![graph_bar](../_static/merge_1.png)
1616

1717
### Step 2
1818

1919

20-
![graph_bar](_static/merge_2.png)
20+
![graph_bar](../_static/merge_2.png)
2121

2222

2323

docs/src/signals.md

+43-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Signals
22

3-
|app| provides the following signals:
3+
{{app}} provides the following signals:
44

55
* [[#adminaction_requested]]
66
* [[#adminaction_start]]
@@ -13,15 +13,18 @@ Sent when the action is requested (ie click 'Go' in the admin changelist view).
1313
The handler can raise a :ref:`actioninterrupted` to interrupt
1414
the action's execution. The handler can rely on the following parameter:
1515

16+
1617
* sender: [django.db.models.Model][]
1718
* action: string. name of the action
18-
* request: [HttpRequest](https://django.readthedocs.io/en/5.1.x/ref/request-response.html#httprequest-objects)
19-
* queryset: [Queryset](https://django.readthedocs.io/en/5.1.x/ref/models/querysets.html)
19+
* request: [django.http.HttpRequest][]
20+
* queryset: [django.db.models.query.QuerySet][]
2021
* modeladmin: [django.contrib.admin.ModelAdmin][]
2122

23+
2224
Example::
2325
```python
2426

27+
from adminactions.exceptions import ActionInterrupted
2528
from adminactions.signals import adminaction_requested
2629

2730
def myhandler(sender, action, request, queryset, modeladmin, **kwargs):
@@ -38,11 +41,11 @@ Sent after the form has been validated (ie click 'Apply' in the action Form),
3841
The handler can raise a :ref:`actioninterrupted` to avoid the stop execution.
3942
The handler can rely on the following parameter:
4043

41-
* sender: :class:`django:django.db.models.Model`
44+
* sender: [django.db.models.Model][]
4245
* action: string. name of the action
43-
* request: :class:`django:django.core.httpd.HttpRequest`
44-
* queryset: :class:`django:django.db.models.query.Queryset`
45-
* modeladmin: :class:`django:django.contrib.admin.ModelAdmin`
46+
* request: [django.http.HttpRequest][]
47+
* queryset: [django.db.models.query.QuerySet][]
48+
* modeladmin: [django.contrib.admin.ModelAdmin][]
4649
* form: :class:`django:django.forms.Form`
4750

4851
Example
@@ -66,11 +69,39 @@ adminaction_start.connect(myhandler, sender=MyModel, action='export`)
6669
Sent **after** the successfully execution of the action.
6770
The handler can rely on the following parameter:
6871

69-
* sender: :class:`django:django.db.models.Model`
72+
* sender: [django.db.models.Model][]
7073
* action: string. name of the action
71-
* request: :class:`django:django.core.httpd.HttpRequest`
72-
* queryset: :class:`django:django.db.models.query.Queryset`
73-
* modeladmin: :class:`django:django.contrib.admin.ModelAdmin`
74-
* form: :class:`django:django.forms.Form`
74+
* request: [django.http.HttpRequest][]
75+
* queryset: [django.db.models.query.QuerySet][]
76+
* modeladmin: [django.contrib.admin.ModelAdmin][]
77+
* form: [django.forms.Form][]
7578
* errors: dict
7679
* updated: int
80+
81+
82+
83+
84+
## mass_update_process
85+
86+
87+
Sent **before** the record is updated:
88+
The handler can rely on the following parameter:
89+
90+
* sender: [django.db.models.Model][]
91+
* request: [django.http.HttpRequest][]
92+
* queryset: [django.db.models.query.QuerySet][]
93+
94+
Es:
95+
```python
96+
from django.contrib.auth.models import User
97+
from django.dispatch import receiver
98+
from adminactions.signals import mass_update_process
99+
from adminactions.exceptions import MassUpdateSkipRecordError
100+
101+
102+
@receiver(mass_update_process, sender=User)
103+
def my_handler(sender, record: User, **kwargs):
104+
if record.is_superuser:
105+
raise MassUpdateSkipRecordError
106+
107+
```

mkdocs.yml

+34-39
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ exclude_docs: |
1515
~*
1616
1717
markdown_extensions:
18-
- abbr
18+
# - abbr
1919
- admonition
2020
- attr_list
2121
- md_in_html
22-
- pymdownx.blocks.caption
23-
- pymdownx.details
24-
- pymdownx.snippets
22+
# - pymdownx.blocks.caption
23+
# - pymdownx.details
24+
# - pymdownx.snippets
2525
- pymdownx.superfences
26-
- tables
27-
- pymdownx.tasklist:
28-
custom_checkbox: true
29-
clickable_checkbox: true
26+
# - tables
27+
# - pymdownx.tasklist:
28+
# custom_checkbox: true
29+
# clickable_checkbox: true
3030
- pymdownx.emoji:
3131
emoji_index: !!python/name:material.extensions.emoji.twemoji
3232
emoji_generator: !!python/name:material.extensions.emoji.to_svg
33-
- pymdownx.highlight:
34-
anchor_linenums: true
35-
line_spans: __span
36-
pygments_lang_class: true
37-
- pymdownx.inlinehilite
38-
# - pymdownx.magiclink
33+
# - pymdownx.highlight:
34+
# anchor_linenums: true
35+
# line_spans: __span
36+
# pygments_lang_class: true
37+
# - pymdownx.inlinehilite
38+
# - pymdownx.magiclink
3939
# - pymdownx.superfences:
4040
# custom_fences:
4141
# - name: mermaid
@@ -44,49 +44,43 @@ markdown_extensions:
4444
#
4545
theme:
4646
name: "material"
47-
# color_mode: auto
48-
49-
# custom_dir: docs/_theme/overrides
50-
# favicon: img/favicon.ico
51-
# logo: img/logo.png
5247
highlightjs: true
5348
hljs_languages:
5449
- yaml
5550
- django
56-
# user_color_mode_toggle: true
5751
palette:
58-
- scheme: default
59-
toggle:
60-
icon: material/brightness-7
61-
name: Switch to dark mode
62-
accent: indigo
52+
- scheme: default
53+
toggle:
54+
icon: material/brightness-7
55+
name: Switch to dark mode
56+
accent: indigo
6357

64-
- scheme: slate
65-
toggle:
66-
icon: material/brightness-4
67-
name: Switch to light mode
58+
- scheme: slate
59+
toggle:
60+
icon: material/brightness-4
61+
name: Switch to light mode
6862
features:
6963
# - content.action.edit
7064
- content.code.annotate
7165
- content.code.copy
7266
- content.tooltips
7367
- header.autohidex
74-
# - navigation.footer
7568
- navigation.indexes
7669
- navigation.instant
7770
- navigation.instant.prefetch
7871
- navigation.instant.progress
79-
# extra:
80-
# version:
81-
# provider: mike
82-
# alias: true
72+
validation:
73+
links:
74+
absolute_links: relative_to_docs
8375

8476
plugins:
8577
- awesome-pages
78+
- autorefs
8679
- include-markdown
80+
- macros
8781
- glightbox
88-
- tags
89-
- markdownextradata
82+
# - tags
83+
# - markdownextradata
9084
- ezlinks:
9185
wikilinks: true
9286
- mkdocstrings:
@@ -96,10 +90,10 @@ plugins:
9690
inventories:
9791
- https://installer.readthedocs.io/en/stable/objects.inv
9892
- https://django.readthedocs.org/en/5.1.x/objects.inv
99-
# - url: https://docs.python.org/3.13/objects.inv
100-
# domains: [std, py, csv]
93+
# # - url: https://docs.python.org/3.13/objects.inv
94+
# # domains: [std, py, csv]
10195
- https://docs.python.org/3.13/objects.inv
102-
96+
#
10397
- search
10498
# - gen-files:
10599
# scripts:
@@ -116,3 +110,4 @@ extra:
116110
github: https://github.com/saxix/django-adminactions/issues/
117111
stackoverflow: stackoverflow.com/questions/
118112
google: https://www.google.com/search?q=
113+
app: django-adminactions

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dev = [
5757
"django-environ",
5858
"django-stubs>=5.1.3",
5959
"django-webtest",
60+
"griffe>=1.5.7",
6061
"mock",
6162
"modernize",
6263
"mypy",
@@ -76,11 +77,13 @@ dev = [
7677
]
7778
docs = [
7879
"mkdocs>=1.6.1",
80+
"mkdocs-autolinks-plugin>=0.7.1",
7981
"mkdocs-autorefs>=1.3.1",
8082
"mkdocs-awesome-pages-plugin>=2.10.1",
8183
"mkdocs-ezlinks-plugin>=0.1.14",
8284
"mkdocs-glightbox>=0.4",
8385
"mkdocs-include-markdown-plugin>=6.2.2",
86+
"mkdocs-macros-plugin>=1.3.7",
8487
"mkdocs-markdownextradata-plugin>=0.2.6",
8588
"mkdocs-material>=9.6.5",
8689
"mkdocs-material-extensions>=1.3.1",

0 commit comments

Comments
 (0)