I also have this problem, I don't have any custom field and still see this 
error. 

I have completely remove all previous django, but after I install latest 
django 1.4.2, I can still find your function: get_db_prep_save appeared in  
/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py  
line 872. 

Are you sure your latest installation package completely remove the 
function?

Thank you

Felix Guo

On Sunday, April 8, 2012 1:31:17 PM UTC+10, Russell Keith-Magee wrote:
>
> Hi,
>
> What you've hit here is the end of the deprecation cycle for code that 
> doesn't support multiple databases.
>
> In Django 1.2, we introduced multiple database support; in order to 
> support this, the prototype for get_db_preb_lookup() and 
> get_db_prep_value() was changed.
>
> For backwards compatibility, we added a shim that would transparently 
> 'fix' these methods if they hadn't already been fixed by the developer.
>
> In Django 1.2, the usage of these shims raised a 
> PendingDeprecationWarning. In Django 1.3, they raised a DeprecationWarning.
>
> Under Django 1.4, the shim code was been removed -- so any code that 
> wasn't updated will now raise errors like the one you describe.
>
> All the core Django fields should have been updated to use the new 
> signature, so if you're seeing errors, it's probably because of a custom 
> field that you're using that needs to be updated. As far as I can make out, 
> Django's default ImageField shouldn't have this problem (it doesn't even 
> have db_prep_* methods, because there's nothing database specific about the 
> storage of FileFields).
>
> If you can reproduce this on a project that only uses Django's built-in 
> field types, then this is a bug in Django that needs to be addressed.
>
> Yours
> Russ Magee %-)
>
>
> On Saturday, 7 April 2012 at 12:03 PM, xthepoet wrote:
>
> > This was working fine for my Ubuntu 10.04LTE system with Django
> > 1.3.1. It seems broken now in 1.4.
> > 
> > In Django 1.4, I get this error TypeError: get_db_prep_value() got an
> > unexpected keyword argument 'connection' when saving an image to an
> > ImageField.
> > 
> > System (installed from Ubuntu Lucid repository packages):
> > Django 1.4
> > Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
> > 
> > The model field is defined as: origin_image =
> > models.ImageField(upload_to='images/origin')
> > The offending call is: obj.origin_image.save(fbFileName,
> > ContentFile(input_file.getvalue()))
> > 
> > Traceback (most recent call last):
> > File "/home/seeker/src/ceeq/seekerapp/management/commands/
> > addUser.py", line 100, in addPhotos
> > obj.origin_image.save(fbFileName,
> > ContentFile(input_file.getvalue()))
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/fields/files.py", line 95, in save
> > self.instance.save()
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/base.py", line 463, in save
> > self.save_base(using=using, force_insert=force_insert,
> > force_update=force_update)
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/base.py", line 551, in save_base
> > result = manager._insert([self], fields=fields,
> > return_id=update_pk, using=using, raw=raw)
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/manager.py", line 203, in _insert
> > return insert_query(self.model, objs, fields, **kwargs)
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/query.py", line 1576, in insert_query
> > return query.get_compiler(using=using).execute_sql(return_id)
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/sql/compiler.py", line 909, in execute_sql
> > for sql, params in self.as_sql():
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/sql/compiler.py", line 872, in as_sql
> > for obj in self.query.objs
> > File "/usr/local/lib/python2.6/dist-packages/Django-1.4-py2.6.egg/
> > django/db/models/fields/__init__.py", line 292, in get_db_prep_save
> > prepared=False)
> > TypeError: get_db_prep_value() got an unexpected keyword argument
> > 'connection'
> > 
> > This problem was also reported on the django-celery board:
> > https://github.com/ask/celery/issues/624
> > But I've realized that for me, it's not a celery issue.
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Django users" group.
> > To post to this group, send email to 
> > django...@googlegroups.com<javascript:>(mailto:
> django...@googlegroups.com <javascript:>).
> > To unsubscribe from this group, send email to 
> django-users...@googlegroups.com <javascript:> (mailto:
> django-users+unsubscr...@googlegroups.com <javascript:>).
> > For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> > 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/57cyUsdTJ6IJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to