Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tj-django/django-clone
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.1
Choose a base ref
...
head repository: tj-django/django-clone
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 1,241 additions and 702 deletions.
  1. +24 −2 .all-contributorsrc
  2. +1 −1 .bumpversion.cfg
  3. +0 −20 .github/dependabot.yml
  4. +1 −1 .github/workflows/auto-approve.yml
  5. +33 −20 .github/workflows/auto-merge.yml
  6. +3 −3 .github/workflows/codacy-analysis.yml
  7. +5 −5 .github/workflows/deploy.yml
  8. +2 −2 .github/workflows/gh-pages.yml
  9. +6 −4 .github/workflows/migration-fixer.yml
  10. +18 −14 .github/workflows/test.yml
  11. +6 −4 .github/workflows/update-doc-assets.yml
  12. +2 −0 .gitignore
  13. +6 −6 .pre-commit-config.yaml
  14. +294 −4 CHANGELOG.md
  15. +2 −2 MANIFEST.in
  16. +4 −4 Makefile
  17. +73 −235 README.md
  18. +294 −4 docs/CHANGELOG.md
  19. +73 −235 docs/README.md
  20. +13 −18 docs/_sidebar.md
  21. +1 −1 model_clone/__init__.py
  22. +3 −3 model_clone/admin.py
  23. +92 −38 model_clone/mixin.py
  24. +4 −0 model_clone/signals.py
  25. +104 −14 model_clone/tests/test_clone_mixin.py
  26. +38 −0 model_clone/tests/test_clone_signals.py
  27. +37 −2 model_clone/utils.py
  28. +1 −1 renovate.json
  29. +7 −13 requirements.txt
  30. +1 −0 sample/__init__.py
  31. +0 −1 sample/admin.py
  32. +4 −0 sample/apps.py
  33. +0 −1 sample/migrations/0001_initial.py
  34. +0 −1 sample/migrations/0002_library.py
  35. +0 −1 sample/migrations/0003_book_created_at.py
  36. +0 −1 sample/migrations/0004_auto_20191122_0848.py
  37. +0 −1 sample/migrations/0005_page.py
  38. +0 −1 sample/migrations/0006_assignment.py
  39. +0 −1 sample/migrations/0007_auto_20200829_0213.py
  40. +0 −1 sample/migrations/0008_page_created_at.py
  41. +0 −1 sample/migrations/0009_auto_20210407_1546.py
  42. +0 −1 sample/migrations/0010_furniture_house_room.py
  43. +0 −1 sample/migrations/0011_auto_20210414_1744.py
  44. +0 −1 sample/migrations/0012_backcover_cover.py
  45. +0 −1 sample/migrations/0013_edition.py
  46. +0 −1 sample/migrations/0014_auto_20210422_1449.py
  47. +0 −1 sample/migrations/0015_auto_20210423_0935.py
  48. +0 −1 sample/migrations/0016_product.py
  49. +0 −1 sample/migrations/0017_auto_20210624_1117.py
  50. +0 −1 sample/migrations/0018_auto_20210628_2301.py
  51. +0 −1 sample/migrations/0019_saletag_sale_tag_unique_name.py
  52. +0 −1 sample/migrations/0020_auto_20210717_2230.py
  53. +0 −1 sample/migrations/0021_book_custom_slug.py
  54. +0 −1 sample/migrations/0022_ending_sentence.py
  55. +0 −1 sample/migrations/0023_alter_edition_book.py
  56. +0 −1 sample/migrations/0024_alter_edition_book.py
  57. +0 −1 sample/migrations/0025_auto_20221029_0402.py
  58. +0 −5 sample/models.py
  59. +18 −0 sample/signals.py
  60. +8 −0 sample_assignment/admin.py
  61. +0 −1 sample_assignment/migrations/0001_initial.py
  62. +0 −1 sample_assignment/migrations/0002_alter_contract_id.py
  63. +3 −0 sample_assignment/models.py
  64. +0 −1 sample_company/migrations/0001_initial.py
  65. +0 −1 sample_company/migrations/0002_alter_companydepot_id.py
  66. +0 −1 sample_driver/migrations/0001_initial.py
  67. +0 −1 sample_driver/migrations/0002_alter_driver_id.py
  68. +32 −0 sample_driver/migrations/0003_driverflag_driver_flags.py
  69. +10 −0 sample_driver/models.py
  70. +11 −4 setup.py
  71. +7 −5 tox.ini
26 changes: 24 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -53,7 +53,9 @@
"contributions": [
"code",
"bug",
"test"
"test",
"doc",
"maintenance"
]
},
{
@@ -87,12 +89,32 @@
"bug",
"test"
]
},
{
"login": "erictheise",
"name": "Eric Theise",
"avatar_url": "https://avatars.githubusercontent.com/u/317680?v=4",
"profile": "https://erictheise.com/",
"contributions": [
"doc"
]
},
{
"login": "DanielSchaffer",
"name": "Daniel Schaffer",
"avatar_url": "https://avatars.githubusercontent.com/u/334487?v=4",
"profile": "https://github.com/DanielSchaffer",
"contributions": [
"code",
"test"
]
}
],
"contributorsPerLine": 7,
"projectName": "django-clone",
"projectOwner": "tj-django",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
"skipCi": true,
"commitConvention": "angular"
}
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.0.0
current_version = 5.3.3
commit = True
tag = False

20 changes: 0 additions & 20 deletions .github/dependabot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -31,6 +31,6 @@ jobs:
github.actor == 'pre-commit-ci[bot]'
)
steps:
- uses: hmarr/auto-approve-action@v2
- uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.PAT_TOKEN }}
53 changes: 33 additions & 20 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
name: automerge
name: Auto-merge
on:
check_suite:
types:
- completed
pull_request_target:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
automerge:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: |
(
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
steps.metadata.outputs.update-type == 'version-update:semver-patch'
)
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.PAT_TOKEN}}
pre-commit-ci:
runs-on: ubuntu-latest
if: |
github.actor == 'dependabot[bot]' ||
github.actor == 'dependabot' ||
github.actor == 'dependabot-preview[bot]' ||
github.actor == 'dependabot-preview' ||
github.actor == 'renovate[bot]' ||
github.actor == 'renovate'
if: ${{ github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
steps:
- name: automerge
uses: pascalgn/automerge-action@v0.15.5
- name: Enable auto-merge for Pre-commit PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
MERGE_METHOD: "rebase"
UPDATE_METHOD: "rebase"
MERGE_RETRIES: "6"
MERGE_RETRY_SLEEP: "100000"
MERGE_LABELS: ""
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.PAT_TOKEN}}
6 changes: 3 additions & 3 deletions .github/workflows/codacy-analysis.yml
Original file line number Diff line number Diff line change
@@ -24,11 +24,11 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@v4.2.0
uses: codacy/codacy-analysis-cli-action@v4.4.5
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
@@ -44,6 +44,6 @@ jobs:

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -8,16 +8,16 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0

- name: Run semver-diff
id: semver-diff
uses: tj-actions/semver-diff@v2.1.0
uses: tj-actions/semver-diff@v3.0.1

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.7.x'

@@ -44,10 +44,10 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

- name: Generate CHANGELOG
uses: tj-actions/github-changelog-generator@v1.15
uses: tj-actions/github-changelog-generator@v1.20

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v7
with:
base: "main"
title: "Upgraded ${{ steps.semver-diff.outputs.old_version }} → ${{ steps.semver-diff.outputs.new_version }}"
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -9,12 +9,12 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Deploy
uses: peaceiris/actions-gh-pages@v3.9.0
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
10 changes: 6 additions & 4 deletions .github/workflows/migration-fixer.yml
Original file line number Diff line number Diff line change
@@ -9,15 +9,17 @@ jobs:
fix-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.6.x'
python-version: '3.7.x'
cache: 'pip'
cache-dependency-path: '**/requirements.txt'

- name: Install dependencies
run: |
@@ -27,7 +29,7 @@ jobs:
uses: tj-django/django-migration-fixer@v1.3.6

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v12
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
32 changes: 18 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
paths:
- '**'

jobs:
@@ -21,26 +22,29 @@ jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: true
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, '3.10.0-beta.1']
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
exclude:
- platform: macos-latest
python-version: 3.11
- platform: macos-latest
python-version: 3.7
- platform: windows-latest
python-version: 3.11
- platform: ubuntu-latest
python-version: 3.7

steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3.0.11
id: pip-cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
cache: 'pip'
cache-dependency-path: '**/requirements.txt'

- name: Install dependencies
run: |
@@ -53,8 +57,8 @@ jobs:
PLATFORM: ${{ matrix.platform }}

- name: "Upload coverage to Codecov"
if: ${{ runner.os }} == "Linux"
uses: codecov/codecov-action@v3.1.1
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.9' }}
uses: codecov/codecov-action@v5.1.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
10 changes: 6 additions & 4 deletions .github/workflows/update-doc-assets.yml
Original file line number Diff line number Diff line change
@@ -9,15 +9,15 @@ jobs:
sync-doc-assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Run test
uses: tj-actions/remark@v3

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v12
uses: tj-actions/verify-changed-files@v20
id: verify_changed_files
with:
files: |
@@ -31,9 +31,10 @@ jobs:
- name: Create Pull Request
if: failure()
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v7
with:
base: "main"
labels: merge when passing
title: "Updated README.md"
branch: "chore/update-readme"
commit-message: "Updated README.md"
@@ -47,12 +48,13 @@ jobs:
cp -f *.png docs
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.2.0
uses: peter-evans/create-pull-request@v7.0.6
with:
commit-message: Synced README changes to docs
committer: github-actions[bot] <github-actions[bot]@users.noreply@github.com>
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
branch: chore/update-docs
labels: merge when passing
base: main
delete-branch: true
title: Updated docs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -143,3 +143,5 @@ cython_debug/

# Test Results
test-reports/

.DS_Store
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
repos:
- repo: https://github.com/PyCQA/autoflake
rev: v1.7.7
rev: v2.3.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^docs/.*|.*.md
- id: end-of-file-fixer
exclude: ^docs/.*|.*.md

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.10.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.17.0
rev: v1.35.1
hooks:
- id: yamllint
args: ["-d", "relaxed"]

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 7.1.1
hooks:
- id: flake8
Loading