-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Passing multiple template names to the templating engine. Django will… #920
Open
benf710
wants to merge
49
commits into
jazzband:master
Choose a base branch
from
benf710:custom-admin-templates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… try them in order until one of them resolves and will use that one.
for more information, see https://pre-commit.ci
@benf710 maybe rebasing this on master will help? |
jeking3
requested changes
Feb 4, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI broke with the changes.
@@ -20,9 +20,6 @@ | |||
|
|||
|
|||
class SimpleHistoryAdmin(admin.ModelAdmin): | |||
object_history_template = "simple_history/object_history.html" | |||
object_history_form_template = "simple_history/object_history_form.html" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on CI, something depends on this (could just be tests - didn't look).
… try them in order until one of them resolves and will use that one.
for more information, see https://pre-commit.ci
updates: - [github.com/psf/black: 21.11b1 → 21.12b0](psf/black@21.11b1...21.12b0)
Bumps [black](https://github.com/psf/black) from 21.11b1 to 21.12b0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0)
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.3.1 to 4.3.2. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/4.x/CHANGES) - [Commits](sphinx-doc/sphinx@v4.3.1...v4.3.2) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [tox](https://github.com/tox-dev/tox) from 3.24.4 to 3.24.5. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](tox-dev/tox@3.24.4...3.24.5) --- updated-dependencies: - dependency-name: tox dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.9.2 to 2.9.3. - [Release notes](https://github.com/psycopg/psycopg2/releases) - [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS) - [Commits](https://github.com/psycopg/psycopg2/commits) --- updated-dependencies: - dependency-name: psycopg2-binary dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [tox-gh-actions](https://github.com/ymyzk/tox-gh-actions) from 2.8.1 to 2.9.1. - [Release notes](https://github.com/ymyzk/tox-gh-actions/releases) - [Commits](ymyzk/tox-gh-actions@v2.8.1...v2.9.1) --- updated-dependencies: - dependency-name: tox-gh-actions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.3.2 to 4.4.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/4.x/CHANGES) - [Commits](sphinx-doc/sphinx@v4.3.2...v4.4.0) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
This changes `as_of` to return a QuerySet instead of a list of instances so that further filtering can be applied to the history.
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.2 to 6.3. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@6.2...6.3) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3 to 6.3.1. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@6.3...6.3.1) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [black](https://github.com/psf/black) from 21.12b0 to 22.1.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits/22.1.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
updates: - [github.com/PyCQA/bandit: 1.7.1 → 1.7.2](PyCQA/bandit@1.7.1...1.7.2) - [github.com/psf/black: 21.12b0 → 22.1.0](psf/black@21.12b0...22.1.0)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3.1 to 6.3.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](nedbat/coveragepy@6.3.1...6.3.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
updates: - [github.com/PyCQA/bandit: 1.7.2 → 1.7.4](PyCQA/bandit@1.7.2...1.7.4)
* implemented a register setting that allows you to drop db_index on history models, tests are also added * updated text files as required by contributing * ran make format Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jim King <[email protected]>
Add is_historic, to_historic helpers.
Shortcoming of previous architecture: Recording reason for change was only through manually setting to each object or through bulk_history_create. So recording API request as reason automatically was hard to implement with this architecture. Solution: Getting change reason is now done through `HistoricalRecords` method `get_change_reason_for_object`. And thus this method can be overriden in subclass to define custom behavior.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…tom-admin-templates # Conflicts: # .github/workflows/test.yml # .pre-commit-config.yaml # CHANGES.rst # README.rst # docs/historical_model.rst # docs/index.rst # docs/querying_history.rst # requirements/coverage.txt # requirements/docs.txt # requirements/lint.txt # requirements/postgres.txt # requirements/tox.txt # setup.py # simple_history/admin.py # simple_history/models.py # simple_history/tests/tests/test_models.py # tox.ini
Sync fork master branch
for more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This passes the Django default admin template override paths to the views in order so that a user can override the django admin templates used in this project.
Related Issue
This resolves #919.
Motivation and Context
How Has This Been Tested?
Tested with a Django app to override the
object_history.html
template per the Django documentationScreenshots (if appropriate):
Types of changes
This change does not introduce any breaking changes in any version of Django >= 1.10. It allows the end user implementing this library to implement custom templates in their own project per Django documentation: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates
Checklist:
pre-commit run
command to format and lint.AUTHORS.rst
CHANGES.rst