Floating type renderer?

3 views
Skip to first unread message

Andy Fundinger

unread,
Dec 4, 2008, 12:22:43 AM12/4/08
to forma...@googlegroups.com
I added a Float column to my database and it seems that FA has no idea what to do with it, the message I'm getting is:

TypeError: No renderer found for field Interval. Type Float(precision=10, asdecimal=False) as no default renderer at line 16 column 9 in file template_grid

Which is not a big surprise really given that there is no FloatRenderer, is there a simple workaround?  Can I force it to use Integer maybe?

- Andy Fundinger

--
Blog:  http://channel3b.wordpress.com
Second Life Name:  Ciemaar Flintoff

Watch out for the invisible man.

Gaël

unread,
Dec 4, 2008, 4:28:57 AM12/4/08
to FormAlchemy


On Dec 4, 6:22 am, "Andy Fundinger" <andr...@gmail.com> wrote:
> I added a Float column to my database and it seems that FA has no idea what
> to do with it, the message I'm getting is:
>
> TypeError: No renderer found for field Interval. Type Float(precision=10,
> asdecimal=False) as no default renderer at line 16 column 9 in file
> template_grid
>
> Which is not a big surprise really given that there is no FloatRenderer, is
> there a simple workaround?  Can I force it to use Integer maybe?

Try it out. There is a way to set default renderer for a specific
type:
http://docs.formalchemy.org/fields.html#custom-renderer

Something like this should work:

FieldSet.default_renderers[sa.types.Float] = IntegerFieldRenderer

Andy Fundinger

unread,
Dec 4, 2008, 7:49:57 AM12/4/08
to forma...@googlegroups.com
That works great, can we get it into the main FA code?

Gaël

unread,
Dec 4, 2008, 7:54:33 AM12/4/08
to FormAlchemy


On Dec 4, 1:49 pm, "Andy Fundinger" <andr...@gmail.com> wrote:
> That works great, can we get it into the main FA code?
>
>

Well I think a better idea is to add a real FloatFieldRenderer :)

Jonathan Ellis

unread,
Dec 5, 2008, 10:53:49 PM12/5/08
to FormAlchemy
On Dec 4, 6:54 am, Gaël <gael.pasgrim...@gmail.com> wrote:
> On Dec 4, 1:49 pm, "Andy Fundinger" <andr...@gmail.com> wrote:
>
> > That works great, can we get it into the main FA code?
>
> Well I think a better idea is to add a real FloatFieldRenderer :)

Added in r607.

-Jonathan
Reply all
Reply to author
Forward
0 new messages