1👍
✅
Something like this should get the correct answer:
from django.db import connection
for field in Model._meta._fields():
print field, field.db_type(connection)
which on sqlite3 should give you something like this for an IPAddressField:
<django.db.models.fields.IPAddressField object at 0x101520410> char(15)
or if you’re using multiple databases:
from django.db import connections
connection = connections['your_db_alias']
for field in Model._meta._fields():
print field, field.db_type(connection)
0👍
I think it’s just an varchar(15). The definition of IPAddressField() doesn’t change much of the normal Field behavior.
👤sa3m
- [Answer]-Tastypie FormValidation error message
- [Answer]-Commenting app for all other apps in Django
- [Answer]-Which is better practice, checking object exists in Manager or Method?
- [Answer]-Overriding model fields with Tastypie
- [Answer]-Angular JS bootstrapping app
Source:stackexchange.com