Re: [web2py] Programmatic forms, add_button, and button order

2013-09-25 Thread Warren Block
, Warren Block wrote: And it's only just now I realize that "months" is a set, not a list. Changing it to ['January', ...] solves the order. I'm still curious why add_button does not work with a simple FORM(), though. On Wed, 25 Sep 2013, Warren

Re: [web2py] Programmatic forms, add_button, and button order

2013-09-25 Thread Warren Block
And it's only just now I realize that "months" is a set, not a list. Changing it to ['January', ...] solves the order. I'm still curious why add_button does not work with a simple FORM(), though. On Wed, 25 Sep 2013, Warren Block wrote: This generates a random

Re: [web2py] Programmatic forms, add_button, and button order

2013-09-25 Thread Warren Block
et you manage buttons positions much more easilly then manipulate the generated form. Richard On Wed, Sep 25, 2013 at 1:17 PM, Warren Block wrote: Trying to generate a small form that is all buttons: def month-example:     months = {'January', 'February', &

[web2py] Programmatic forms, add_button, and button order

2013-09-25 Thread Warren Block
Trying to generate a small form that is all buttons: def month-example: months = {'January', 'February', 'March'} form = FORM() for month in months: # this fails form.add_button(month, URL(month)) return dict(form=form) This generates 'NoneType' object has no att

Re: [web2py] Re: Grid and mouseover/tooltips

2013-09-24 Thread Warren Block
Nice--that works great! On Tue, 24 Sep 2013, Niphlod wrote: alter the represent of the fields in the controller running the grid: it's the right tool for the job e.g. db.table.field.represent = lambda value, row : DIV("%s ..." % value[10], _title=value) On Tuesday, September 24, 2013 10:

[web2py] Grid and mouseover/tooltips

2013-09-24 Thread Warren Block
With some fields truncated in a grid, it would be nice to show the full value in a tooltip when the mouse is over it. Offhand, I think that will take a calculated field. Is there an example anywhere? For that matter, examples of general examples of grid use would be really nice. Thanks! --

Re: [web2py] Re: Grid title

2013-09-24 Thread Warren Block
Okay, that makes sense. I do intend to make custom views, even more so now. For now, default/index.html is just: {{extend 'layout.html'}} {{=grid}} Thanks! On Tue, 24 Sep 2013, Anthony wrote: Oops, sorry -- the default/index.html view that comes with the scaffolding app includes {{=BE

Re: [web2py] Re: Grid title

2013-09-24 Thread Warren Block
The default/index.html view exists (the default "simple app" one), so it's not clear to me why it is using generic.html. The index() function does not explicitly define any other variables, but the "grid:" is displayed even if the index() function returns dict(grid=grid). On Tue, 24 Sep 2013

[web2py] Grid title

2013-09-24 Thread Warren Block
On both 2.5.1 and 2.6.4, grids are rendered with the name of the variable visible. For example: def index(): grid = SQLFORM.grid(db.names, fields = [db.names.lastname, db.names.firstname]) return locals() On screen, this renders (roughly) as: grid : _ Search Clear

[web2py] PDF template examples

2013-09-20 Thread Warren Block
The live examples at https://code.google.com/p/pyfpdf/wiki/Web2Py fail and produce a ticket. The example code appears to use a template that is not actually shown, but it's hard to tell. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2

[web2py] write_html and fonts

2013-09-16 Thread Warren Block
An HTML table listing works great, done as shown here: http://code.google.com/p/pyfpdf/wiki/Web2Py Generating the PDF version also works, and the font face and size are controllable for headers and footers. How can the font attributes be set or overridden for the body of the listing? pdf.se

[web2py] Bootstrap--recovering horizontal space

2013-08-21 Thread Warren Block
I have a SQLFORM.grid that could use the full width of the screen. Turning off the sidebars in the view still leaves huge blank gaps to left and right. How can I recover that space? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To uns

Re: [web2py] Re: Ajax input masks

2013-08-20 Thread Warren Block
Thank you, I see what you are saying and will test the jQuery examples. Ideally, I'd like to predefine the validation code and just specify a mask when the field is declared in the Field statement (DRY). Then forms would inherit the value and use the appropriate jQuery code for those fields.

[web2py] Ajax input masks

2013-08-19 Thread Warren Block
Hello. I'm just starting to dig into web2py. One thing I really want is field input masks ala Visual Foxpro, to prevent users from entering invalid characters rather than validating afterwards and telling them they made a mistake. For example, if a user types alpha characters into a numeric-