-
Notifications
You must be signed in to change notification settings - Fork 142
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
DictionaryField does not call the get_prep_value method of VirtualField before saving to DB #123
Comments
This looks related to #114. |
Hi @ktosiek, what were you expecting exactly? Could you help me by giving me an example with:
I'm trying to replicate the behaviour you mentioned but I don't notice anything strange, so I need your help to replicate your use case. |
I've made a repo with an example: https://github.com/ktosiek/django-hstore-issue-123-example. model data: https://github.com/ktosiek/django-hstore-issue-123-example/blob/master/example/example/models.py and https://github.com/ktosiek/django-hstore-issue-123-example/blob/master/example/example/fields.py |
hey @ktosiek, what about adapting a simplified version of those tests into django_hstore? |
It would make more sense, yes :-) |
PS: see also this section of the docs: http://djangonauts.github.io/django-hstore/#_developers_guide |
I don't see any relation with #114. |
I have a custom field that uses to_python/get_prep_value to (de)serialize a custom object.
Something like
HandField
from https://docs.djangoproject.com/en/1.8/howto/custom-model-fields/.When I'm using that field in
hstore.DictionaryField
schema my object is cast to string which is not a sensible representation. I was expectingDictionaryField
to clean values withget_prep_value
before casting them to strings.The text was updated successfully, but these errors were encountered: