dcorking / google-wave-resources

Automatically exported from code.google.com/p/google-wave-resources
0 stars 0 forks source link

Cannot delete form elements #704

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
BlipRefs#delete raises an error.

Code:
# Add a button
def on_blip_submitted(events, wavelet):
    reply_blip = events.blip.reply()
    reply_blip.append(element.Button('button', 'Button'))

# Delete the button (raise an error)
def on_form_button_clicked(events, wavelet):
    button_ref = events.blip.first(element.Button, name='button')
    button_ref.delete()

Trace:
<property object at 0x90e355db899a8c90> is not JSON serializable
Traceback (most recent call last):
  File 
"/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", 
line 512, in __call__
    handler.post(*groups)
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/appengine_robot_runner.py", line 
82, in post
    json_response = self._robot.process_events(json_body)
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/robot.py", line 365, in 
process_events
    return simplejson.dumps(pending_ops.serialize())
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/__init__.py", line 240, 
in dumps
    return _default_encoder.encode(obj)
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 211, 
in encode
    chunks = list(chunks)
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 439, 
in _iterencode
    for chunk in _iterencode_list(o, _current_indent_level):
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 339, 
in _iterencode_list
    for chunk in chunks:
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 416, 
in _iterencode_dict
    for chunk in chunks:
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 416, 
in _iterencode_dict
    for chunk in chunks:
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 416, 
in _iterencode_dict
    for chunk in chunks:
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 450, 
in _iterencode
    o = _default(o)
  File "/base/data/home/apps/beginners-guide-to-
wave/1.340845720078740027/waveapi/simplejson/encoder.py", line 185, 
in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <property object at 0x90e355db899a8c90> is not JSON 
serializable

Original issue reported on code.google.com by andy...@gmail.com on 28 Mar 2010 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by pamela.fox on 28 Mar 2010 at 7:47

GoogleCodeExporter commented 9 years ago
Just tested doing deleting buttons in the latest Python client library, and it 
seems 
to work. Can you grab the latest and try it out? (Revision24)

Original comment by pamela.fox on 31 Mar 2010 at 11:17

GoogleCodeExporter commented 9 years ago
Though the zipped version of the python client failed to delete elements, the 
svn-head version of it can success. 
Thanks.

Original comment by andy...@gmail.com on 1 Apr 2010 at 1:45