4👍
✅
You should create custom field inhrited from Field or IntegerField
class BigintField(models.Field):
def db_type(self):
return 'BIGINT(20)'
...
and
class MyModel(models.Model):
bigid = BigintField()
- [Django]-Celery Beat sending tasks on startup (before the scheduled time)
- [Django]-Hue installation issue
2👍
Django ticket #399 deals with this. I also opened a similar question quite some time ago.
A workaround that I have used in the past is to simply ALTER
the field in question directly in the DB table to BIGINT
(for MySQL, for example). Note, however, that if you reset the application in which the particular model with the particular field exists, or drop the table and recreate it by any means, you will have to ALTER
the field again.
👤ayaz
- [Django]-Django+MySQL – "Authentication plugin 'caching_sha2_password' cannot be loaded"
- [Django]-Why do you need to use Django REST API?
- [Django]-Django template for loop and display first X matches
- [Django]-Adding new form fields dynamically in admin
0👍
For South users, django’s built-in DecimalField may work better than the custom BigintField approach above. Looks like it takes a bit of extra work to teach South about custom field types.
- [Django]-Remove decimal point from number passed to django template?
- [Django]-How to test celery with django on a windows machine
Source:stackexchange.com