Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

use get_prep_save instead get_db_prep_save

  • Loading branch information...
commit 550883124b26ce6b83d7367f5168bd9f9f2d699c 1 parent c26ef2b
Bojan Mihelac authored December 20, 2010

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  django_extensions/db/fields/json.py
6  django_extensions/db/fields/json.py
@@ -69,12 +69,12 @@ def to_python(self, value):
69 69
         else:
70 70
             return value
71 71
 
72  
-    def get_db_prep_save(self, value):
  72
+    def get_prep_save(self, value):
73 73
         """Convert our JSON object to a string before we save"""
74 74
         if not value:
75  
-            return super(JSONField, self).get_db_prep_save("")
  75
+            return super(JSONField, self).get_prep_save("")
76 76
         else:
77  
-            return super(JSONField, self).get_db_prep_save(dumps(value))
  77
+            return super(JSONField, self).get_prep_save(dumps(value))
78 78
 
79 79
     def south_field_triple(self):
80 80
         "Returns a suitable description of this field for South."

2 notes on commit 5508831

trbs

Is does not read like this patch is safe for backwards compatibility right ?

Could you please change the patch to make it work on both Django pre 1.3 and trunk ?

Bojan Mihelac
Owner

get_prep_value is added in Django 1.2. indeed:
http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#converting-python-objects-to-query-values

Which one is current minimum django version for django-extension?

Please sign in to comment.
Something went wrong with that request. Please try again.