Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecation fixes and changes to the admin#308

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ex5 wants to merge1 commit intodjango-background-tasks:master
base:master
Choose a base branch
Loading
fromex5:master

Conversation

@ex5
Copy link

@ex5ex5 commentedApr 30, 2025
edited
Loading

We've been usingbackground_tasks for some years, after having to fork it at some point due to it being incompatible with some Django version or some deprecation.
Over the years a few changes accumulated, and now that the project is actively maintained again, maybe those changes could be useful to someone else.
(Also, not having a fork and simply using the published package would be swell too.)

The changes consist of the following:

  1. RemovedInDjango40Warning:providing_args argument is deprecated (same asFix RemovedInDjango40Warning in signals.py #252);

  2. RemovedInDjango41Warning:default_app_config (same asUpdate __init__.py #284);

  3. Admin: filter by various fields;

  4. Admin: make error icon red when there isactually an error;
    There was some confusion around the green checkmark 🟢 ✔️ being displayed when there's an error, and a red 🔴 ✖️ cross displayed when it's actually business as usual:

    Firefox_Screenshot_2025-04-30T11-17-53 150Z

  5. Set default_auto_field on app level (same asExplicitly set default_auto_field. #302);

    This was necessary to avoid generating unexpected migrations
    in projects that have aDEFAULT_AUTO_FIELD that differs
    from data type of generatedid columns.

    E.g. ifdefault_auto_field is omitted here and
    DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' in a project'ssettings.py,
    thenmakemigrations will generate a migration that will attempt to
    changeid column to a new data type, recreating a table and copying
    its data, which is undesirable.

If the squashed PR is problematic, I could try splitting these into separate patches.

Upd: found existing PRs about the same deprecation fixes, but since they didn't get any attention, I'll leave this one as is for now.

    RemovedInDjango40Warning: providing_args argument is deprecatedhttps://docs.djangoproject.com/en/4.2/releases/4.0/#:~:text=providing_args%20argument%20for%20django.dispatch.Signal%20is%20removed.    RemovedInDjango41Warning: default_app_confighttps://docs.djangoproject.com/en/4.2/internals/deprecation/#:~:text=default_app_config%20module%20variable%20will%20be%20removed.    Admin: show creator in the task list    Admin: make error icon red when there is **actually** an error, not    the other way around    Set default_auto_field on app level        This is necessary to avoid generating unexpected migrations        in projects that have a `DEFAULT_AUTO_FIELD` that differs        from data type of generated `id` columns.        E.g. if `default_auto_field` is omitted here and        `DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'` in a project's `settings.py`,        then `makemigrations` will generate a migration that will attempt to        change `id` column to a new data type, recreating a table and copying        its data, which is undesirable.
@ex5ex5 marked this pull request as ready for reviewApril 30, 2025 11:26
@ex5ex5 changed the titleDeprecation warning and changes to the adminDeprecation fixes and changes to the adminApr 30, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@ex5

[8]ページ先頭

©2009-2025 Movatter.jp