MrLoick / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

New 1.3.1 breaks django smart_unicode? #258

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
My current app using app-engine patch doesn't save data, when deployed on GAE.
My model is:

class UsersCompetition(db.Model):
    user=db.ReferenceProperty(Person,required=True,
collection_name='user_competition_set')
    competition=db.ReferenceProperty(Competition, required=True)
    team=db.ReferenceProperty(Team,required=False)
    place_in_competition=db.IntegerProperty()

    class Meta:
        verbose_name = _('Person\'s competition')
        verbose_name_plural = _('Person\'s competitions')
    def __unicode__(self):
        return '%s - %s -%s' %
(unicode(self.user),unicode(self.team),unicode(self.place_in_competition)) 

And it suddenly stopped working.
I added unicode around strings as local server complained about
inability to translate from unicode to ascii. Currently local app
working fine on small test datacet, while deployed version refuses to
save any date without giving any error. I believe it save's but unable
to retrieve as I receive error below when I try to add new record
using admin interface. Any hints or workarounds will be welcomed as
our launch was planned today. I was using app-engine-patch-1.1RC

Exception in request:
Traceback (most recent call last):
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/core/handlers/base.py", line
92, in get_response
   response = callback(request, *callback_args, **callback_kwargs)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/contrib/admin/sites.py",
line 490, in root
   return self.model_page(request, *url.split('/', 2))
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/views/decorators/cache.py",
line 44, in _wrapped_view_func
   response = view_func(request, *args, **kwargs)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/contrib/admin/sites.py",
line 509, in model_page
   return admin_obj(request, rest_of_url)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/contrib/admin/options.py",
line 1093, in __call__
   return self.add_view(request)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/contrib/admin/options.py",
line 790, in add_view
   return self.render_change_form(request, context,
form_url=form_url, add=True)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/contrib/admin/options.py",
line 596, in render_change_form
   ], context, context_instance=context_instance)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/shortcuts/__init__.py", line
20, in render_to_response
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/loader.py", line
108, in render_to_string
   return t.render(context_instance)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
178, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
779, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
792, in render_node
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/loader_tags.py",
line 97, in render
   return compiled_parent.render(context)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
178, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
779, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
792, in render_node
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/loader_tags.py",
line 97, in render
   return compiled_parent.render(context)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
178, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
779, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
792, in render_node
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/loader_tags.py",
line 24, in render
   result = self.nodelist.render(context)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
779, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
792, in render_node
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/defaulttags.py",
line 155, in render
   nodelist.append(node.render(context))
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/loader_tags.py",
line 111, in render
   return self.template.render(context)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
178, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
779, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
792, in render_node
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/defaulttags.py",
line 155, in render
   nodelist.append(node.render(context))
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/defaulttags.py",
line 155, in render
   nodelist.append(node.render(context))
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/defaulttags.py",
line 244, in render
   return self.nodelist_false.render(context)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
779, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
792, in render_node
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
831, in render
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/template/__init__.py", line
811, in _render_value_in_context
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/utils/encoding.py", line 71,
in force_unicode
   s = unicode(s)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/forms.py", line 356,
in __unicode__
   return self.as_widget()
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/forms.py", line 391,
in as_widget
   return widget.render(name, data, attrs=attrs)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/contrib/admin/widgets.py",
line 229, in render
   output = [self.widget.render(name, value, *args, **kwargs)]
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/widgets.py", line 403,
in render
   options = self.render_options(choices, [value])
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/widgets.py", line 419,
in render_options
   for option_value, option_label in chain(self.choices, choices):
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/models.py", line 849,
in __iter__
   yield self.choice(obj)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/models.py", line 856,
in choice
   return (key, self.field.label_from_instance(obj))
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/forms/models.py", line 902,
in label_from_instance
   return smart_unicode(obj)
 File "/base/data/home/apps/onebookercontest/3.339822290994632267/
common/zip-packages/django-1.1.zip/django/utils/encoding.py", line 44,
in

Original issue reported on code.google.com by alex.mik...@gmail.com on 12 Feb 2010 at 8:40