Re: Django 3.1 Makemigrations fails with FilePathField but succeeds with CharField

2021-06-27 Thread David Nugent
Hi Peter, I hope I can help. On Wed, Jun 23, 2021 at 1:50 PM Peter of the Norse wrote: > I think you might be better off using > https://docs.djangoproject.com/en/3.2/topics/migrations/#squashing-migrations > than > having it recreate all of them. > > On Mar 18, 2021, at 8:28 AM, Olivier wrote

Re: Django 3.1 Makemigrations fails with FilePathField but succeeds with CharField

2021-06-22 Thread Peter of the Norse
I think you might be better off using https://docs.djangoproject.com/en/3.2/topics/migrations/#squashing-migrations than having it recreate all of them. > On Mar 18, 2021, at 8:28 AM, Olivier wrote: > > Hello, >

Django 3.1 Makemigrations fails with FilePathField but succeeds with CharField

2021-03-18 Thread Olivier
Converting path from Pathlib to str, allowed makemigrations to pass, at the cost of having a single test to rewrite class Firmware(models.Model): filepath = models.FilePathField(path=str(settings.VENDOR_STATIC_ROOT), match=settings.FIRMWARE_REGEX, recursive=True) display_name = models.Ch

Django 3.1 Makemigrations fails with FilePathField but succeeds with CharField

2021-03-18 Thread Olivier
PS: In case the errors comes from the '/var/www/vhosts/foo/vendorstatic' value itself , may I add that VENDOR_STATIC_ROOT is defined in settings.py, with: from pathlib import Path BASE_DIR = Path(__file__).resolve(strict=True).parent.parent VENDOR_STATIC_ROOT = BASE_DIR / 'vendorstatic' and th

Django 3.1 Makemigrations fails with FilePathField but succeeds with CharField

2021-03-18 Thread Olivier
Hello, I've got a Django app which has over 200 migration steps. To shorten its test loading time, I'm trying to erase all current migrations and restart from scratch. I deteted and re-created my app Postgres database. I deleted all files (but __init__.py) in migrations directory. I typed "pytho