Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1307 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

[PATCH] turbojson.jsonify_sqlobject doesn't support InheritbleSQLObject.

Reported by: llucax Owned by:
Priority: high Milestone: 1.0.2
Component: unassigned Version: 1.0
Severity: normal Keywords: json jsonify sqlobject inheritance
Cc:

Description

I'm sorry if this is not the place to report this bug, but I can't find a TurboJson website.

turbojson.jsonify_sqlobject don't support InheritableSQLObject, it just jsonify the attributes from the derived class.

A simple patch that fixes this is attached, and a simple test case too.

The 'childName' stuff is a little ugly, but it's a SQLObject issue, it doesn't filter the childName from the columns and for the leaf object of the inheritance tree, obj.childName is broken, it raises an AttributeError: 'Derived2' object has no attribute '_SO_val_childName', so I guess I'll have to report that bug to SQLObject too ;)

Attachments

jsonify.py.inheritable-sqlobject.patch Download (811 bytes) - added by llucax 12 years ago.
Patch agains 1.0
jsonifytest.py Download (640 bytes) - added by llucax 12 years ago.
Testcase with a "deep" inheritance tree
jsonify.py.inheritable-sqlobject-0.8.patch Download (825 bytes) - added by llucax 12 years ago.
Patch against 1.0 for SQLObject > 0.8

Change History

Changed 12 years ago by llucax

Patch agains 1.0

Changed 12 years ago by llucax

Testcase with a "deep" inheritance tree

Changed 12 years ago by llucax

Patch against 1.0 for SQLObject > 0.8

comment:2 Changed 12 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

Applied at #2854. Thanks llucax :)

Alberto

Note: See TracTickets for help on using tickets.