Skip to content
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

Better support for Django 3.2.* #209

Merged
merged 4 commits into from
Feb 16, 2022
Merged

Better support for Django 3.2.* #209

merged 4 commits into from
Feb 16, 2022

Conversation

sebastianclarke
Copy link
Contributor

What this PR does

The main purpose is to define the default_auto_field explicitly, in line with the 3.2 release notes here https://docs.djangoproject.com/en/4.0/releases/3.2/#customizing-type-of-auto-created-primary-keys

This prevents an extra migration being required in the event that this app is included in a project which defines a default_auto_field of anything other than 'django.db.models.AutoField'

Perhaps BigAutoField is a better choice here, in which case this app would need to be shipped with the supporting migration - I shall leave that up to the authors, but this should work as is, without changing any existing deployments.

Other changes are limited to strictly those required to support the unit tests passing locally, specifically:

  • Restrict supported Django versions in setup.py to <4 due to ugettext_lazy having apparently moved in 4.X and hence a failing import
  • Adding a dummy secret key to the testing config in runtests.py
  • Making the analogous change in the tests/apps.py for explicitly setting default_auto_field to suppress warnings during test running

…mport name 'ugettext_lazy' from 'django.utils.translation'"
…angoproject.com/en/4.0/releases/3.2/#customizing-type-of-auto-created-primary-keys

This prevents the app from requiring further migrations be generated post-install in deployment scenarios where the project including this app has specified a DEFAULT_AUTO_FIELD other than 'django.db.models.AutoField'
@dominno dominno merged commit d627820 into dominno:master Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants