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

Postgres's InetAddressField #20

Open
JasperWallace opened this issue Nov 10, 2020 · 3 comments
Open

Postgres's InetAddressField #20

JasperWallace opened this issue Nov 10, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@JasperWallace
Copy link

Using DDB with a database with an InetAddressField prints:

DDB: FBReport.source_ip unsupported type InetAddressField

When the initial migration is run and on every url request.

@JasperWallace
Copy link
Author

After getting the model to be visible the fields contents are displayed and filtering gives isNull as an option, so DDB copes but dosn't have the nicer queries.

@tolomea
Copy link
Owner

tolomea commented Nov 11, 2020

Are they otherwise available in the ORM? If so you probably want to map a filter lookup, if not you might be able to hack it with a function subfield, similar to how the is_null subfield (as oppose to the filter lookup) is done.

For filter lookups you need a custom type in types.py (which is also where you can handle custom formatting). New lookups also need to be covered in orm_fields.py _get_django_lookup where the data browser lookup is mapped to the Django one.

For aggregates and functions it's all in orm_fields.py but you will still need a dedicated type in types.py because type subfields are currently overly bound to the types, aka I can't have different sets of subfields for the same type in different contexts.

For functions they are declared in _TYPE_FUNCTIONS and translated to django in _get_django_function. You can see the is_null thing I mentioned by looking for the IsNull function in that file.

For completeness aggregates are handled in a similar way with _TYPE_AGGREGATES and _get_django_aggregate.

@tolomea
Copy link
Owner

tolomea commented Nov 11, 2020

I want to make all of this more pluggable somehow, I also need to improve separation through here in as part of the whole sql alchemy thing.

@tolomea tolomea added the enhancement New feature or request label Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants