Permalink
Browse files

Updated tastyhacks to work with django-tastypie 0.9.9. Closes #1.

  • Loading branch information...
onyxfish committed May 26, 2011
1 parent 481231d commit 76e1de88bbbd2bf2790f4e9003312436ee741f8f
View
@@ -0,0 +1,5 @@
+*.pyc
+*.swp
+.DS_Store
+MANIFEST
+dist
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
@@ -5,7 +5,6 @@
from django.db import models
from django.utils import simplejson as json
-
class ListField(models.TextField):
"""
Store a list of values in a Model field.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@
from django.utils import simplejson
from tastypie.bundle import Bundle
-from tastypie.fields import ApiField, CharField
+from tastypie.fields import ApiField, CharField, ListField
from tastypie.resources import ModelResource
from tastypie.utils import trailing_slash
@@ -55,6 +55,9 @@ def convert(self, value):
if value is None:
return None
+ if isinstance(value, dict):
+ return value
+
# Get ready-made geojson serialization and then convert it _back_ to a Python object
# so that Tastypie can serialize it as part of the bundle
return simplejson.loads(value.geojson)
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.

0 comments on commit 76e1de8

Please sign in to comment.