sprox and multi-column forms

15 views
Skip to first unread message

herb

unread,
Mar 19, 2011, 12:23:29 AM3/19/11
to TurboGears
I'm using sprox to build a form where I have lots of fields. I would
like to display those fields in two columns:

label1 field1 label4 field4

label2 field2 label5 field5

label3 field3 label 6 field6

Is there any simple way to do it?

Also, what is the best way to change the text in the label? Finally,
can you give me an example where I over-ride Sprox's choice of field
type and change its attributes?

Thanks,
Herb

Alessandro Molina

unread,
Mar 19, 2011, 10:44:58 AM3/19/11
to turbo...@googlegroups.com
On Sat, Mar 19, 2011 at 5:23 AM, herb <he...@orcatec.com> wrote:
> I'm using sprox to build a form where I have lots of fields.  I would
> like to display those fields in two columns:
>
> label1 field1            label4 field4
>
> label2 field2            label5 field5
>
> label3 field3            label 6 field6
>
> Is there any simple way to do it?
>

Uhm, I can't think of any quick way to do this apart using some CSS to
change positioning.

> Also, what is the best way to change the text in the label?  Finally,
> can you give me an example where I over-ride Sprox's choice of field
> type and change its attributes?
>

This is quite simple, you can put inside your form definition a field
with the same id of the field that you want to override.
This form for example overrides the "zone" field:

class EditSliceForm(EditableForm):
__model__ = Slice
__omit_fields__ = ['view_uid', 'content_uid', 'page_uid', 'view',
'slice_order', 'content']
__hide_fields__ = ['uid']
__field_order__ = ['uid']
__dropdown_field_names__ = {'page' : 'title'}
zone = SingleSelectField('zone', options=zip(acr_zones, acr_zones))

herb

unread,
Mar 20, 2011, 4:27:32 PM3/20/11
to TurboGears
Thanks.
Herb

On Mar 19, 7:44 am, Alessandro Molina <alessandro.mol...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages