SQLFORM.grid woes

32 views
Skip to first unread message

hvjunk

unread,
Jun 26, 2014, 6:16:01 AM6/26/14
to web...@googlegroups.com
Hi there,

 Yes I'm new to wep2py *and* to Python (other than having edited some Gentoo ebuilds many summers ago), but it was the advice for the simplest web framework to create simple input/edit functionality for a database to have customer details captured in a closed environment (ie. only trusted employees on the network and the office, and I mean trusted as in they all have all the access to all the paper and other files in the current environment)

 So, I have a SOLIDFORM for entry (though the table and row things doesn't work that great as I have 2/4/3/1/4/2/2/2/2 columns per row and spacing is off), and now I try to get a SQLFORM.grid going to list and edit the entries already inserted. I've also cleaned up the standard layout.html to only show what I need/want (like removing the auth links on the top right).

 Yesterday I had an hour to look at the buttons in SQLFORM.grid to edit their actions, but on first search only tried the links= which just add an extra link, not replaced/edit the buttons, which pointed me to the jquery etc. to be investigated, at which point I had to rush out for the rest of the day.

 This morning somethings broke... and yes, it *was* me, but I don't know where/what ;( (had too many customers telling me "I/we didn't do do nothing" and then I showed them what and then they remember something totally different):

1) The SQLFORM.grid nice and gray buttons disappeared, and they just show up as normal links, no javascript ;(
 Where do I start to find that problem/issue?

2) buttons_placement='yes' throws an error when included in the SQLFORM.grid parameter list:

Traceback (most recent call last):
File "/home/www-data/web2py/gluon/restricted.py", line 220, in restricted
exec ccode in environment
File "/home/www-data/web2py/applications/hvt/controllers/members.py", line 54, in <module>
File "/home/www-data/web2py/gluon/globals.py", line 385, in <lambda>
self._caller = lambda f: f()
File "/home/www-data/web2py/applications/hvt/controllers/members.py", line 50, in list
links=[lambda row: A('View',_href=URL('view',args=[grdb.clients,row.id]))]
TypeError: __call__() got an unexpected keyword argument 'buttons_placement'

def list():
grid = SQLFORM.grid(grdb.clients,
buttons_placement='left',
fields=[grdb.clients.id,grdb.clients.Surname,grdb.clients.Initials,grdb.clients.Email],
user_signature=False,
links=[lambda row: A('View',_href=URL('view',args=[grdb.clients,row.id]))]
)

What do I miss where?
Thanks for the help thus far

hvjunk

unread,
Jun 27, 2014, 4:43:42 AM6/27/14
to web...@googlegroups.com


On Thursday, June 26, 2014 12:16:01 PM UTC+2, hvjunk wrote:

 This morning somethings broke... and yes, it *was* me, but I don't know where/what ;( (had too many customers telling me "I/we didn't do do nothing" and then I showed them what and then they remember something totally different):

1) The SQLFORM.grid nice and gray buttons disappeared, and they just show up as normal links, no javascript ;(
 Where do I start to find that problem/issue?

2) buttons_placement='yes' throws an error when included in the SQLFORM.grid parameter list:
TypeError: __call__() got an unexpected keyword argument 'buttons_placement'


What do I miss where?
Thanks for the help thus far

Okay, fix this problem by uninstalling the Debian Wheezy gluon/web2py packages that somehow got called after an update/upgrade. Those are still 1.99.<something>.
Reply all
Reply to author
Forward
0 new messages