#5929: Allow Fields to use multiple db columns (complex datatypes)
----------------------------+-----------------------------------------------
Reporter: poelzi | Owner: nobody
Status: new | Component: Database wrapper
Version: other branch | Resolution:
Keywords: qs-rf | Stage: Design decision needed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------------+-----------------------------------------------
Changes (by poelzi):
* stage: Unreviewed => Design decision needed
Comment:
Let's see another example:
http://django-coordinatesfield.googlecode.com/svn/trunk/field.py
This Field is implemented as a Charfield which is actually not the right
datatype. The right datatype would be 2 or 3 float or decimal values or a
real geos point value.
First thing: I'm not sure if it is currently possible to fix the IP Model,
but currently the lookups only work if you filter trough the
NetworkAddress model itself, because it uses a special manager to rewrite
the simplified lookup methods into real ones. Becaus this is manager
specific, there is no way to make lookups through the normal ForeignKey
interface. So every lookups is specific for this model. Not good.
The NetworkAddress Model is quite complex, because it implements some
other required tools. But actually, the system uses ForeignKey relations
to this model that really only represents a simple IP without all the
blow, but blowing this table into a really hugh one. This is another
point: performance. If you have some models with only a view records that
has to be fast, and some with really many entries, lets say millions and
you have lookups to the ip field queries are much slower than real
implementations.
For me this is a point of clarity. A field implements a type of data,
which will be implemented in one way or the other depending on the
database backend used. Thats the sense of having a abstraction layer, and
if most or non of the databases don't have a type that fits, it's still
one field for me, even when the implementation of field uses more then one
db field to implement a the functionality as it should. A model represents
for me a more or less independent peace of informations that could be
referred to, but is not essentially coupled to. It's just, that i don't
feel like that it's right designed right in such cases :-)
--
Ticket URL: <http://code.djangoproject.com/ticket/5929#comment:2>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---