I can't find a description of idiomatic handling of a many:1 relation through a 
subform. Something like an asset database, where I have locations and assets, 
and when I'm looking at the form for a location, there are add and delete 
buttons and a list of the assets I can edit in that location. The idea would be 
that the user can add and remove to the list just within the browser, then the 
server parses that subform when it's submitted.

So two things:

1. How to pass a location which has attached assets to a template or 
ToscaWidgets, and have the subform generated with fields automatically 
sequentially numbered (so Rails would give the fields in the subform names like 
asset[1][name], asset[1][type], asset[2][name] etc and then parse those into an 
array that the controller receives when the form is submitted).
2. Write the controller to receive an array of subform values so it can process 
them. Ideally using tgext.crud.controller, although that probably doesn't 
matter.

I'm wanting both to display this as HTML forms, and also to use it for a REST 
API, so I'll want to know how the naming and parsing are done if that's 
documented anywhere, although I guess I can just look at what's generated and 
work it out if there's no documentation.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to