django-nonrel / djangotoolbox

Django tools for building nonrel backends
BSD 3-Clause "New" or "Revised" License
200 stars 125 forks source link

DatabaseError: Unsupported type for property : <class 'django.utils.safestring.SafeText'> #65

Open interpegasus opened 8 years ago

interpegasus commented 8 years ago

Hi, The server gets the following error after updating to the latest code in the master branch. Any ideas on how to fix it? Thanks

File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore.py", line 1766, in __setitem__
    datastore_types.ValidateProperty(' ', value)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore_types.py", line 1547, in ValidateProperty
    'Unsupported type for property %s: %s' % (name, v.__class__))
DatabaseError: Unsupported type for property  : <class 'django.utils.safestring.SafeText'>
interpegasus commented 8 years ago

Please let me know how to avoid reverting and using the latest code. During the meanwhile, reverting fixes the issue:

$ git checkout c216d135c3e4b5eb57c7cfb50b3711d7975d73c1

Thanks

kavdev commented 8 years ago

In that particular code fragment, the GAE plugin is doing some validation on the value and isn't accounting for SafeText. I'm guessing whatever app connects to GAE should be normalizing strings before sending them off.

Is that the full traceback? Are you using this engine? Note that per the new API changes in djangotoolbox 1.8, engine maintainers will probably need to make some changes before upgrading to the latest version.

kavdev commented 8 years ago

Any news?

interpegasus commented 8 years ago

@kavdev Thanks for your help.

Yes I am using the master branch of django app engine. I am also using django nonrel 1.6 and the master branch of all the other django relevant rerposiotires.

I would like to know if Is there a branch combination that I should try to make it work? Thanks.

kavdev commented 8 years ago

What version of Django are you running? The commit you mentioned on July 24th will work with Django < 1.8.

If you're trying to run Django 1.8, djangotoolbox won't work with djangoappengine at the moment. The maintainer of djangoappengine would need to fix the bug. I'd say make an issue on that package's page and provide this link: https://github.com/django-nonrel/djangotoolbox/issues/65#issuecomment-124947257

interpegasus commented 8 years ago

Thanks for the update. This issue is still present.

https://github.com/django-nonrel/djangoappengine/issues/108

A new issue has been created on djangoappengine