Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@linked

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!

@brosner
Owner

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?

@linked

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!

@linked linked closed this
@brosner
Owner

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
Commits on Jul 22, 2011
  1. @linked

    Trying to fix deprecation warnings in Django 1.3 by adding "prepared"…

    linked authored
    … argument to all get_db_prep_* methods
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 timezones/fields.py
View
6 timezones/fields.py
@@ -47,7 +47,7 @@ def get_prep_value(self, value):
return smart_unicode(value)
return value
- def get_db_prep_save(self, value, connection=None):
+ def get_db_prep_save(self, value, connection=None, prepared=None):
"""
Prepares the given value for insertion into the database.
"""
@@ -83,7 +83,7 @@ def formfield(self, **kwargs):
defaults.update(kwargs)
return super(LocalizedDateTimeField, self).formfield(**defaults)
- def get_db_prep_save(self, value, connection=None):
+ def get_db_prep_save(self, value, connection=None, prepared=None):
"""
Returns field's value prepared for saving into a database.
"""
@@ -93,7 +93,7 @@ def get_db_prep_save(self, value, connection=None):
value = default_tz.localize(value)
else:
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)
def get_db_prep_lookup(self, lookup_type, value, connection=None, prepared=None):
"""
Something went wrong with that request. Please try again.