I have a db.models.Field subclass that needs a special representation in 
the database. This is achieved by implementing get_db_prep_save() and 
using SubfieldBase as the metaclass, and works fine.

The problem comes when serializing, the custom field is serialized using 
the python's form string representation of the data. I tried to 
implement flatten_data() in the custom field, as it seems [1] to be the 
serialization counterpart of get_db_prep_save(), but the method is not 
called.

Strangely if I don't use SubfieldBase as the metaclass, flatten_data() 
is called and the data is correctly serialized, but then the database 
part is broken ...

Am I doing something wrong ?

[1] 
http://www.djangoproject.com/documentation/custom_model_fields/#flatten-data-self-follow-obj-none

--Luper

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to