[web2py] Re: Running PyDAL from Python 3

2016-04-05 Thread Thomas Sitter
Looking into this further, it appears that pydal available on pypi is not Python 3 compatible (i.e. use of iteritems() rather than items() on a dict). Is there a Python 3 compatible version? On Tuesday, 5 April 2016 10:57:35 UTC-4, Thomas Sitter wrote: > > > Hello, > > I am tryi

[web2py] Running PyDAL from Python 3

2016-04-05 Thread Thomas Sitter
Hello, I am trying to use PyDAL from a Python 3 script. I pip installed it without issue but when attempting to open up an existing database (created with web2py running on Python 2.6) I get the following error: form pydal import DAL db = DAL('sqlite://sqlite.db', folder=db_path,

[web2py] Re: Edit layout of SQLFORM.grid (move Edit/View to left side of table)

2016-02-03 Thread Thomas Sitter
Sorry for the delayed response.. this works perfectly! On Wednesday, 27 January 2016 22:31:39 UTC-5, Anthony wrote: > > > SQLFORM.grid(..., buttons_placement='left') > > Anthony > > On Wednesday, January 27, 2016 at 9:18:16 PM UTC-5, Thomas Sitter wrote: >> >>

[web2py] Edit layout of SQLFORM.grid (move Edit/View to left side of table)

2016-01-27 Thread Thomas Sitter
Hello, I'm looking to move the Edit/View buttons of SQLFORM.grid to the left side of the table. I'm not sure where I should be looking to modify this. As a further complication, only one of our clients wishes for this to happen so it would be a change which on affects only one view of our

[web2py] Re: SQLFORM.grid with joined tables - choose which table to view/edit by default

2015-11-24 Thread Thomas Sitter
default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid > > -Jim > > > On Tuesday, November 24, 2015 at 12:30:35 PM UTC-6, Thomas Sitter wrote: >> >> Hello, >> >> I have two tables that I'd like to join in a SQLFORM.grid. When vie

[web2py] SQLFORM.grid with joined tables - choose which table to view/edit by default

2015-11-24 Thread Thomas Sitter
Hello, I have two tables that I'd like to join in a SQLFORM.grid. When viewing or editing an entry in the grid I'd like to edit the cheque table, but by default the customer table is selected. How can I change this? I've recreated the relevant code below. #db.py db.define_table('customer',

[web2py] Re: Add link to view a referenced table in SQLFORM.grid

2015-08-25 Thread Thomas Sitter
at 6:03:41 AM UTC-5, Thomas Sitter wrote: I have, but I run into one issue -- the link brings me to a list of records, but this is a 1-to-1 relationship so it will always be unnecessary to display the list. On Tuesday, 25 August 2015 02:26:14 UTC-4, Anthony wrote: Have you considered

[web2py] Re: Add link to view a referenced table in SQLFORM.grid

2015-08-25 Thread Thomas Sitter
I have, but I run into two issues. 1) I do not know how to specify a query in a smartgrid. 2) The link brings me to a list of records, but this is a 1-to-1 relationship so it will always be unnecessary to display the list. On Tuesday, 25 August 2015 02:26:14 UTC-4, Anthony wrote: Have you

[web2py] Add link to view a referenced table in SQLFORM.grid

2015-08-24 Thread Thomas Sitter
I have two tables that I'd like to link in SQLFORM.grid. db.define_table('customer', Field('firstname'), Field('lastname'), Field('account')) db.define_table('survey_data', Field('customer_id', 'reference customer'), Field('Q1'), Field('Q2'), Field('Q3')) In my SQLFORM I'd like to only

[web2py] Re: Will database callbacks be appended each time model is changed?

2015-07-30 Thread Thomas Sitter
to do after a database update. In fact, you need this to run on every request because it is part of the model definition (for the same reason you need to run the associated db.define_table() on every request). Anthony On Wednesday, July 29, 2015 at 10:59:59 PM UTC-4, Thomas Sitter wrote

[web2py] Re: Will database callbacks be appended each time model is changed?

2015-07-30 Thread Thomas Sitter
._after_update.append(myfunc) in two separate places. Anthony On Thursday, July 30, 2015 at 11:01:51 AM UTC-4, Thomas Sitter wrote: Sorry I should have clarified my question. The part I'm concerned about is the use of *append* when adding the callback. If append is being used is there any

[web2py] Will database callbacks be appended each time model is changed?

2015-07-29 Thread Thomas Sitter
Hello, I'm adding an _after_update callback to my table in db.py using: def myfunc(s,f): #do stuff return False db.tt._after_update.append(myfunc) My question is whether this will continuously append this method every time a database table is modified. I'm asking because I had a similar

Re: [web2py] Pass html in label of SQLFORM.factory Field without it by sanitized

2015-07-16 Thread Thomas Sitter
XML() worked perfectly (and good catch on 'recieve', I get that wrong every time :P) Thank you Massimo and Johann for the quick replies. On Thursday, 16 July 2015 04:00:21 UTC-4, Johann Spies wrote: Hello Thomas, It seems that the css for label anyhow uses a strong font so strong/strong

[web2py] Pass html in label of SQLFORM.factory Field without it by sanitized

2015-07-15 Thread Thomas Sitter
Hello, I am trying to pass HTML from my controller in a SQLFORM.factory but it keeps getting sanitized form = SQLFORM.factory( Field('install_consent', 'boolean', label='I consent for to provide my contact information to ___. strongI confirm that my house DOES NOT have aluminium

[web2py] Re: custom form validation doesn't work

2015-05-10 Thread Thomas Sitter
Hi Massimo, I am getting this same issue (onvalidation function not getting called), but I am use SQLFORM and not Crud so the solution posted does not apply to me. Has this been resolved elsewhere? Thanks. Tom On Saturday, 15 December 2012 18:27:51 UTC-5, jonas wrote: Hi. I have a

[web2py] SQLFORM displaying fields that are readable/writeable = false

2015-04-10 Thread Thomas Sitter
Hello, I have the following in my db.py file: db.define_table('customer', Field('firstname'), Field('lastname'), Field('account', unique=True, length=12), Field('email', unique=True, length=255), Field('phone', unique=True, length=255), Field('addr'), Field('city'), Field('postal'),