[web2py] Re: Odd MySQL connection problem

2019-09-22 Thread backseat
Resolution, in case anyone else sees this: I had imported the database from our production system. The database includes a view. The database username, and thus the view creator name, are different on the production vs development system. That means the view is not visible to the MySQL user on

[web2py] Odd MySQL connection problem

2019-09-18 Thread backseat
I'm getting: ... File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler raise errorvalue OperationalError: (1045, "Access denied for user 'pytrack2'@'localhost' (using password: YES)") The password, user and database are accessible from the command

[web2py] Re: Select records NOT in a set

2019-09-16 Thread backseat
Fabulous. Thanks Massimo! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups

[web2py] Select records NOT in a set

2019-09-15 Thread backseat
I have a list of members that I want to schedule for certain duties. One table lists the people: db.define_table( 'members', Field('fullname', type='string', label='Name'), [...] ) I select members from that table according to certain criteria, but I want to not select them if they

[web2py] Re: Can't connect to MySQL

2019-09-10 Thread backseat
This code fails: uri = configuration.get('db.uri') print uri db = DAL(uri) The uri printed is: 'mysql://rota:rota@localhost/rota?set_encoding=utf8mb4' This code works: db = DAL('mysql://rota:rota@localhost/rota?set_encoding=utf8mb4') That's exactly the same URI (it was copy and pasted in

[web2py] Re: Can't connect to MySQL

2019-09-10 Thread backseat
> > MySQL is listening on the default port: > $ telnet localhost 3306 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. c 5.5.5-10.3.17-MariaDB-0+deb10u1�a3y(W]OS��-��5KZaY|$920;vmysql_native_password^CConnection closed by foreign host. -- Resources: -

[web2py] Can't connect to MySQL

2019-09-09 Thread backseat
I've just downloaded web2py 2.18.5 and set the MySQL URI as follows: uri = 'mysql://rota:rota@localhost/rota' Web2py gives: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. Traceback (most recent call last): File "/home/kae/web2py-2.18.5/gluon/restricted.py", line 219, in

[web2py] Running web2py in a container / Kubernetes

2019-07-11 Thread backseat
We're looking to move a web2py app to run in a container under Kubernetes. I'm interested in experiences of running web2py in a non-persistent container. In particular, how have people handled the app/databases directory? Thanks -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: How would I get a sum of virtual fields?

2018-03-08 Thread backseat
Thanks Anthony. It almost works (but it fails in an odd way). I was getting some odd results, and I've narrowed it down to this: In [10]: task_duration = (db.t_periods.f_end - db.t_periods.f_start) In [11]: results = db(query).select(p.id, p.f_start, p.f_end, task_duration ).as_list() In

[web2py] How would I get a sum of virtual fields?

2018-03-08 Thread backseat
OK, I know I can't get a sum of virtual fields, but here's what I'm trying to do: db.define_table( 't_periods', Field('f_start', type='datetime', label=T('Start time')), Field('f_end', type='datetime', label=T('End time')), Field('f_task', type='reference t_tasks',

[web2py] Re: Update form fields on submit

2017-10-16 Thread backseat
Thanks, Bernhard. The solution I ended up with is quite messy, but it does work: # Set defaults if request.get_vars: filter_bar.vars.from_date = datetime.datetime.strptime( request.get_vars.from_date, "%Y-%m-%d").date() filter_bar.vars.to_date =

[web2py] Update form fields on submit

2017-10-15 Thread backseat
I have a page that is a report, and at the top of that page is a form with a 'from' and 'to' date field so that the user can select the date range to report on. By default, the dates select and the first to the last of last month. That works fine. I want to add a combo that will allow the

Re: [web2py] Update hidden field / id for hidden field

2017-07-06 Thread backseat
You're right, of course.I, too, get frustrated by people asking the wrong question, and now I'm doing it... I have a form that requires a 'from_date' and a 'to_date', which is currently implemented using two fields. I like the idea of using the 'daterangepicker' tool, particularly the

[web2py] Update hidden field / id for hidden field

2017-07-06 Thread backseat
I want to use javascript to update a hidden field, but I can't find a way to give a hidden field an id which would make it much easier to update. SQLFORM.factory(..., hidden=dict(a="",b="")) will create the hidden fields, but not with an id. What's the best way to create non-database hidden

[web2py] DAL: why is "field == None" not "field is None"?

2017-01-04 Thread backseat
My PEP8 checker tells me that: db.table.field == None should be db.table.field is None But that doesn't evaluate correctly. Why? (I did search for this but couldn't find it discussed before: apologies if I missed it). Thanks -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Patch: LDAP AUTH TLS

2015-07-31 Thread backseat
I found that I was unable to authenticate to an OpenLDAP server running TLS on port 389 (which is the recommended way apparently). The following patch to ldap_auth.py fixes things for me; YMMV. Please add to upstream source if helpful. --- gluon/contrib/login_methods/ldap_auth.py.original

[web2py] Re: OpenLDAP and TLS auth example, please

2015-07-30 Thread backseat
Hmm, we may have an LDAP server issue. Ignore for now; sorry for the noise. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

[web2py] OpenLDAP and TLS auth example, please

2015-07-29 Thread backseat
Does anyone have an example of configuring an OpenLDAP TLS connection for authentication? I've tried: auth.settings.login_methods.append(ldap_auth( server='my.ldap.server', base_dn='ou=users,dc=my,dc=ldap,dc=server', secure=True, port=389, )) ...but that fails with Invalid

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-30 Thread backseat
Hi All Am I doing something wrong on this group? I've highlighted what looks like a bug to me, but I've had no response. Is this the wrong place to discuss what looks like a bug? Thanks Keith -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-30 Thread backseat
On Sunday, 30 March 2014 14:08:38 UTC+1, Anthony wrote: Would help to see the controller code. Here's the code from a test app I've put together to simplify: def index(): grid = SQLFORM.grid(db.t_dogs, create=True, csv=False,

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-26 Thread backseat
I have slightly more information now. Once the SQLFORM.grid 'Add' form is displayed, typing in the 'name' form does not call the echo() function. This seems like a bug to me. The echo() function is called as expected when the grid is shown, but not when the Add form is shown - but there is

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-25 Thread backseat
Bump...is is possible to use AJAX in a SQLFORM.grid Add form? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-17 Thread backseat
Thanks Derek, but I don't think that's it. The example in the book doesn't define a view for 'echo', and even I do define one that explicitly calls the grid view, the problem persists (is there a view for just the Add form?). -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-16 Thread backseat
Is it expected that AJAX can be used within the Add form of a SQLFORM.grid? If so, what am I doing wrong (or is it a bug)? Thanks, Keith -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Update textarea when dropdown changes

2014-03-13 Thread backseat
I did a pretty poor job of explaining my problem. I'll post again and try to make it clearer. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You

[web2py] How to use AJAX within a SQLFORM.grid 'add' form

2014-03-13 Thread backseat
My SQLFORM.grid is based on a table that includes a field defined as a textarea. When I add a new record using the grid 'Add' button, I want to update that textarea using AJAX. My test view looks like this: {{extend 'layout.html'}} h2{{=' '.join(x.capitalize() for x in

[web2py] Update textarea when dropdown changes

2014-03-12 Thread backseat
I have a db table, t_services, that includes: Field('f_service', type='string', label=T('Service')), Field('f_default_specification', type='text', label=T('Default specification')), Another table, t_line_items, includes: Field('f_service', type='reference

[web2py] SQLFORM.grid: search and links

2012-01-29 Thread backseat
I've a couple of questions about SQLFORM.grid: - Is it possible to position the buttons/links created by the 'links' argument somewhere other than the end of the row? It feels as if the 'fields' argument should be able to do this, but I can't see how. - Is it possible for the 'search' box to