tickets: 5929
This data as json
id | created | changetime | last_pulled_from_trac | stage | status | component | type | severity | version | resolution | summary | description | owner | reporter | keywords | easy | has_patch | needs_better_patch | needs_tests | needs_docs | ui_ux |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5929 | 2007-11-12 23:00:59 | 2018-11-04 13:12:29 | 2022-03-06 03:35:46.980308 | Accepted | new | Database layer (models, ORM) | New feature | Normal | dev | Allow Fields to use multiple db columns (complex datatypes) | Currently it seems that it is not possible to have complex db filds. For example: [https://dev.leipzig.freifunk.net/trac/browser/ffsomething/branches/generic/apps/management/models.py Implementation of a IP model] which actually should be a field type not a model. The implementation is not clean, because foreign key lookups for example do not work. The model maps for example: {{{ NetworkAddress.objects.filter(ip__in="192.168.0.10/16") }}} into a complex query for a ip resisting in a network range. Due the fact that model fields can only map to one db column, many complex data types can't be implemented. For example a ipv6 ip address which is a 128 bit value can't be handled by most db implementations of integer fields, so it has to be expanded to multiple columns plus a additional netmask column. Using varchar doesn't work because there is no way to search for network ranges or IPs in ranges, etc... I think a field should be able to implement lookup mappings which can be overridden to implement complex datatypes as well as use multiple db fields. | poelzi | 0 | 0 | 0 | 0 | 0 | 0 |