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

Make compatible with Django 1.7 migrations #17

Conversation

hheimbuerger
Copy link

Make the app Django 1.7 compatible and add support for the new migration system introduced in Django 1.7.

Builds on top of @anhtran's substantial initial work.

anhtran and others added 6 commits April 25, 2014 03:02
Explicitly set the TEST_RUNNER setting to silence an upgrade path warning about the default TEST_RUNNER having changed in 1.6. Explicitly set the fields of the test ModelForm, because not setting them is deprecated in Django 1.7.
Previously, migrations would be created with a byte string where all other fields use unicode strings. This has been fixed by following the example of the django.db.models.fields.Field base class and using force_text() on it.
Following the advice of @jaylett and also passing the default field through if it has been set by the user.

Tested manually with forward and backward migrations, and passes all existing unit tests, but lacking a new unit test for deconstruct().
This should also fix the error "ValueError: Cannot serialize: <class django.db.models.fields.NOT_PROVIDED at 0x02A0B768>" occuring when squashing migrations.
@hheimbuerger hheimbuerger changed the title Feature/django17 migrations compatibility Make compatible with Django 1.7 migrations Sep 9, 2014
@frewsxcv
Copy link

I have a fork available here that includes your commits. It's also available on PyPi.

@hheimbuerger
Copy link
Author

@frewsxcv I quite hate duplicate entries on PyPi. :) But thanks for picking this up, guess it's the only way right now!

@hheimbuerger
Copy link
Author

@mfogel Would you consider handing over the ownership of the django-timezone-field PyPi project? (Please not to me, though. ;) But I'd like it to survive.)

I think a 79 character line limit is horribly outdated in 2014 and I think this change reduces readability quite a lot, but the current TravisCI configuration enforces it, so fine...
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 919c507 on hheimbuerger:feature/django17-migrations-compatibility into * on mfogel:develop*.

@mfogel
Copy link
Owner

mfogel commented Sep 28, 2014

#12 has the most useful information on the actual problem here. django isn't able to serialize the pytz.timezone objects.

With the current set of kwargs, there's no need for a custom deconstruct() method. The parent already captures custom setting of the max_length and choices arguments in its deconstruct() method.

I'll attach more info on #12.

@mfogel mfogel closed this Sep 28, 2014
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.

None yet

5 participants