Posted on Apr 27, 2009 by
Quick Bear
Support for composite types was added quite a while ago; unfortunately, the test case isn't quite right, so even though the tests pass, the code doesn't work.
In short, regarding the tests: for a composite type Point, which is used in a class called Vertex, the renderer should be called PointFieldRenderer, not VertexFieldRenderer, and should be added to FieldSet.default_renderers as FieldSet.default_renderers[Point] = PointFieldRenderer (otherwise, you could only have one composite renderer per class--what if there's another composite field type being used besides Point?).
The attached patch corrects the tests as well as Field.type in fields.py.
- composite_fix.diff 1.53KB
Comment #1
Posted on Apr 27, 2009 by Swift Dogcommitted. Thanks!
Status: Fixed