Skip to content
This repository

Trying to fix deprecation warnings in Django 1.3 by adding "prepared" arg #14

wants to merge 1 commit into from

2 participants

Leeward Bound Brian Rosner
Leeward Bound
linked commented July 22, 2011

Trying to fix deprecation warnings in Django 1.3 by adding "prepared" argument to all get_db_prep_* methods
Note: I amended 3 method signatures to take a 'prepared=' argument, which defaults to None. Two of the methods use this method (in that it gets proxied to the super-method call), but for TimeZoneField::get_db_prep_save, the value of this param has no effect (I made no changes to actually use the parameter)

Thanks for the plugin, it's a huge help!

Brian Rosner

I don't see how this is needed. No where in Django 1.3 or dev (future 1.4) does get_db_prep_save take a prepared keyword argument. Can you be more specific?

Leeward Bound

been a long time since i touched this, i don't recall why it was necessary, but some portion of my stack required it. probably not worth merging to your trunk, i'll just continue using my own branch, thank you!

Leeward Bound linked closed this November 11, 2011
Brian Rosner

Ok, sounds good. If there is something you'd like to see fixed be sure to let me know :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jul 22, 2011
Leeward Bound Trying to fix deprecation warnings in Django 1.3 by adding "prepared"…
… argument to all get_db_prep_* methods
This page is out of date. Refresh to see the latest.

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

  1. 6  timezones/
6  timezones/
@@ -47,7 +47,7 @@ def get_prep_value(self, value):
47 47
             return smart_unicode(value)
48 48
         return value
49 49
-    def get_db_prep_save(self, value, connection=None):
+    def get_db_prep_save(self, value, connection=None, prepared=None):
51 51
52 52
         Prepares the given value for insertion into the database.
53 53
@@ -83,7 +83,7 @@ def formfield(self, **kwargs):
83 83
84 84
         return super(LocalizedDateTimeField, self).formfield(**defaults)
85 85
-    def get_db_prep_save(self, value, connection=None):
+    def get_db_prep_save(self, value, connection=None, prepared=None):
87 87
88 88
         Returns field's value prepared for saving into a database.
89 89
@@ -93,7 +93,7 @@ def get_db_prep_save(self, value, connection=None):
93 93
                 value = default_tz.localize(value)
94 94
95 95
                 value = value.astimezone(default_tz)
-        return super(LocalizedDateTimeField, self).get_db_prep_save(value, connection=connection)
+        return super(LocalizedDateTimeField, self).get_db_prep_save(value, connection=connection, prepared=prepared)
97 97
98 98
     def get_db_prep_lookup(self, lookup_type, value, connection=None, prepared=None):
99 99

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.