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

ModelResource generates CharField for BigAutoField #1620

Open
TDaulat opened this issue Feb 24, 2021 · 0 comments
Open

ModelResource generates CharField for BigAutoField #1620

TDaulat opened this issue Feb 24, 2021 · 0 comments

Comments

@TDaulat
Copy link
Contributor

TDaulat commented Feb 24, 2021

Summary

Django models using models.BigAutoField will have a CharField generated by ModelResource instead of expected IntegerField

Details

The following line in the ModelResource class is the culprit:

https://github.com/django-tastypie/django-tastypie/blob/master/tastypie/resources.py#L1913

The following change is proposed:

- elif internal_type in ('IntegerField', 'PositiveIntegerField', 'PositiveSmallIntegerField', 'SmallIntegerField', 'AutoField', 'BigIntegerField'):
+ elif internal_type in ('IntegerField', 'PositiveIntegerField', 'PositiveSmallIntegerField', 'SmallIntegerField', 'AutoField', 'BigIntegerField','BigAutoField'):

PR: #1621

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

No branches or pull requests

1 participant