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

GenericIPAddressField #237

Open
marquicus opened this issue Jan 2, 2020 · 1 comment
Open

GenericIPAddressField #237

marquicus opened this issue Jan 2, 2020 · 1 comment

Comments

@marquicus
Copy link

Hello
Where trying to render a table with a GenericIPAddressField, thank you in advance

File "/home/marp/.virtualenvs/nomconsole/lib/python3.6/site-packages/datatableview/datatables.py", line 164, in new
opts.processors, opts.unsortable_columns, opts.hidden_columns)
File "/home/marp/.virtualenvs/nomconsole/lib/python3.6/site-packages/datatableview/datatables.py", line 53, in columns_for_model
raise ColumnError("Unhandled model field %r." % (f,))
datatableview.exceptions.ColumnError: Unhandled model field <django.db.models.fields.GenericIPAddressField: ipaddr>.

@jiding-qd
Copy link
Contributor

Hi,

I think the fix is to modify columns.py, add GenericIPAddressField in handle_field_classes.

class TextColumn(Column):
model_field_class = models.CharField
handles_field_classes = [models.CharField, models.TextField, models.FileField,
models.GenericIPAddressField]

Kind Regards,

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

2 participants