[web2py] Re: want to lookup a phone number in a db

2021-10-19 Thread A3
Thanks Jim, Didn't realize that it will retrieve all. Actually the database is not so big at the moment so I don't notice any performance problems. Better try your suggestions before it has grown to big. Cheers - A3 Op dinsdag 19 oktober 2021 om 16:50:13 UTC+2 schreef Jim S: > I don't th

[web2py] Re: want to lookup a phone number in a db

2021-10-19 Thread A3
Error: 'NoneType' object has no attribute '__getitem__' <https://www.ursadina.nl/admin/default/errors/gtd1#> The problem was that the field phonenumber could also be None. Solution: in the table definition :set default to "" and update all existing None values to "" Any other sugg

[web2py] Re: message in register form

2021-10-18 Thread A3
You can edit the view: default/user.html add some html code like you would do in a standard html doc Op maandag 11 oktober 2021 om 20:49:45 UTC+2 schreef lucas: > hello one and all, > > how can i add a simple message to the /user/register form? just plain > text with a link in there

[web2py] want to lookup a phone number in a db

2021-10-18 Thread A3
Want to lookup a phone number in a db table the value to lookup is e.g. caller = "+31123456789" Phone numbers in db field can contain + - . and also () and is not very consistent. could look like: phonenumber = "+31-(0)123 456 789" would like something:

[web2py] how to run a scheduler with virtualenv

2019-10-14 Thread A3
Currently I run Web2py using wsgi / Apache using virtualenv in the wsgihandler.py I also use a scheduler using web2py.py --nogui -K myap Sofar I didn't pay attention to the virtualenv as I didn't have any problems. Probably because the python version in the virtualenv is equal to the

[web2py] Re: STYLE() function has been changed in 2.17.2

2018-10-30 Thread A3
Python version 2.7.6 Op dinsdag 30 oktober 2018 20:28:53 UTC+1 schreef Dave S: > > > > On Tuesday, October 30, 2018 at 4:15:49 AM UTC-7, A3 wrote: >> >> I recently upgraded to 2.17.2 and now I noticed that some of my apps >> functions don't work anymore. >>

[web2py] STYLE() function has been changed in 2.17.2

2018-10-30 Thread A3
I recently upgraded to 2.17.2 and now I noticed that some of my apps functions don't work anymore. in the past I used e.g.: STYLE(XML('body {color: white}')) this caused an error: (Expected bytes) after removing XML() you can use STYLE('body {color: white}') but it gives the following output:

[web2py] Re: SQLFORM.grid selectable with multiple buttons behaves strange

2017-09-07 Thread A3
After researching the forum and other locations I found the following "solution": the raise HTTP(200) seems to break the running submit code. As suggested elsewhere the download should be invoked on another page. So first redirect and than start the download. I replaced: selectable =

[web2py] SQLFORM.grid selectable with multiple buttons behaves strange

2017-09-04 Thread A3
HTTP" part of the download see below. - I do not understand what happens after the raise HTTP. Can anybody help me with this? Thanks, A3 Here is a fragment of the code: @auth.requires_login() def view_report_simple(): qr = (db.reports.Customerid=="020030") fie

[web2py] Re: How can I union 2 different table datasets?

2017-04-25 Thread A3
Maybe you can use: db.define_table(‘animal’, Field('name', 'string', length=45), Field(‘age’, ‘integer’), Field(‘apt_time’,’datetime’) and then subclass: db.define_table(‘cat’, db.animal) and db.define_table(‘dog’, db.animal) and then query on db.animal ? -- Resources: -

[web2py] Re: force redirect after expiration login session expiration time

2017-04-25 Thread A3
Anthony your right, I was just looking in the wrong direction. What about something like: def index(): timeout = auth.settings.expiration return dict( timeout=timeout) or put the variable timeout in the layout directly to simplify. And in the layout var timeout = {{=timeout}};

[web2py] Re: force redirect after expiration login session expiration time

2017-04-24 Thread A3
Thanks, I thought there was a standard solution. I tried this: add this scrip to layout: var time = new Date().getTime(); $(document.body).bind("mousemove keypress", function(e) { time = new Date().getTime(); }); function refresh() { if(new

[web2py] force redirect after expiration login session expiration time

2017-04-21 Thread A3
Using auth and auth.settings.expiration the login expires correctly, when you refresh manually or click a button or menu it redirects to login. My problem is that the page last shown before it expired remains visible. There is no automatic redirecting just after the expiration time has passed.

[web2py] Re: how to get the id of the first row in sqlform.grid when it is loaded?

2017-04-07 Thread A3
> > I made following changes to make it work: > - When the fields rendered the first row is marked as topfield and stored in session.topfield - First time load or reload returns row.id = 0 and forces to row.id stored in session.topfield def view_report(): qry.reportnr.represent =

[web2py] how to get the id of the first row in sqlform.grid when it is loaded?

2017-03-27 Thread A3
I am using sqlform.grid, with links that show details in a div when clicked. here are some fragments of the code: def view_report(): qry.reportnr.represent = render_FIELD(qry.reportnr) fields = (qry.id,qry.detail, qry.reportnr,) grid = SQLFORM.grid(qr,fields =fields,

[web2py] Re: how to test if a controller function exists

2015-10-20 Thread A3
append(f.__name__) > return f > > component = Component() > > Then you would decorate components: > > @component > def component1(): > return dict() > > @component > def component2(): > return dict() > > Finally, wherever needed, check for a comp

[web2py] how to test if a controller function exists

2015-10-19 Thread A3
I want to be able to test if a certain function exists in a controller. (I am loading a component with help of another) controller: default.py def myfunction() return def mytest() if exists(myfunction()): do this. -- Resources: - http://web2py.com -

[web2py] Re: Simple Wiki Markmin Google docs viewer needs HTTPS

2015-10-07 Thread A3
he viewer is a google app and it does not share your > credentials. It wants the doc to be public. > > On Wednesday, 23 September 2015 08:50:35 UTC-5, A3 wrote: >> >> Hi Massimo: >> I tried it: browser is no longer complaining about mixed content but .. >> the viewer i

[web2py] auth.wiki markmin extra not working?

2015-09-24 Thread A3
I tried to extend the auth.wiki using the extra option but I cannot get it to work. I set auth.wiki(resolve=False) in the models and used the following controller: def index(): checked = lambda text: '%s' % text + ' ' return auth.wiki(render='markmin',extra=dict(checked=checked)) in a

[web2py] Re: auth.wiki markmin extra not working?

2015-09-24 Thread A3
I made a new application and only added the code to the index: and now it works. Then I tried to do the same in my earlier application. Replaced index: Replaced view/index Replaced model/db This had no effect. Op donderdag 24 september 2015 16:18:22 UTC+2 schreef Leonel Câmara: > > Do you

Re: [web2py] Re: SQLform grid custom function for delete

2015-09-23 Thread A3
explained here: https://groups.google.com/d/msg/web2py/asCPsD9UGb8/ksmYX0UjBx0J Op dinsdag 22 september 2015 04:22:39 UTC+2 schreef Yebach: > > Ok thanx. This worked. > > One more question. My SQLFORM.grid is not refreshed after callback. So > record stays there. HOw to do a grid refresh? > >

[web2py] Re: Simple Wiki Markmin Google docs viewer needs HTTPS

2015-09-23 Thread A3
lease try it. > > On Wednesday, 19 August 2015 16:39:14 UTC-5, A3 wrote: >> >> Hi, I tried to use the Simple Wiki and found the following problem: >> I uploaded an excel file in page media. >> On the wiki page I used the link to the uploaded file: >> @3/testexcel.xls >

[web2py] auth.wiki search generates error 'exceptions.AttributeError'

2015-09-14 Thread A3
Hi, I'm learning to use the auth.wiki and ran into the following problem: I tried the minimal example in the code: def index() return auth.wiki() I add a user Created a wikipage with a tag: mytag When I click the tag mytag or use the wiki menu search page it show me: Please note I'am using

[web2py] Re: Simple Wiki Markmin Google docs viewer needs HTTPS

2015-08-20 Thread A3
Also tried to force insecure: this shows me the HTML page in the box. -- 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] Simple Wiki Markmin Google docs viewer needs HTTPS

2015-08-19 Thread A3
Hi, I tried to use the Simple Wiki and found the following problem: I uploaded an excel file in page media. On the wiki page I used the link to the uploaded file: @3/testexcel.xls When i look at the page i get an empty square. I am using Chrome: when I inspect the element, is shows: Mixed