On Feb 5, 2010, at 4:40 PM, mdipierro wrote: > On Feb 5, 4:24 pm, Jonathan Lundell <jlund...@pobox.com> wrote: >> A couple of SQLFORM-related questions. >> >> 1. I'd like a wider string input field, and I'm not sure how to get it. >> Unless there's an easier way, I was thinking I'd extend the string widget to >> embed a size & maxlength. The manual mentions widget extension, but there's >> no example (only an example of writing a new one). >> >> So: how to extend the string widget? And how to invoke the existing string >> widget from FIELD with size/maxlength attributes? (And is there yet another >> method I'm overlooking?) > > in css > > #table_field { > width: 400px; > }
Well, yeah, but that's semantically different from setting size/maxlength on a text field. Can I pass the attributes to INPUT somehow? And how do you extend an existing widget? > >> >> 2. I have a table with a user ID, writable=False. In the SQLFORM, I'd like >> to display it as the user's name or email address instead of the bare ID. >> How? > > This should be automatica if the referenced table has a format > attribute. Else set something like I don't find "format attribute" in the manual. Should I be looking for something else? > > db.referenced_table.id.represent=lambda id: db.referenced_table. > [id].name -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.