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

TBD: Return an existing Django type from get_internal_type #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blueyed
Copy link

@blueyed blueyed commented Mar 12, 2014

Please consider this pull request for discussion only.

btw: the tests passed before and after, although they should have failed before (for Django 1.7). I've thought that just a call to save() should have triggered an error.
Maybe it's related to sqlite being used, or because of TestModels being involved?!
(I could not get my hands on the durationfieldtest.db, even after commenting out "Destroying test database for alias ..." part from Django.

From the commit:
This is used in Django 1.7 migrations to derive the correct database
type from.

I cannot see, why "DurationField" should be returned here (added in
892b6e9).

This leaves db_type as-is, since it's used with older Django versions
and South probably.

Fixes #15.
Related Django ticket: https://code.djangoproject.com/ticket/22260

This is used in Django 1.7 migrations to derive the correct database
type from.

I cannot see, why "DurationField" should be returned here (added in
892b6e9).

This leaves `db_type` as-is, since it's used with older Django versions
and South probably.

Fixes johnpaulett#15.
Related Django ticket: https://code.djangoproject.com/ticket/22260
@blueyed
Copy link
Author

blueyed commented Mar 15, 2014

Since https://code.djangoproject.com/ticket/22260 got fixed by reverting the change to db_type's behavior.

Still, I think we should use a return value with get_internal_type that makes sense (AFAICS).

@johnpaulett
Copy link
Owner

I'm not 100% sure why we return a DurationField here (perhaps @poswald might recall). Perhaps South related?

Based upon the get_internal_type documentation, it does seem like we should return an existing Django type as you suggest.

@blueyed do you know if the change to BigIntegerField works when using pre-1.7 and South (I can test, but was wondering if you already had)?

@blueyed
Copy link
Author

blueyed commented Mar 15, 2014

@johnpaulett
No, I have not tested it.

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.

DurationField is not created in the database (Django 1.7)
2 participants