Compare commits

...

12 commits

Author SHA1 Message Date
dependabot[bot]
7e33d8261e
Bump codecov/codecov-action from 5 to 6 in the github-actions group (#813)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
Bumps the github-actions group with 1 update: [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `codecov/codecov-action` from 5 to 6
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 18:18:21 +02:00
pre-commit-ci[bot]
c354c7ff56
[pre-commit.ci] pre-commit autoupdate (#810)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
updates:
- [github.com/psf/black-pre-commit-mirror: 26.3.0 → 26.3.1](https://github.com/psf/black-pre-commit-mirror/compare/26.3.0...26.3.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-17 09:20:55 +01:00
pre-commit-ci[bot]
0e3a2ec1a7
[pre-commit.ci] pre-commit autoupdate (#808)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
updates:
- [github.com/psf/black-pre-commit-mirror: 26.1.0 → 26.3.0](https://github.com/psf/black-pre-commit-mirror/compare/26.1.0...26.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-10 10:58:29 +01:00
pre-commit-ci[bot]
dfd5b79d2d
[pre-commit.ci] pre-commit autoupdate (#807)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
updates:
- [github.com/PyCQA/isort: 8.0.0 → 8.0.1](https://github.com/PyCQA/isort/compare/8.0.0...8.0.1)
- [github.com/adamchainz/django-upgrade: 1.29.1 → 1.30.0](https://github.com/adamchainz/django-upgrade/compare/1.29.1...1.30.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-04 13:06:54 +01:00
pre-commit-ci[bot]
4154560de3
[pre-commit.ci] pre-commit autoupdate (#806)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
updates:
- [github.com/PyCQA/isort: 7.0.0 → 8.0.0](https://github.com/PyCQA/isort/compare/7.0.0...8.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-02-24 11:56:32 +00:00
congusbongus
3f255a02d9
Fix typo in usage.rst regarding field exclusion (#801)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
2026-02-05 10:56:57 +01:00
marco-thirona
6d170da5fc
Add support for m2m changes in AbstractLogEntry.changes_str (#798)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
* Add test case to test log entry changes_str property for m2m changes.

* Add support for m2m field changes and generic changes in AbstractLogEntry.changes_str property.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add more test cases for changes_str.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add chengelog note

* Validate type and length of changes_dict values.

* Restructure change iterator.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-29 21:44:40 +01:00
pre-commit-ci[bot]
198c060c3b
[pre-commit.ci] pre-commit autoupdate (#799)
Some checks failed
Test / SQLite • Python 3.10 (push) Has been cancelled
Test / SQLite • Python 3.11 (push) Has been cancelled
Test / SQLite • Python 3.12 (push) Has been cancelled
Test / SQLite • Python 3.13 (push) Has been cancelled
Test / PostgreSQL • Python 3.10 (push) Has been cancelled
Test / PostgreSQL • Python 3.11 (push) Has been cancelled
Test / PostgreSQL • Python 3.12 (push) Has been cancelled
Test / PostgreSQL • Python 3.13 (push) Has been cancelled
Test / MySQL • Python 3.10 (push) Has been cancelled
Test / MySQL • Python 3.11 (push) Has been cancelled
Test / MySQL • Python 3.12 (push) Has been cancelled
Test / MySQL • Python 3.13 (push) Has been cancelled
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/25.12.0...26.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-19 19:43:03 +01:00
pre-commit-ci[bot]
ede4d10164
[pre-commit.ci] pre-commit autoupdate (#790)
updates:
- [github.com/psf/black-pre-commit-mirror: 25.11.0 → 25.12.0](https://github.com/psf/black-pre-commit-mirror/compare/25.11.0...25.12.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-07 19:57:08 +01:00
Youngkwang Yang
aedb6ead39
Update CHANGELOG.md (#791) 2025-12-18 17:52:50 +09:00
dependabot[bot]
fb762a054f
Bump actions/cache from 4 to 5 in the github-actions group (#794)
Bumps the github-actions group with 1 update: [actions/cache](https://github.com/actions/cache).


Updates `actions/cache` from 4 to 5
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 08:48:43 +01:00
James Gillard
dc636716b0
Fix AttributeError when AUDITLOG_LOGENTRY_MODEL is not set (#788) (#789)
Use getattr() with default value in get_logentry_model() to handle
cases where conf.py hasn't been imported yet due to import order.

Adds regression test to verify the fix.
2025-12-13 00:28:10 +09:00
9 changed files with 96 additions and 26 deletions

View file

@ -26,7 +26,7 @@ jobs:
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache - name: Cache
uses: actions/cache@v4 uses: actions/cache@v5
with: with:
path: ${{ steps.pip-cache.outputs.dir }} path: ${{ steps.pip-cache.outputs.dir }}
key: release-${{ hashFiles('**/setup.py') }} key: release-${{ hashFiles('**/setup.py') }}

View file

@ -25,7 +25,7 @@ jobs:
run: tox -v run: tox -v
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v6
with: with:
name: SQLite • Python ${{ matrix.python-version }} name: SQLite • Python ${{ matrix.python-version }}
@ -71,7 +71,7 @@ jobs:
run: tox -v run: tox -v
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v6
with: with:
name: PostgreSQL • Python ${{ matrix.python-version }} name: PostgreSQL • Python ${{ matrix.python-version }}
@ -122,6 +122,6 @@ jobs:
run: tox -v run: tox -v
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v6
with: with:
name: MySQL • Python ${{ matrix.python-version }} name: MySQL • Python ${{ matrix.python-version }}

View file

@ -1,7 +1,7 @@
--- ---
repos: repos:
- repo: https://github.com/psf/black-pre-commit-mirror - repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.11.0 rev: 26.3.1
hooks: hooks:
- id: black - id: black
language_version: python3.10 language_version: python3.10
@ -14,7 +14,7 @@ repos:
- id: flake8 - id: flake8
args: ["--max-line-length", "110"] args: ["--max-line-length", "110"]
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort
rev: 7.0.0 rev: 8.0.1
hooks: hooks:
- id: isort - id: isort
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
@ -23,7 +23,7 @@ repos:
- id: pyupgrade - id: pyupgrade
args: [--py310-plus] args: [--py310-plus]
- repo: https://github.com/adamchainz/django-upgrade - repo: https://github.com/adamchainz/django-upgrade
rev: 1.29.1 rev: 1.30.0
hooks: hooks:
- id: django-upgrade - id: django-upgrade
args: [--target-version, "4.2"] args: [--target-version, "4.2"]

View file

@ -2,6 +2,16 @@
## Next Release ## Next Release
#### Fixes
- `KeyError` when calling `changes_str` on a log entry that tracks many-to-many field changes ([#798](https://github.com/jazzband/django-auditlog/pull/798))
## 3.4.1 (2025-12-13)
#### Fixes
- Fix AttributeError when AUDITLOG_LOGENTRY_MODEL is not set ([#789](https://github.com/jazzband/django-auditlog/pull/789))
## 3.4.0 (2025-12-04) ## 3.4.0 (2025-12-04)
#### Improvements #### Improvements

View file

@ -10,10 +10,9 @@ __version__ = version("django-auditlog")
def get_logentry_model(): def get_logentry_model():
model_string = getattr(settings, "AUDITLOG_LOGENTRY_MODEL", "auditlog.LogEntry")
try: try:
return django_apps.get_model( return django_apps.get_model(model_string, require_ready=False)
settings.AUDITLOG_LOGENTRY_MODEL, require_ready=False
)
except ValueError: except ValueError:
raise ImproperlyConfigured( raise ImproperlyConfigured(
"AUDITLOG_LOGENTRY_MODEL must be of the form 'app_label.model_name'" "AUDITLOG_LOGENTRY_MODEL must be of the form 'app_label.model_name'"
@ -21,5 +20,5 @@ def get_logentry_model():
except LookupError: except LookupError:
raise ImproperlyConfigured( raise ImproperlyConfigured(
"AUDITLOG_LOGENTRY_MODEL refers to model '%s' that has not been installed" "AUDITLOG_LOGENTRY_MODEL refers to model '%s' that has not been installed"
% settings.AUDITLOG_LOGENTRY_MODEL % model_string
) )

View file

@ -126,15 +126,13 @@ class Command(BaseCommand):
def postgres(): def postgres():
with connection.cursor() as cursor: with connection.cursor() as cursor:
cursor.execute( cursor.execute(f"""
f"""
UPDATE {LogEntry._meta.db_table} UPDATE {LogEntry._meta.db_table}
SET changes="changes_text"::jsonb SET changes="changes_text"::jsonb
WHERE changes_text IS NOT NULL WHERE changes_text IS NOT NULL
AND changes_text <> '' AND changes_text <> ''
AND changes IS NULL AND changes IS NULL
""" """)
)
return cursor.cursor.rowcount return cursor.cursor.rowcount
if database == "postgres": if database == "postgres":

View file

@ -427,21 +427,29 @@ class AbstractLogEntry(models.Model):
not satisfying, please use :py:func:`LogEntry.changes_dict` and format the string yourself. not satisfying, please use :py:func:`LogEntry.changes_dict` and format the string yourself.
:param colon: The string to place between the field name and the values. :param colon: The string to place between the field name and the values.
:param arrow: The string to place between each old and new value. :param arrow: The string to place between each old and new value (non-m2m field changes only).
:param separator: The string to place between each field. :param separator: The string to place between each field.
:return: A readable string of the changes in this log entry. :return: A readable string of the changes in this log entry.
""" """
substrings = [] substrings = []
for field, values in self.changes_dict.items(): for field, value in sorted(self.changes_dict.items()):
substring = "{field_name:s}{colon:s}{old:s}{arrow:s}{new:s}".format( if isinstance(value, (list, tuple)) and len(value) == 2:
field_name=field, # handle regular field change
colon=colon, substring = "{field_name:s}{colon:s}{old:s}{arrow:s}{new:s}".format(
old=values[0], field_name=field,
arrow=arrow, colon=colon,
new=values[1], old=value[0],
) arrow=arrow,
substrings.append(substring) new=value[1],
)
substrings.append(substring)
elif isinstance(value, dict) and value.get("type") == "m2m":
# handle m2m change
substring = (
f"{field}{colon}{value['operation']} {sorted(value['objects'])}"
)
substrings.append(substring)
return separator.join(substrings) return separator.join(substrings)

View file

@ -131,6 +131,11 @@ class SimpleModelTest(TestCase):
{"boolean": ["False", "True"]}, {"boolean": ["False", "True"]},
msg="The change is correctly logged", msg="The change is correctly logged",
) )
self.assertEqual(
history.changes_str,
"boolean: False → True",
msg="Changes string is correct",
)
def test_update_specific_field_supplied_via_save_method(self): def test_update_specific_field_supplied_via_save_method(self):
obj = self.obj obj = self.obj
@ -149,6 +154,11 @@ class SimpleModelTest(TestCase):
"when using the `update_fields`." "when using the `update_fields`."
), ),
) )
self.assertEqual(
obj.history.get(action=LogEntry.Action.UPDATE).changes_str,
"boolean: False → True",
msg="Changes string is correct",
)
def test_django_update_fields_edge_cases(self): def test_django_update_fields_edge_cases(self):
""" """
@ -179,6 +189,11 @@ class SimpleModelTest(TestCase):
{"boolean": ["False", "True"], "integer": ["None", "1"]}, {"boolean": ["False", "True"], "integer": ["None", "1"]},
msg="The 2 fields changed are correctly logged", msg="The 2 fields changed are correctly logged",
) )
self.assertEqual(
obj.history.get(action=LogEntry.Action.UPDATE).changes_str,
"boolean: False → True; integer: None → 1",
msg="Changes string is correct",
)
def test_delete(self): def test_delete(self):
"""Deletion is logged correctly.""" """Deletion is logged correctly."""
@ -494,6 +509,13 @@ class ManyRelatedModelTest(TestCase):
}, },
) )
def test_changes_str(self):
self.obj.related.add(self.related)
log_entry = self.obj.history.first()
self.assertEqual(
log_entry.changes_str, f"related: add {[smart_str(self.related)]}"
)
def test_adding_existing_related_obj(self): def test_adding_existing_related_obj(self):
self.obj.related.add(self.related) self.obj.related.add(self.related)
log_entry = self.obj.history.first() log_entry = self.obj.history.first()
@ -725,6 +747,11 @@ class SimpleIncludeModelTest(TestCase):
{"label": ["Initial label", "New label"]}, {"label": ["Initial label", "New label"]},
msg="Only the label was logged, regardless of multiple entries in `update_fields`", msg="Only the label was logged, regardless of multiple entries in `update_fields`",
) )
self.assertEqual(
obj.history.get(action=LogEntry.Action.UPDATE).changes_str,
"label: Initial label → New label",
msg="Changes string is correct",
)
def test_register_include_fields(self): def test_register_include_fields(self):
sim = SimpleIncludeModel(label="Include model", text="Looong text") sim = SimpleIncludeModel(label="Include model", text="Looong text")
@ -2061,6 +2088,11 @@ class JSONModelTest(TestCase):
{"json": ["{}", '{"quantity": "1"}']}, {"json": ["{}", '{"quantity": "1"}']},
msg="The change is correctly logged", msg="The change is correctly logged",
) )
self.assertEqual(
history.changes_str,
'json: {}{"quantity": "1"}',
msg="Changes string is correct",
)
def test_update_with_no_changes(self): def test_update_with_no_changes(self):
"""No changes are logged.""" """No changes are logged."""
@ -2697,6 +2729,7 @@ class TestAccessLog(TestCase):
) )
self.assertIsNone(log_entry.changes) self.assertIsNone(log_entry.changes)
self.assertEqual(log_entry.changes_dict, {}) self.assertEqual(log_entry.changes_dict, {})
self.assertEqual(log_entry.changes_str, "")
class SignalTests(TestCase): class SignalTests(TestCase):
@ -3120,6 +3153,9 @@ class BaseManagerSettingTest(TestCase):
} }
}, },
) )
self.assertEqual(
log_entry.changes_str, f"m2m_related: add {[smart_str(obj_two)]}"
)
class TestMaskStr(TestCase): class TestMaskStr(TestCase):
@ -3248,3 +3284,22 @@ class GetLogEntryModelTest(TestCase):
def test_invalid_appname(self): def test_invalid_appname(self):
with self.assertRaises(ImproperlyConfigured): with self.assertRaises(ImproperlyConfigured):
get_logentry_model() get_logentry_model()
def test_logentry_model_default_when_setting_missing(self):
"""Regression test for issue #788: AttributeError when AUDITLOG_LOGENTRY_MODEL is not set."""
# Save and remove the setting to simulate the bug condition
original_value = getattr(settings, "AUDITLOG_LOGENTRY_MODEL", None)
if hasattr(settings, "AUDITLOG_LOGENTRY_MODEL"):
delattr(settings, "AUDITLOG_LOGENTRY_MODEL")
try:
# This should NOT raise AttributeError - it should use the default
model = get_logentry_model()
self.assertEqual(
f"{model._meta.app_label}.{model._meta.object_name}",
"auditlog.LogEntry",
)
finally:
# Restore the original setting
if original_value is not None:
settings.AUDITLOG_LOGENTRY_MODEL = original_value

View file

@ -76,7 +76,7 @@ You can also add log-access to function base views, as the following example ill
Fields that are excluded will not trigger saving a new log entry and will not show up in the recorded changes. Fields that are excluded will not trigger saving a new log entry and will not show up in the recorded changes.
To exclude specific fields from the log you can pass ``include_fields`` resp. ``exclude_fields`` to the ``register`` To exclude specific fields from the log you can pass ``include_fields`` or ``exclude_fields`` to the ``register``
method. If ``exclude_fields`` is specified the fields with the given names will not be included in the generated log method. If ``exclude_fields`` is specified the fields with the given names will not be included in the generated log
entries. If ``include_fields`` is specified only the fields with the given names will be included in the generated log entries. If ``include_fields`` is specified only the fields with the given names will be included in the generated log
entries. Explicitly excluding fields through ``exclude_fields`` takes precedence over specifying which fields to entries. Explicitly excluding fields through ``exclude_fields`` takes precedence over specifying which fields to