Система запроса запроса на обслуживание была в режиме реального времени, но теперь мы хотели бы отредактировать свойства, связанные с типом объекта запроса (requesttype). Когда я изменить строку:Изменение свойств объекта в Google App Engine
requesttype = db.StringProperty(verbose_name="Request Type*",choices=(["Bulky Item Disposal","Carpentry","Ceiling,Doors","Electrical","Elevator","Fire Equipment","Groundskeeping","Hazardous Waste","HVAC","Kitchen Equipment","Lighting,Painting","Plumbing","Recycling","Refrigeration","Too Cold","Too Hot","Trash","Vehicle Maintenance","Water Leak","Windows","Other"]))
К
requesttype = db.StringProperty(verbose_name="Request Type*",choices=(["Bulky Item Disposal","Carpentry","Ceiling","Doors","Electrical","Elevator","Fire Equipment","Groundskeeping","Hazardous Waste","HVAC","Kitchen Equipment","Lighting","Locksmith","Painting","Plumbing","Recycling","Refrigeration","Too Cold","Too Hot","Trash","Vehicle Maintenance","Water Leak","Windows","Other"]))
Я дал следующее сообщение об ошибке в журнале;
Property requesttype is u'Ceiling,Doors'; must be one of ['Bulky Item Disposal', 'Carpentry', 'Ceiling', 'Doors', 'Electrical', 'Elevator', 'Fire Equipment', 'Groundskeeping', 'Hazardous Waste', 'HVAC', 'Kitchen Equipment', 'Lighting', 'Locksmith', 'Painting', 'Plumbing', 'Recycling', 'Refrigeration', 'Too Cold', 'Too Hot', 'Trash', 'Vehicle Maintenance', 'Water Leak', 'Windows', 'Other']
Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "/base/data/home/apps/s~mma-facreq/6.372062129927600214/main.py", line 158, in get
self.response.out.write(template.render(template_values))
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/jinja2-2.6/jinja2/environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "/base/data/home/apps/s~mma-facreq/6.372062129927600214/html/manage.html", line 1, in top-level template code
{% extends "html/base.html" %}
File "/base/data/home/apps/s~mma-facreq/6.372062129927600214/html/base.html", line 41, in top-level template code
{% block content %}{% endblock %}
File "/base/data/home/apps/s~mma-facreq/6.372062129927600214/html/manage.html", line 14, in block "content"
{% for x in reqs %}
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 2326, in next
return self.__model_class.from_entity(self.__iterator.next())
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 1438, in from_entity
return cls(None, _from_entity=entity, **entity_values)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 970, in __init__
prop.__set__(self, value)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 614, in __set__
value = self.validate(value)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 2841, in validate
value = super(StringProperty, self).validate(value)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 646, in validate
(self.name, value, self.choices))
BadValueError: Property requesttype is u'Ceiling,Doors'; must be one of ['Bulky Item Disposal', 'Carpentry', 'Ceiling', 'Doors', 'Electrical', 'Elevator', 'Fire Equipment', 'Groundskeeping', 'Hazardous Waste', 'HVAC', 'Kitchen Equipment', 'Lighting', 'Locksmith', 'Painting', 'Plumbing', 'Recycling', 'Refrigeration', 'Too Cold', 'Too Hot', 'Trash', 'Vehicle Maintenance', 'Water Leak', 'Windows', 'Other']
Не могли бы вы предоставить код, используемый для изменения свойств, связанных с объектом запроса. – Totem