Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jedie committed Jun 17, 2015
1 parent af613dd commit fbcfc15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions dbpreferences/fields.py
Expand Up @@ -92,6 +92,9 @@ class DictModelField(models.Field):
A dict field.
Stores a python dict into a text field.
FIXME: Will not work with .values(...), because of:
https://code.djangoproject.com/ticket/9619
https://docs.djangoproject.com/en/1.8/howto/custom-model-fields/#converting-values-to-python-objects
>>> d=DictModelField().to_python('''{"foo":"bar"}''')
Expand Down
10 changes: 2 additions & 8 deletions tests/test_fields.py
Expand Up @@ -138,14 +138,8 @@ def test_get1(self): # FIXME: Will fail with Python 3, but works with Python 2 ?
@unittest.expectedFailure # FIXME!
def test_values(self):
"""
FIXME: queryset.values() will always return the string and not the dict.
if .values() used: Theses methods will be not called:
DictModelField.from_db_value()
DictModelField.to_python()
http://www.python-forum.de/viewtopic.php?f=7&t=36503 (de)
FIXME: Will fail, because of:
https://code.djangoproject.com/ticket/9619
"""
with self.assertNumQueries(2):
# with PrintQueries("test_values(): 2"):
Expand Down

0 comments on commit fbcfc15

Please sign in to comment.