django-oscar / django-oscar-api

RESTful JSON API for django-oscar
Other
369 stars 160 forks source link

Explicit default_auto_field. #326

Closed JulienPalard closed 2 weeks ago

JulienPalard commented 8 months ago

This is configurable since Django 3.2, which is already the required version for oscar-api.

see: https://docs.djangoproject.com/en/3.2/topics/db/models/#automatic-primary-key-fields

Explicitly telling which field to use if good, it avoids a supious migration like:

$ ./manage.py makemigrations
Migrations for 'oscarapi':
  /home/mdk/src/django-oscar/.venv/lib/python3.11/site-packages/oscarapi/migrations/0002_alter_apikey_id.py
    - Alter field id on apikey

notice the migration is created in the venv, in oscarapi tree, not in the user project, it won't work anyway.

JulienPalard commented 8 months ago

depends on: https://github.com/django-oscar/django-oscar-api/pull/327

specialunderwear commented 8 months ago

Hi please try and rebase to the main branch because your tests are failing because they miss the fixes in there @JulienPalard

JulienPalard commented 8 months ago

rebased.