-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add deconstruct methods to fields with custom keywords #12
base: master
Are you sure you want to change the base?
Add deconstruct methods to fields with custom keywords #12
Conversation
Hi @elbaschid: I've been wanting to deep-dive into what I need to do in order to support Django 1.7, but you've beaten me to it, which I greatly appreciate. :) |
Great, thanks. |
Hey @elbaschid: This looks great, but lacks tests. Also, while it shouldn't block getting this in, obviously CompositeField probably needs to get a Edit: I've just created #14 for a CompositeField |
Also, add yourself to |
Thanks for the feedback. You are absolutely right, that there need to be tests. I'll put those in. Would you be happy with testing the |
Fields that are adding keyword arguments to custom fields require a ``deconstruct`` method to make the keywords available in the corresponding migration(s). The documentation for this can be found here: https://docs.djangoproject.com/en/dev/howto/custom-model-fields/#field-deconstruction
I've started adding some test for the
I've also changed the implementation of the |
Isolation is fine IMO. |
This looks like a typecasting problem. A few questions:
Original implementation. I want to follow how Django does things as much as possible, and they consider defaults to be sacrosanct once released into the wild. |
Thanks for the feedback. I've been a bit busy over the last few days and will be for the rest of the week. I'll update the PR as soon as I get some time and get back with some further details on some of your comments. |
Sounds good! :) |
Fields that are adding keyword arguments to custom fields require a
deconstruct
method to make the keywords available in the corresponding migration(s). The Django 1.7 documentation provides more details.Without the
deconstruct
method, the custom keywords are not added to the migrations and are therefore ignored when the migrations are run. In my case, the migrations failed becauseauto_add
was not set during the migrations of theUUIDField
.I have added
deconstruct
methods to thArrayField
,JSONField
andUUIDField
adding the custom keywords accordingly. Please take a look and let me know if you are happy with that or have any suggestions to improving it.Oh, and thanks for a great Django app 👍.