[web2py] admin table query focus

2024-04-23 Thread Dave S
I've long been bugged by going through the appadmin controller to do 
database maintenance and not having the focus be anywhere useful.  I think 
I even have a comment about that somewhere in the forum.

I finally figured out a way to fix that ... the following change puts the 
focus on the query box of the table admin form.  Line numbers are from the 
2.22.5 release, but should be close for other recent versions.

File:  .../web2py/applications/myapp/*controllers/appadmin.py:*
lines 226-230 before:
form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
_name='query', _value=request.vars.query or '', 
_class='form-control',
requires=IS_NOT_EMPTY(
error_message=T('Cannot be empty', TR(T('Update:'),
INPUT(_name='update_check', _type='checkbox',

lines 226-231 now:
form = FORM(TABLE(TR(T('Query:'), '', INPUT(_style='width:400px',
_name='query', _value=request.vars.query or '', 
_class='form-control',
requires=IS_NOT_EMPTY(
error_message=T('Cannot be empty')), 
_autofocus="autofocus")),TR(T('Update:'),

INPUT(_name='update_check', _type='checkbox',
value=False), INPUT(_style='width:400px',

Note that this is really one big line ... I didn't spend a lot time trying 
to add escapes to unwrap and reformat the long worm.

I find this little change really helps my work flow on the app where I use 
appadmin the most.  You may, of course, prefer to add a task-specific 
controller elsewhere in the app or in a script, but appadmin queries are 
fairly flexible, and that's often where I figure out what the task-specific 
details are.

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/63c14f6c-93a5-4d4f-937c-5f4d64247c95n%40googlegroups.com.


[web2py] Re: web2py website

2024-02-29 Thread Dave S

On Wednesday, February 21, 2024 at 11:29:07 AM UTC-8 syna...@gmail.com 
wrote:

Will the web2py website be getting a refresh anytime? That award badge - 
it's from 14 years ago.


web2py is in maintenance mode.  Spiffing up the website  isn't an important 
sales tool.  Here's hoping py4web gets some new award badges as it takes 
over the world.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fda20135-7b2e-454e-aa10-b6600df4275dn%40googlegroups.com.


[web2py] Re: 2.19.0 vs 2.27.1

2024-02-29 Thread Dave S
On Monday, February 12, 2024 at 8:12:05 AM UTC-8 gaelpri...@gmail.com wrote:

Hello everybody.

I've actually some instances of web2py running with the 2.19.0 version.
0 problems, thank you web2py.

One of these is this one:
https://www.hydrover.it/ 

It uses the web2py grid, Bootstrap 2.3.2.

I must install a new web2py instance, where I'll copy the 
https://www.hydrover.it/  app, that'll be modified for fitting to another 
company.

Can I use the 2.27.1 without problems?

Thanks.



Backward compatibility is still quite good.  If you've already changed over 
to Python 3.x, you're probably in good shape.  Caveat:  I'm still on 
2.22.5., I use SQLFORM() rather than the grid, and haven't done much with 
the scheduler recently.

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e9e95fd6-5bde-425a-9a15-c46cec275ef4n%40googlegroups.com.


Re: [web2py] shell.py, unqualified exec is not allowed

2024-02-29 Thread Dave S
On Tuesday, February 6, 2024 at 11:40:00 AM UTC-8 apinho wrote:

Hi,

Thank you. 

I was under the impression that web2py was only compatible with Python2.7, 
and that py4web was for Python3x.
I now understand that py2web has been modified and is also compatible with 
Python3, up to 3.11.

That definitely opens new horizons for me. I might try to install Python3 
alongside, and use it's venv.
I think that might be less confusing than trying to install a newer 
Python2.7 version, on this system, do you agree ?

Is migrating an web2py from Python2.7 to Python 3x a straightforward task ? 
Or might it need some code refactoring ?

Alexandre


I would say that >90% is straightforward.   Clean up all your "print" 
statements to "print()" calls, and that will get most of it.  There are a 
couple of other syntactical changes, but not very many.  Depending on your 
needs, though, there may be some standard library that is no longer 
standard library.  I encountered this around some special cases for needing 
to use urllib2.

Good luck!

/dps


On Tuesday 6 February 2024 at 17:25:31 UTC Massimiliano wrote:

Take a look to pyenv or nix to install a python version apart from the 
system

On Mon, Feb 5, 2024 at 5:37 PM apinho  wrote:

Hello everyone,

I just migrated an old (2017-ish) web2py app, which was still hosted on a 
user machine, running on Rocket HTTP server.

The app is now on a CentOS 7 VM, under nginx/uwsgi using HTTPS.
Web2py version is 2.27.1, over Python 2.7.5, in a virtualenv.

All is OK as for the app itself, but now I as trying to setup cron to to 
delete old sessions, and I'm stuck with this :
*$ python web2py.py -S  -M -R scripts/sessions2trash.py -A -o -X 
3600 -f -v*
Traceback (most recent call last):
  File "web2py.py", line 44, in 
import gluon.widget
  File "/home/apinho/web2py/web2py/gluon/widget.py", line 28, in 
from gluon.console import console, is_appdir
  File "/home/apinho/web2py/web2py/gluon/console.py", line 53, in 
from gluon.shell import die
  File "/home/apinho/web2py/web2py/gluon/shell.py", line 305
exec(read_pyc(pycfile), _env)
SyntaxError: unqualified exec is not allowed in function 'run' it contains 
a nested function with free variables

I really have no clue what to do. There is little help online. The only one 
I could find says that upgrading to Python 2.7.18 would do the trick, but 
that would most probably wreck Centos7 (Which I am stuck with, for it is my 
company's mandatory Linux distro for production environments).

Any help would be much appreciated.
Alexandre

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an 
email to web2py+un...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/575fdca2-1b6d-4107-8b99-9c5e5a30n%40googlegroups.com
 

.



-- 
Massimiliano

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/27edec30-7eb4-4293-90c1-1ca5758623f7n%40googlegroups.com.


[web2py] Re: reCAPTCHA link in online web2py book

2024-01-31 Thread Dave S
On Sunday, January 28, 2024 at 5:41:01 AM UTC-8 lucas wrote:

anyone on this, at all?


Sorry, I haven't used recaptcha, but I think there was a recent thread 
about it in the py4web forum.

Good luck

/dps
 

On Monday, January 22, 2024 at 9:01:02 AM UTC-5 lucas wrote:

hello one and all,

the link for reCAPTCHA, or, "
http://web2py.com/books/default/reference/29/recaptcha;, under the online 
web2py book, "
http://web2py.com/books/default/chapter/29/09/access-control#CAPTCHA-and-reCAPTCHA;,
 
seems to by unreferenced.

is this feature still working in the latest version of web2py, 2.27.1?  is 
it still free?  is it still good to use?

thank you, lucas

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e5e29850-a6ff-4693-b16a-1e9ea0165775n%40googlegroups.com.


[web2py] Re: Failing to download search results as csv

2024-01-15 Thread Dave S


On Tuesday, August 22, 2023 at 2:32:48 AM UTC-7 mostwanted wrote:

Hi guys, i need help downloading results as csv, i am failing dismally I 
dont know what to do
After the search results return values I want to download those results 
into my computer somewhere the current version of my code is giving me an 
error: 
* string indices must be integers*

Here is my code
*FROM THE SEARCH VIEW:*
* Download Results as CSV*

*DOWNLOAD CONTROLLER:*





*import csvfrom io import StringIOdef download_results():# Retrieve the 
filtered recordsrecords = request.vars*


Isn't request.vars an array of strings?
 

 






*#  CSV datacsv_data = []csv_data.append(['First Name', 'Last 
Name', 'Program', 'Study Mode'])  # Header rowfor record in records:
csv_data.append([record['first_name'], record['last_name'], 
record['program'], record['study_mode']])*


If request.vars, and hence records, is an array of strings, then each record 
is a string, and you're trying to index into that string with 'f*irst_name*', 
etc.

You either need to repeat the search using request.vars, or pass the 
records that the search got from request.vars.to download_results()
 












*# Create a response to download the CSV file
response.headers['Content-Type'] = 'text/csv'
response.headers['Content-Disposition'] = 'attachment; 
filename=registration_results.csv'# Write CSV data to a StringIO 
objectoutput = StringIO()csv_writer = csv.writer(output)for row 
in csv_data:csv_writer.writerow(row)# Return the content as 
bytesreturn output.getvalue().encode('utf-8')*



/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/93ed5077-9868-4659-800f-c7ced7dcda12n%40googlegroups.com.


[web2py] stale session with FORM and its kin

2024-01-15 Thread Dave S
Somewhere along the way, and that probably includes the manual, Massimo has 
noted that the use of the family of FORM helpers is generally used to get 
parameters for an action whose results are then displayed on another page 
as a redirect.  "What picture do you want to look at?  Okay, let's go to 
that picture...".

I do that with some of my forms, but in others, I just let the action 
happen and return the form for the next set of parameters.  "what do you 
want to change the tag to?  Okay, done,  Change another tag?"

When I do that, and then let the session expire before I get around to 
changing another tag (having youtube going on the other computer can do 
that to you), the major browsers will say something like "Confirm Form 
Resubmission".  That's sort of acceptable if it's just an app for me, 
myself, and I, but if I have actual users I will have confused users.

I know which ones I can resubmit safely, and which ones chopping the '#' 
off the end of the URL is a good way forward, but that isn't something I 
should be telling users to do.

I have one of the repetitive forms as a LOAD block in a page, and doing 
that hides the expiration issue, but it seems hokey to do that for all such 
forms.  However, about the only other idea I've come up with is to use a 
timer to cause a "redirect" to self, thus doing a fresh GET of the form.

Has anyone else come up with a better than either of those choices?

Thanks for your thoughts.

Dave 
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9468ab4e-41c9-4e88-9210-ec8bd6e58ff8n%40googlegroups.com.


[web2py] Re: cibersecurity audit issue about login

2023-12-31 Thread Dave S


On Thursday, November 16, 2023 at 9:32:58 AM UTC-8 Ramos wrote:

Hello friends, i guess this is a similar issue between web2py and py4web so 
im posting to both groups. Sorry if im abusing ...

We had a cibersecurity audit in our web2py app and they found this issue

QUOTE
During
the application audit process, it was possible to identify that the the 
company portal does not implement the restriction of
blocking accounts due to invalid login attempts This allows an attacker to 
use brute force attacks to attempt a valid credential indefinitely

*Recommendation*
We
recommend implementing account lockout policies for invalid login attempts, 
as well as captcha and multi factor
authentication ( mechanisms, as well as session timeouts to log out a user 
who has been inactive on the system for
some time
UNQUOTE

I already activated the mfa in my app but it only works if the password is 
correct.
An attacker trying to guess the password could have a forever loop trying 
to login and it can stress the sever CPU.

Any comments on this ?

Regards
António


The appadmin login supports lockout, but I'm not finding a mention of it in 
the manual.  A file is created (in the web2py root, IIRC, alongside 
httpserver.pid and parameters_8000.py).  This file can be removed by the 
appropriate local user.  If memory serves, you get 3 tries in xx seconds.

/dps
  

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/371daf75-dcb9-4e57-84f6-0cf8df0c9553n%40googlegroups.com.


[web2py] Does SQLFORM support "onvalidation"?

2023-09-15 Thread Dave S
Short answer:  YES

I was having trouble with "onvalidation" ... the code didn't seem to be 
running.  So I was going to ask if SQLFORM supported it ... but [blush] 
when preparing my question, I realized I had set the option on the wrong 
form.  (I have a ping-pong pair of forms ... you enter data for table A in 
one form, are redirected to the form for table B, which then redirects back 
to the A form.   The validation is needed for B, and I had set the option 
in the other form.

I'm kind of surprised that didn't cause a ticket, because the validation 
code was asking for a form.vars.b_of_B that wasn't part of A's form.vars.

Anyway, just another example of trying to blame Web2py when the error was 
between keyboard and chair.

/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c8c37060-a1e5-49b0-ae05-8f6b81bb37f4n%40googlegroups.com.


[web2py] Re: PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log'

2023-08-31 Thread Dave S


On Wednesday, August 23, 2023 at 9:55:49 PM UTC-7 david@gmail.com wrote:

We have activated logging in our applications and have defined 2 back-ups 
for the rotation.

We often get errors when running web2py shell scripts because I think that 
the the web2py web application and the web2py shell script are both trying 
to access the log file.  It looks like it is trying to perform a rotation 
at the moment of the error.


It's not clear to me whether the application or the shell script is getting 
this error.What gets logged when running the scripts?  Does this happen 
when loading the script?  What is b_console.py doing?  Generally, models 
don't contain procedural code, except for things like custom validators, 
and in web2py models get loaded on every hit (http requests or shell start 
ups if you use -M).

That said, I haven't had issues with log rotation, even on a production 
application (running on Amazon Linux).  My non-production apps, of course, 
don't have a lot of traffic, and my big WinError issue is not with logging, 
but writing a  temporary file and then renaming it; sometimes the OS hasn't 
finished its background work from the close before the rename is 
attempted.  

My non-production apps use SQLite3, so there are some "database locked" 
conflicts occasionally.

Can anyone give me an idea on how we can resolve with this conflict without 
disabling rotation?


Well, using a hammer where screwdriver is needed, you might have the shell 
script check the size of the log file, and bail out if the size is too near 
the rotation threshold. 


Here is the full output:
--- Logging error ---
Traceback (most recent call last):
  File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 
74, in emit
self.doRollover()
  File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 
177, in doRollover
self.rotate(self.baseFilename, dfn)
  File "D:\Python\Miniconda3\envs\web2py_XYZ\lib\logging\handlers.py", line 
115, in rotate
os.rename(source, dest)
PermissionError: [WinError 32] The process cannot access the file because 
it is being used by another process: 
'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log' -> 
'D:\\Data\\XYZ\\applications\\MyApp\\private\\app.log.1'
Call stack:
  File "D:\Data\XYZ\web2py.py", line 58, in 
gluon.widget.start()
  File "D:\Data\XYZ\gluon\widget.py", line 746, in start
run(options.shell, plain=options.plain, bpython=options.bpython,
  File "D:\Data\XYZ\gluon\shell.py", line 280, in run
_env = env(a, c=c, f=f, import_models=import_models, 
extra_request=extra_request)
  File "*D:\Data\XYZ\gluon\shell.py"*, line 181, in env
run_models_in(environment)
  File "D:\Data\XYZ\gluon\compileapp.py", line 563, in run_models_in
restricted(ccode, environment, layer=model)
  File "D:\Data\XYZ\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "applications\MyApp\models\b_console.py", line 153, in 
console.log(source='b_console.py', message=str(console), 
add_timestamp=True)
  File "applications\MyApp\models\b_console.py", line 147, in log
logger.debug(msg=out_log)

Thanks in advance,
David


Good luck!

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/485cd5ad-c375-4c40-879f-669d09ea2d02n%40googlegroups.com.


[web2py] Re: Error with redis and web2py 2.24.1: Invalid input of type: 'NoneType'. Convert to a bytes, string, int or float first.

2023-05-09 Thread Dave S


On Monday, May 8, 2023 at 6:36:13 AM UTC-7 Lisandro wrote:

Hey there! 
I recently updated to Web2py Version 
2.24.1-stable+timestamp.2023.03.23.05.07.17
It uses python 3.9.14, running in production serving around 60 requests per 
second, using resources efficiently and running really smoothly :D

Since the update, I'm seeing this error sporadically: 
*redis.exceptions.DataError: 
Invalid input of type: 'NoneType'. Convert to a bytes, string, int or float 
first.*
This is the traceback:

Traceback (most recent call last):
File "applications/eldia/compiled/models.db.py", line 113, in 
File "/var/www/medios/gluon/globals.py", line 979, in connect
row = table(record_id, unique_key=unique_key)

 [...]


File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 318, in read_response
raw = self._buffer.readline()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 249, in readline
self._read_from_socket()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 195, in _read_from_socket
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
redis.exceptions.ConnectionError: Connection closed by server.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/www/medios/gluon/main.py", line 439, in wsgibase
serve_controller(request, response, session)
File "/var/www/medios/gluon/main.py", line 173, in serve_controller
run_models_in(environment)
File "/var/www/medios/gluon/compileapp.py", line 563, in run_models_in
restricted(ccode, environment, layer=model)
File "/var/www/medios/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "applications/eldia/compiled/models.db.py", line 116, in 
File "applications/eldia/compiled/models.db.py", line 47, in raise_error
gluon.http.HTTP: 500 INTERNAL SERVER ERROR


tripped while already falling, methinks
 


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/www/medios/gluon/main.py", line 455, in wsgibase
session._try_store_in_db(request, response)
File "/var/www/medios/gluon/globals.py", line 1254, in _try_store_in_db
record_id = table.insert(**dd)
File "/var/www/medios/gluon/contrib/redis_session.py", line 167, in insert
pipe.execute()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
2078, in execute
return conn.retry.call_with_retry(
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/retry.py", line 
46, in call_with_retry
return do()
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
2079, in 
lambda: execute(conn, stack, raise_on_error),
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/client.py", 
line 
1922, in _execute_transaction
all_cmds = connection.pack_commands(
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 895, in pack_commands
for chunk in self.pack_command(*cmd):
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 858, in pack_command
for arg in map(self.encoder.encode, args):
File 
"/opt/virtualenvs/medios_py39/lib/python3.9/site-packages/redis/connection.py", 
line 108, in encode
raise DataError(
redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a 
bytes, string, int or float first.


This looks like it involves one of these being None:

dd = dict(locked=0,
  client_ip=response.session_client,
  modified_datetime=request.now.isoformat(),
  session_data=session_pickled,
  unique_key=unique_key)

 but this seems to be in trying to clean up after the original issue.

It's not clear to me where or how the error happens. From what I see, I 
understand that the problem is with redis session, but I can't figure out 
where. 


What I would investigate is the exception at the top of the list, which 
means finding out why the socket was closed.
 

I run python 3.9.14 with virtualenv and Redis 4.3.5.
Any point or suggestion will be much appreciated.
Thanks!


Sorry, I'm not a redis expert, but in compound fractures, er, exceptions, 
the first one to occur is where the problem started.  Good luck!

/dps 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6f8e01b7-a461-42f6-824d-79a9128abfddn%40googlegroups.com.


[web2py] Re: Exceptional oddity in query processing

2023-05-09 Thread Dave S
On Monday, May 8, 2023 at 4:33:42 AM UTC-7 Jim S wrote:

I think you want

r = (db.badlist.PostDate != None) without the db in front of it.

-Jim


Thank you, sir!  That seems to have been the key.

Dave S
/dps
 


On Saturday, May 6, 2023 at 6:04:39 PM UTC-5 snide...@gmail.com wrote:

Added missing frame info

On Saturday, May 6, 2023 at 3:51:43 PM UTC-7 Dave S wrote:

Why does this


   - 
   
   *File 
   
C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py
 
   in _select_aux at line 865* code arguments variables
   Function argument list
   
   (self=, sql='SELECT "badlist"."id", 
   "badlist"."burl", "badlis...LL)> ORDER BY "badlist"."tags", 
   "badlist"."burl";', fields=[, 
   , , 
   ], attributes={'orderby': 
   }, colnames=['badlist.id', 
   'badlist.burl', 'badlist.tags', 'badlist.PostDate'])
   - 
   
   turn into this?
   

   - 
   
   *File 
   
C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py
 
   in _select_aux_execute at line 859* code arguments variables
   Function argument list
   
   (self=, sql='SELECT "badlist"."id", 
   "badlist"."burl", "badlis...LL)> ORDER BY "badlist"."tags", 
   "badlist"."burl";')
   
 

The relevant controller code is 

r = db(db.badlist.PostDate != None)
rows=db(r).select(orderby=db.badlist.tags|db.badlist.burl)

The exception is


File 
"C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py",
 
line 468, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
sqlite3.OperationalError: near "<": syntax error

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/de93a343-95c5-4a35-8092-28c65f3ba86an%40googlegroups.com.


[web2py] Re: Messy views in Chrome after crash

2023-05-07 Thread Dave S


On Saturday, May 6, 2023 at 4:33:08 PM UTC-7 Dave S wrote:

Weird copy-paste error on the first paragraph, which should read:

Every now and then, my older laptop says it can't handle umpteen dozen tabs 
any more, it's done swapping, and it nosedives into a blue screen.  This 
laptop is also hosting the dev versions of my sites, using the in-box 
rocket server.   Window 10+ environment.
[...]

After this happens and I restart the system, the server, and the browser, 
Opera (and Firefox, too, I think) are happy to resume and everything 
appears fine.  Chrome resumes, but many of the tabs from my web2py instance 
display messed up ... bits appear in scambled places, like a jigsaw puzzle 
waiting to be assembled, and there are black blocks in various places.  
Sometimes I can see the appropriate contents by highlighting a region, and 
a field in a form usually behaves normally while I'm entering data, but 
often is glitched as soon as I change focus.

I just completed a Chrome update, so there may well be browser cache that 
wasn't getting cleared by clear selections.   I'll skip blaming Rocket for 
a bit, but I'll be waving my hands if I get stuck on this again.

/dps


 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/75c54ede-e68e-4492-a8af-47edba0025dfn%40googlegroups.com.


[web2py] Re: Messy views in Chrome after crash

2023-05-06 Thread Dave S
Weird copy-paste error on the first paragraph, which should read:

Every now and then, my older laptop says it can't handle umpteen dozen tabs 
any more, it's done swapping, and it nosedives into a blue screen.  This 
laptop is also hosting the dev versions of my sites, using the in-box 
rocket server.   Window 10+ environment.

On Saturday, May 6, 2023 at 4:31:28 PM UTC-7 Dave S wrote:

> Every now and then, my older laptop says it can't handle umpteen dozen 
> tabs any more, it's done swapping, and it nosedives into a blue screen.  
> This laptop is also hosting the dev versions of my sites, using the in-box 
> rocket server.   Window 10+ environment.
>
> After this happens and I restart the system, the server, and the browser, 
> Opera (and Firefox, too, I think) are happy to resume and everything 
> appears fine.  Chrome resumes, but many of the tabs from my web2py instance 
> display messed up ... bits appear in scambled places, like a jigsaw puzzle 
> waiting to be assembled, and there are black blocks in various places.  
> Sometimes I can see the appropriate contents by highlighting a region, and 
> a field in a form usually behaves normally while I'm entering data, but 
> often is glitched as soon as I change focus.
>
> This happens to relatively simple pages where I use SQLFORM or SQLTABLE, 
> and it happens to the admin pages (include viewing a ticket).
>
> Clearing the browser cache doesn't fix this.  Is there a place where 
> rocket has cached data that I should be clearing?  Oh, Chrome does have the 
> most tabs open, and Opera a lot fewer, but about the same number of tabs 
> from my sites.
>
> Thanks
>
> Dave S
> /dps
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d4a65ec2-366c-4754-9f88-d58444abee08n%40googlegroups.com.


[web2py] Messy views in Chrome after crash

2023-05-06 Thread Dave S
Every now and then, my older laptop says it can't handle umpteen dozen tabs 
any more, it's done swapping, and it nosedives into a blue screen.  This 
laptop is also hosting the dev versions of my sites, using the in-box 
rocket server.   Window 10+ environment.

After this happens and I restart the system, the server, and the browser, 
Opera (and Firefox, too, I think) are happy to resume and everything 
appears fine.  Chrome resumes, but many of the tabs from my web2py instance 
display messed up ... bits appear in scambled places, like a jigsaw puzzle 
waiting to be assembled, and there are black blocks in various places.  
Sometimes I can see the appropriate contents by highlighting a region, and 
a field in a form usually behaves normally while I'm entering data, but 
often is glitched as soon as I change focus.

This happens to relatively simple pages where I use SQLFORM or SQLTABLE, 
and it happens to the admin pages (include viewing a ticket).

Clearing the browser cache doesn't fix this.  Is there a place where rocket 
has cached data that I should be clearing?  Oh, Chrome does have the most 
tabs open, and Opera a lot fewer, but about the same number of tabs from my 
sites.

Thanks

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bce21d64-e67b-454e-908e-fbfe32283c60n%40googlegroups.com.


[web2py] Re: Exceptional oddity in query processing

2023-05-06 Thread Dave S
Added missing frame info

On Saturday, May 6, 2023 at 3:51:43 PM UTC-7 Dave S wrote:

Why does this


   - 
   
   *File 
   
C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py
 
   in _select_aux at line 865* code arguments variables
   Function argument list
   
   (self=, sql='SELECT "badlist"."id", 
   "badlist"."burl", "badlis...LL)> ORDER BY "badlist"."tags", 
   "badlist"."burl";', fields=[, 
   , , 
   ], attributes={'orderby': 
   }, colnames=['badlist.id', 
   'badlist.burl', 'badlist.tags', 'badlist.PostDate'])
   - 
   
   turn into this?
   

   - 
   
   *File 
   
C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py
 
   in _select_aux_execute at line 859* code arguments variables
   Function argument list
   
   (self=, sql='SELECT "badlist"."id", 
   "badlist"."burl", "badlis...LL)> ORDER BY "badlist"."tags", 
   "badlist"."burl";')
   
 

The relevant controller code is 

r = db(db.badlist.PostDate != None)
rows=db(r).select(orderby=db.badlist.tags|db.badlist.burl)

The exception is


File 
"C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py",
 
line 468, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
sqlite3.OperationalError: near "<": syntax error

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d82b85b9-8ec9-4cb9-807b-a3b364cec75en%40googlegroups.com.


[web2py] Exceptional oddity in query processing

2023-05-06 Thread Dave S
Why does this


   - 
   
   *File 
   
C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py
 
   in _select_aux at line 865* code arguments variables
   Function argument list
   
   (self=, sql='SELECT "badlist"."id", 
   "badlist"."burl", "badlis...LL)> ORDER BY "badlist"."tags", 
   "badlist"."burl";', fields=[, 
   , , 
   ], attributes={'orderby': 
   }, colnames=['badlist.id', 'badlist.burl', 
   'badlist.tags', 'badlist.PostDate'])
   - 
   
   turn into this?
   
The relevant controller code is 

r = db(db.badlist.PostDate != None)
rows=db(r).select(orderby=db.badlist.tags|db.badlist.burl)

The exception is


File 
"C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py",
 
line 468, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)
sqlite3.OperationalError: near "<": syntax error

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e2be99a7-d08f-4400-a921-d195df4a71d8n%40googlegroups.com.


[web2py] Re: Is it possible to change the boolean field widget from checkbox to option with yes and no?

2023-03-29 Thread Dave S
On Wednesday, March 29, 2023 at 4:46:26 AM UTC-7 Dave S wrote:

On Wednesday, March 29, 2023 at 4:10:19 AM UTC-7 Dave S wrote:

On Sunday, February 26, 2023 at 5:51:30 AM UTC-8 jeff...@gmail.com wrote:

Is it possible to change the boolean field widget from checkbox to option 
with yes and no? How?



I don't think you can do that with the default radio widget.

This works:

form3 = SQLFORM.factory(
Field('bool', type = "string", default = False, \


um, that default should now be 'yes' or 'no', since the type isn't boolean
 

  requires=IS_IN_SET(['yes', 'no']), \
  widget = lambda field, value: 
 SQLFORM.widgets.radio.widget(field, value)),
_name = "Georgeform")
if form3.process(formname = "Georgeform", dbio = False, keepvalues = 
True).accepted:
response.flash = "form3 bool %s" % ("T" if form3.vars.bool == 'yes' 
else 'F')
else:
response.flash = "form3 bool not set"


but if you set the field type to  boolean, you always get form3.vars.bool = 
True.

Since I'm about to go to bed (as I said an hour ago), I'm not going to 
explore custom widgets, or using the INPUT() helper  But synthesizing a 
boolean from the radio set is my idea of an obvious approach.  The caveat 
is that if you're using SQLFORM instead of the factory, I'm not sure what 
will happen with the row posted to the table.  Again, not before bed


Ok,  I won't *try* anything before bed, but I'd probably make the table def 
use a computed field for the boolean and have it not visible, and just add 
the radio set  field to the table.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/01a081a1-80dc-4226-8137-9b8adefa9c1en%40googlegroups.com.


[web2py] Re: Is it possible to change the boolean field widget from checkbox to option with yes and no?

2023-03-29 Thread Dave S
On Wednesday, March 29, 2023 at 4:10:19 AM UTC-7 Dave S wrote:

On Sunday, February 26, 2023 at 5:51:30 AM UTC-8 jeff...@gmail.com wrote:

Is it possible to change the boolean field widget from checkbox to option 
with yes and no? How?



I don't think you can do that with the default radio widget.

This works:

form3 = SQLFORM.factory(
Field('bool', type = "string", default = False, \


um, that default should now be 'yes' or 'no', since the type isn't boolean
 

  requires=IS_IN_SET(['yes', 'no']), \
  widget = lambda field, value: 
 SQLFORM.widgets.radio.widget(field, value)),
_name = "Georgeform")
if form3.process(formname = "Georgeform", dbio = False, keepvalues = 
True).accepted:
response.flash = "form3 bool %s" % ("T" if form3.vars.bool == 'yes' 
else 'F')
else:
response.flash = "form3 bool not set"


but if you set the field type to  boolean, you always get form3.vars.bool = 
True.

Since I'm about to go to bed (as I said an hour ago), I'm not going to 
explore custom widgets, or using the INPUT() helper  But synthesizing a 
boolean from the radio set is my idea of an obvious approach.  The caveat 
is that if you're using SQLFORM instead of the factory, I'm not sure what 
will happen with the row posted to the table.  Again, not before bed.

Good luck!

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f3418b44-cbe3-4fed-b6fa-2da5f6371739n%40googlegroups.com.


[web2py] Re: Is it possible to change the boolean field widget from checkbox to option with yes and no?

2023-03-29 Thread Dave S

On Sunday, February 26, 2023 at 5:51:30 AM UTC-8 jeff...@gmail.com wrote:

Is it possible to change the boolean field widget from checkbox to option 
with yes and no? How?



I don't think you can do that with the default radio widget.

This works:

form3 = SQLFORM.factory(
Field('bool', type = "string", default = False, \
  requires=IS_IN_SET(['yes', 'no']), \
  widget = lambda field, value: 
 SQLFORM.widgets.radio.widget(field, value)),
_name = "Georgeform")
if form3.process(formname = "Georgeform", dbio = False, keepvalues = 
True).accepted:
response.flash = "form3 bool %s" % ("T" if form3.vars.bool == 'yes' 
else 'F')
else:
response.flash = "form3 bool not set"


but if you set the field type to  boolean, you always get form3.vars.bool = 
True.

Since I'm about to go to bed (as I said an hour ago), I'm not going to 
explore custom widgets, or using the INPUT() helper  But synthesizing a 
boolean from the radio set is my idea of an obvious approach.  The caveat 
is that if you're using SQLFORM instead of the factory, I'm not sure what 
will happen with the row posted to the table.  Again, not before bed.

Good luck!

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/451dcf7d-9468-4a19-a13b-ce236c19f069n%40googlegroups.com.


[web2py] Re: web2py with rocket server + nginx ?

2023-02-16 Thread Dave S
On Thursday, February 16, 2023 at 7:26:40 AM UTC-8 chriii...@gmail.com 
wrote:
Hello!

I'm wondering if it is a good idea to use web2py with rocket server in 
combination with nginx as a reverse proxy like in py4web. 
I need to run py4web and web2py on the same server and using nginx without 
uwsgi for web2py would be easier for me.


Cheers.
Chris.

Well, subject to the fine print, that should be okay, as I'm doing the 
similar thing with caddy (but not as a production server, so I haven't done 
any load testing).  In your testing,  I recommend trying large transfers 
(if your application ever would do that), and memory loads.

I do have a situation where I try to send (server to client) too large a 
file using chunks, and at some point the client sends a close before rocket 
expects it (still chunks to go).  I'm running this on windows, and Rocket 
pops up a window complaining that it tried to send a 500 response but the 
connection is invalid ... and after a few of these, Rocket runs out of 
handles and things go on hold until I dismiss the popups.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/852e00fa-d1af-4f3d-b5df-d852aa9bd831n%40googlegroups.com.


[web2py] Does web2py/PyDal support rowvalues?

2023-01-23 Thread Dave S
While stumbling around some newsgroups (when recovering my .newsrc file and 
tweaking the subscriptions) I found a discussion of using rowvalues+limitby 
for paging rather than offset+limitby.  Since modern SQLites support this 
(as, of course PostGres does),  I'd like to play around with it in the 
PyDal enviornment, but I don't think this is covered in the web2py book.

Thanks.

Dave
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/946a8b5e-c6c5-454f-a6cf-3aa45f7d16adn%40googlegroups.com.


[web2py] Re: where is the path specified that points to python.exe

2022-12-08 Thread Dave S
On Sunday, November 27, 2022 at 9:00:57 AM UTC-8 alexg...@gmail.com wrote:

> I mean where in the  Web2py source code or settings can I tell web2py 
> which instance of python to use.   Where can I type the path?
>

One way of handling this is to use a command window with a specific %PATH% 
variable.  If you need this to be automatic, as on works on reboots, you 
set it in the batch file that runs automatimagically runs at startup.

I don't do this, but my windows web2py instance isn't public, so I have no 
issues with using the graphical console in a click-to-start setup.

/dps

 

> On Saturday, November 26, 2022 at 2:24:32 PM UTC-8 Arglanir wrote:
>
>> sys.executable should be your friend.
>>
>> Le samedi 26 novembre 2022 à 08:42:52 UTC+1, alexg...@gmail.com a écrit :
>>
>>> where is the path specified that points to python.exe?
>>>
>>> Am using Windows source code for For Python 3.7
>>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/db4b9e70-e4f5-418c-8b62-8ad4a808cb06n%40googlegroups.com.


[web2py] Re: Grid: case insensitive sort

2022-11-04 Thread Dave S
On Thursday, November 3, 2022 at 8:57:23 AM UTC-7 vincent...@gmail.com 
wrote:

> Hello,
>
> I have a simple SQLFORM.grid that shows the rows of my simple SQLite 
> database.
> In the grid, when I click on, say, the "vendorname" column header, this 
> performs a kind of alphabetical sort, but the sort is case sensitive, so 
> for example "AXE" comes before "Abc". How can I make the grid achieve a 
> case insensitive sort?
>
> Thanks
>

You have to write the query to be case insensitive, as none of the other 
grid parameters are helpful.

/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c6bd4073-f902-4518-8ac3-05612cdcd6e2n%40googlegroups.com.


[web2py] Re: DAL: basic join question

2022-10-27 Thread Dave S
On Wednesday, October 26, 2022 at 5:38:44 PM UTC-7 Jim S wrote:

> Can you try
>
> vrows = db(db.picsntoes.id > 0 <http://db.pics.id>).select(db.pics.ALL, 
> db.picnotes.ALL, left=db.pics.on(db.pics.id == db.picnotes.about))
>
> instead of
>
> vrows = db(db.pics.id == db.picnotes.about).select(db.pics.on(db.pics.id 
> == db.picnotes.about))
>
>
Thank you!  That worked.  And it turns out my version would have worked if 
I hadn't dropped the "join =".  But because of a typo in a text comparison, 
I was actually executing a different query, from before I tried a 
simplified problem.  Now that you've helped my through the simplified 
problem, I can go back and see how far I get in the deeper mud.



If that doesn't work, can you share you're whole model?  Seems like the 
> picnotes def is off a bit.
>
> -Jim
>

Dave S
/dps

> [original post elided]
>>
>  

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/26621102-1b40-492a-a5d1-830a01ae4033n%40googlegroups.com.


[web2py] Re: Server Deployement issue

2022-10-26 Thread Dave S

On Tuesday, October 25, 2022 at 10:57:55 PM UTC-7 silvia...@gmail.com wrote:

> Hey snide,
>
> do you mind helping me setting it up in an ngnix enviromenet I would also 
> pay you somthing for your time 
>
>
Pay sounds good to me, but I'm not sure you'd get your money's worth.  It's 
been a while since I did the nginx set up for work, and my personal nginx 
set up is currently waiting for me to add web2py apps; it currently is 
serving my old old static website with mostly handcrafted html.

 I don't know f I can get to mine  before next week, and I'd want to do 
that as a warm-up.

Are you not finding the book's example clear enough?

/dps

snide...@gmail.com schrieb am Mittwoch, 12. Oktober 2022 um 06:26:27 UTC+7:
>
>> On Wednesday, October 5, 2022 at 9:23:07 PM UTC-7 silvia...@gmail.com 
>> wrote:
>>
>>> I forgot to add that I want to deployment my web2py on a local network 
>>> to run it as an Intranet.
>>>
>>>
>> That shouldn't be an issue.  But I can only offer limited help on 
>> whatever *is* the issue because I use the preferred nginx environment.
>>
>> /dps
>>  
>>
>>> Silvian Cedru schrieb am Donnerstag, 6. Oktober 2022 um 10:40:07 UTC+7:
>>>
 Hello everyone,

 I got an issue eveytimeI want to do the One step production deployment 
 from http://web2py.com/books/default/chapter/29/13/deployment-recipes 

 Restarting apache2 and then failed do I need to setup something before 
 I use just the deployment code cause I just copy and paste it or are there 
 other ways to deploy ? 




-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/85b0a0b7-8cc3-47c5-beb2-5b649b4944e5n%40googlegroups.com.


[web2py] DAL: basic join question

2022-10-26 Thread Dave S
I have a table called pics and a table called picnotes, where the 
definitions are like

db.define_table("pics", Field(...))
db.define_table("picnotes", Field("about", 'reference pics', Field("note", 
"string"))

And I want to extract all rows of pics that have a note referring to them 
(this is a simplified version of what I really want).  I'm trying to follow 
the book, and double-checking with posts in this group (and peeking at the 
p4web group), but I keep getting the error

 near "<": syntax error

where the traceback goes to

File 
"C:\Users\Dave\web2py_src\web2py_src-2.22.5\web2py\gluon\packages\dal\pydal\adapters\base.py",
 
line 468, in execute
rv = self.cursor.execute(command, *args[1:], **kwargs)

and the variables in that frame include

command'SELECT "badpic"."id", "badpic"."iurl", "badpic"ND );'
args('SELECT "badpic"."id", "badpic"."iurl", "badpic"ND );',)

I've tried

vrows = db(db.pics.id == db.picnotes.about).select(db.pics.ALL)

and

vrows = db(db.pics.id == db.picnotes.about).select(db.pics.on(db.pics.id == 
db.picnotes.about))

What do I need to do instead?

version stuff:


web2py™
Version 2.22.5-stable+timestamp.2022.06.04.18.13.51
Python
Python 3.10.7: 
C:\Users\Dave\AppData\Local\Programs\Python\Python310\python.exe (prefix: 
C:\Users\Dave\AppData\Local\Programs\Python\Python310)


Thanks.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1f603602-6156-4025-aa96-f5b01625362cn%40googlegroups.com.


[web2py] Re: File Upload there is a little text I want to hide

2022-10-25 Thread Dave S
On Tuesday, October 25, 2022 at 12:38:37 AM UTC-7 silvia...@gmail.com wrote:

>
> Thanks anyway figured it out was a line of code in the controller


I love success stories!

/dps
 

> snide...@gmail.com schrieb am Freitag, 21. Oktober 2022 um 23:05:32 UTC+7:
>
>> On Thursday, October 20, 2022 at 2:16:42 AM UTC-7 silvia...@gmail.com 
>> wrote:
>>
>>> Hello everyone ,
>>>
>>> I implemented a file upload in web2py and there is a little text in a 
>>> span that is annoying but I can not just hide all the spans on my page any 
>>> suggestions see screenshot 
>>>
>>
>> I think we need to see some code ... at the least, your view file.
>>
>> /dps
>>  
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/36cb45ba-ce9a-4d99-ba9f-ea127bdcab8en%40googlegroups.com.


[web2py] Re: About images in mail.sent

2022-10-21 Thread Dave S

On Friday, October 21, 2022 at 8:59:43 AM UTC-7 Ramos wrote:

> Coding like in the manual 
>
> mail.send('y...@example.com',
>   'Message subject',
>   '',
>   attachments = mail.Attachment('/path/to/photo.jpg', content_id='photo'))
>
>
>
> all the images appear at the bottom of the email as attachments like this 
> ( anexos means attachments!)
> [image: image.png]
>
>
>
> how do i prevent this because its not nice to see them as attachments 
> besides the '
>
> regards
> António
>
>
This is a MIME question.  The Mail class (and it's private class 
Attachment) are in tool.py, but import MIME stuff from _compat.py to handle 
python3 vs 2 issues.  A quick scan of tool.py suggests that it is just a 
MIME multipart.

My inbox shows that some professional (as in, used by banks and other large 
commercial entities) will show the photos as attachments, and some don't.  
I would recommended studying both MIME itself and some samples of email to 
find out how that difference occurs.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1aafdee5-5fb5-4e16-8975-deb9fb253345n%40googlegroups.com.


[web2py] Re: File Upload there is a little text I want to hide

2022-10-21 Thread Dave S

On Thursday, October 20, 2022 at 2:16:42 AM UTC-7 silvia...@gmail.com wrote:

> Hello everyone ,
>
> I implemented a file upload in web2py and there is a little text in a span 
> that is annoying but I can not just hide all the spans on my page any 
> suggestions see screenshot 
>

I think we need to see some code ... at the least, your view file.

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7d381f89-e799-4d5f-842d-3f90659ceba5n%40googlegroups.com.


[web2py] Re: Server Deployement issue

2022-10-11 Thread Dave S

On Wednesday, October 5, 2022 at 9:23:07 PM UTC-7 silvia...@gmail.com wrote:

> I forgot to add that I want to deployment my web2py on a local network to 
> run it as an Intranet.
>
>
That shouldn't be an issue.  But I can only offer limited help on whatever 
*is* the issue because I use the preferred nginx environment.

/dps
 

> Silvian Cedru schrieb am Donnerstag, 6. Oktober 2022 um 10:40:07 UTC+7:
>
>> Hello everyone,
>>
>> I got an issue eveytimeI want to do the One step production deployment 
>> from http://web2py.com/books/default/chapter/29/13/deployment-recipes 
>>
>> Restarting apache2 and then failed do I need to setup something before I 
>> use just the deployment code cause I just copy and paste it or are there 
>> other ways to deploy ? 
>>
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bd3034b3-1764-4d8a-9253-5a60177845ean%40googlegroups.com.


[web2py] Re: Silly Question about invalid controller/function

2022-10-03 Thread Dave S
On Monday, October 3, 2022 at 5:21:52 PM UTC-7 Dave S wrote:

> On Monday, October 3, 2022 at 5:14:23 PM UTC-7 Dave S wrote:
>
>> If I mistype the funtion or controller name, the response displayed is 
>> "invalid function (controller/wrongfunc) " or "invalid controller 
>> (wrongctlr/function)".   These have status 404, but don't display "404" in 
>> the body.  I think it would make the error message better if it was "404:  
>> invalid function (controller/wrongfunc)"  instead.
>>
>> Is there a good reason not to have the 404 status shown to the user?  
>> There is a 404 page template in applications/myappy/static.
>>
>
> It's very miminal, and not really a template, but does show "404"  to the 
> user.  My suggestion is to jut edit the strings for badf and badc in 
> compileapp.py:run_controller_in(), adding the "404: " there.
>
>
Maybe this is all delegated to routes_onerror[...]
 

>  
>>
> /dps
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/70f7e9db-1d71-4c42-bda9-f5c621122806n%40googlegroups.com.


[web2py] Re: Silly Question about invalid controller/function

2022-10-03 Thread Dave S
On Monday, October 3, 2022 at 5:14:23 PM UTC-7 Dave S wrote:

> If I mistype the funtion or controller name, the response displayed is 
> "invalid function (controller/wrongfunc) " or "invalid controller 
> (wrongctlr/function)".   These have status 404, but don't display "404" in 
> the body.  I think it would make the error message better if it was "404:  
> invalid function (controller/wrongfunc)"  instead.
>
> Is there a good reason not to have the 404 status shown to the user?  
> There is a 404 page template in applications/myappy/static.
>

It's very miminal, and not really a template, but does show "404"  to the 
user.  My suggestion is to jut edit the strings for badf and badc in 
compileapp.py:run_controller_in(), adding the "404: " there.

 
>
/dps
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0f1863f0-3a55-4fc1-817c-8784bb0190f5n%40googlegroups.com.


[web2py] Silly Question about invalid controller/function

2022-10-03 Thread Dave S
If I mistype the funtion or controller name, the response displayed is 
"invalid function (controller/wrongfunc) " or "invalid controller 
(wrongctlr/function)".   These have status 404, but don't display "404" in 
the body.  I think it would make the error message better if it was "404:  
invalid function (controller/wrongfunc)"  instead.

Is there a good reason not to have the 404 status shown to the user?  There 
is a 404 page template in applications/myappy/static.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/75b6097c-ff92-4ea5-a6b5-3cc106be9255n%40googlegroups.com.


[web2py] Re: Custom Login Decorator

2022-09-30 Thread Dave S

On Saturday, September 24, 2022 at 1:43:13 AM UTC-7 mostwanted wrote:

> So I was able to figure my problem out thanks to Arglanir. I put in 
> alittle effort & I achieved positive results with the code below.
>
> def onetimecode(func):
> def wrapper():
> details=['not logged', session.logged]
> if not request.vars.type or request.vars.type not in details:
> redirect(URL('default', 'subscribe'))
> else:
> return func()
> return wrapper
>
> ​
>
>
Glad you got it figured out, and thanks for sharing.

/dps
 

>
> On Wednesday, September 21, 2022 at 10:33:45 AM UTC+2 mostwanted wrote:
>
>> *STATEMENT OF THE PROBLEM*
>> ​
>>
>> I have an infinite loop problem that i don't know how to escape so i need 
>> help I have never used a decorator before I'm not even sure i fully 
>> understand how they work but i have used one & it's giving me a headache. 
>>
>> I have registration form that's supposed to be protected by a one time 
>> code login page that i put inside a decorator trying to simulate 
>> *@auth.requires_login()*. The idea is that if the one time code is 
>> correct the user should access the registration form but *NEVER* if it's 
>> wrong and the user should never be able to bypass the security feature by 
>> directly typing the page address in the URL! But now I'm stuck in a loop 
>> with a page(one time code page) that keeps calling itself. How can I fix 
>> this to get what I want??
>> ​
>>
>> *ONE TIME CODE FORM*
>>
>> def subscribe():
>> key_exists = not db(db.regKeys.regKey == request.vars.regCode).isempty()
>> if request.vars.regCode is None:
>> message=''
>> if key_exists:
>> db(db.regKeys.regKey == request.vars.regCode).delete()
>> redirect(URL('register_product'))
>> if request.vars.regCode is not None and not key_exists:
>> message="INCORRECT REG CODE"
>> return locals()
>>
>> ​
>> *DECORATOR CODE*
>>
>> def onetimecode(func):
>> def wrapper():
>> redirect(URL('default', 'subscribe'))
>> return wrapper
>>
>> ​
>> *REGISTRATION FORM WITH THE DECORATOR*
>>
>> @onetimecodedef register_product():
>>  timeout = auth.settings.expiration
>>  details=db(db.thirdParty).select()
>>  form=SQLFORM(db.black_market2)
>>  if form.process().accepted:
>>  response.flash=T('Successfully Registered')
>>  return locals()
>>
>> ​
>>
>>
>>
>>
>>
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/735e20a2-a1db-4b8c-a8fd-146812b028b6n%40googlegroups.com.


[web2py] Re: Bypass web2py for static maintenance page

2022-09-30 Thread Dave S

On Wednesday, September 21, 2022 at 2:26:47 PM UTC-7 scot...@gmail.com 
wrote:

> I found the answer to my own question. So in case anyone else finds it 
> useful:
>
> Instead of using the WSGIScriptAlias directive you can use 
> WSGIScriptAliasMatch which allows for regular expressions. Then I used a 
> negative lookahead to exclude any paths beginning with "maintenance":
>
> WSGIScriptAliasMatch "^/(?!maintenance).*$" 
> /path/to/my/web2py/wsgihandler.py
>
> It works like a charm. Now when I activate maintenance mode apache serves 
> the static html page in /var/www/html/maintenance. Otherwise, it redirects 
> all other requests to the wsgi handler for web2py.
>
>
>
Thanks for sharing this.

/dps
 

>
> On Monday, September 19, 2022 at 6:07:18 PM UTC-4 Ian W. Scott wrote:
>
>> I'm trying to set up a static maintenance page under apache that doesn't 
>> depend on web2py. The problem is that the mod_wsgi scriptalias directive 
>> seems to override the rewrite instructions to serve the static maintenance 
>> page.
>>
>> My apache config includes this:
>>
>>   ErrorDocument 503 /maintenance/maintenance.html
>>   RewriteEngine on
>>   RewriteCond /var/www/html/maintenance/maintenance.enabled -f
>>   RewriteCond %{REQUEST_URI} !=/maintenance/maintenance.html
>>   RewriteRule ^ - [R=503,L]
>>
>> This works fine as long as I disable the mod_wsgi scriptalias directive:
>>
>> WSGIScriptAlias / /path/to/my/web2py/wsgihandler.py
>>
>> Basically I need web2py to handle any urls from the base of my domain. 
>> Except I want to bypass that alias for paths beginning "/maintenance".
>>
>> Any suggestions for how to configure this?
>>
>> Thanks,
>>
>> Ian
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/71036f96-6b69-4563-a348-a420799aaec8n%40googlegroups.com.


[web2py] appadmin table view

2022-09-16 Thread Dave S
It's rather annoying waiting for appadmin to produce a drop down list with 
1 entries.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/48ba9a9c-b4db-4061-988f-019dbc5b4ff9n%40googlegroups.com.


[web2py] Re: quick form styling question

2022-09-07 Thread Dave S


On Monday, September 5, 2022 at 11:26:57 PM UTC-7 silvia...@gmail.com wrote:

> What you actually could do is put the class in the  section 
> of the page and overwrite it manually . Give it for example class ".A {
> width: 50% !important; }"
>
>
Thanks.

/dps
 

> snide...@gmail.com schrieb am Dienstag, 6. September 2022 um 13:12:32 
> UTC+7:
>
>> On Saturday, September 3, 2022 at 5:19:42 PM UTC-7 Dave S wrote:
>>
>>> Warning: everything I know about BootStrap (BS4) I've learned from the 
>>> examples, so I Don't Know Much.
>>>
>>>
>> Slightly related question:  what is the best widget for a factory form 
>> field using IS_IN_SET[ .. several strings ...]?  If I leave it default, I 
>> get a pull-down caret on the right, and autocompletion, but no cursor token 
>> to show the field is active.  if I use SQLFORM.widgets.strings.widget, I 
>> get the curson but no pull-down or autocomplete.
>>
>> /dps
>>
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/593b72a9-6d44-4ace-bbbf-32315a6125cbn%40googlegroups.com.


[web2py] Re: I have two form submit buttons but I only want one is it possible to hide the other one ?

2022-09-06 Thread Dave S


On Sunday, September 4, 2022 at 8:00:25 PM UTC-7 silvia...@gmail.com wrote:

> Hello everyone, I think I have an issue that can not be resolved that easy 
> to be quite honest I have a custom form and an post form on the same page 
> my issue is I think I made a mistake with the design since it is all in 
> between tabs see screenshot attached.
>
> So my question would be is there a better solution or should I restyle the 
> whole page ? 
>
>
In the code below, I don't see where you start the form.
 

> Here is the code aswell for reference :
>
> 
>   {{if len(activities_project):}}
> Activity 
> 
> 
> {{for activity in activities_project:}}
>   {{=projects.project_name}} says {{=activity.body}} Posted 
> on {{=activity.created_on}} by {{=activity.created_by.first_name}}
> {{=activity.created_by.last_name}}
>   
> {{pass}}
> 
>   {{else:}}
> No comments posted yet
>   {{pass}}
>   {{=form_activity}}
> 
> {{=form.custom.submit}}
> {{=form.custom.end}}
>

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6bb493d3-da34-4229-8399-878685a9d0ffn%40googlegroups.com.


[web2py] Re: quick form styling question

2022-09-06 Thread Dave S


On Saturday, September 3, 2022 at 5:19:42 PM UTC-7 Dave S wrote:

> Warning: everything I know about BootStrap (BS4) I've learned from the 
> examples, so I Don't Know Much.
>
>
Slightly related question:  what is the best widget for a factory form 
field using IS_IN_SET[ .. several strings ...]?  If I leave it default, I 
get a pull-down caret on the right, and autocompletion, but no cursor token 
to show the field is active.  if I use SQLFORM.widgets.strings.widget, I 
get the curson but no pull-down or autocomplete.

/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/22109881-0965-49d5-8e89-8e7ecbc3dc6an%40googlegroups.com.


[web2py] Re: quick form styling question

2022-09-06 Thread Dave S

On Sunday, September 4, 2022 at 7:51:28 PM UTC-7 silvia...@gmail.com wrote:

> Can you show me a picture how it looks right now and post the css so I 
> have an idea ?
>
>
It's all in-box stuff,  and with SQLFORM.factory() I set  autofocus by 
specifying that in the widget option for the appropriate field.
Field('firstid',
  
requires=[IS_NOT_EMPTY(),IS_INT_IN_RANGE(99900,105000)],
  label = "Need picture IDs to swap",
  widget = lambda f, v: 
SQLFORM.widgets.integer.widget(f, v, _autofocus=True)),

Adding   
   _class = "col-sm-3",
does not change the field appearance, because it doesn't override the 
default class.

Adding 
_style = "width: 50%",
to the field does not change it's appearance,  but moving it to the 
enclosing form definition shrinks the width, but still has two rows stacked.

If I use FORM(), I get the single row picture, but not widgets.

/dps

snide...@gmail.com schrieb am Sonntag, 4. September 2022 um 07:19:42 UTC+7:
>
>> Warning: everything I know about BootStrap (BS4) I've learned from the 
>> examples, so I Don't Know Much.
>>
>> I have a form with 2 integer fields, one with a label, and the other uses 
>> the input ID for a label.  If I use FORM(), the fields come out 
>> appropriately sized for about 6 digits and side by side.  If I use 
>> SQLFORM.factory(), the fields come out 100% of a div with class "col-sm-9", 
>> which is huge.   I like the look of the FORM() results, but I want 
>> autofocus and other support of the factory form.
>>
>> How can I wrestle the latter to look more like the former?  I can change 
>> the width of the whole form (_style = "width:  50%"), but that line doesn't 
>> work in the field itself, and the inputs remain as separate divs.  The 
>> class defaults to "form-horizontal", so I tried setting it to 
>> "form-vertical", but that didn't work ... I was adding a class, not 
>> replacing a class.
>>
>> (And beside,s that raises the question, what are those two classes really 
>> doing?)
>>
>> Thanks for any advice,
>>
>> Dave S
>> /dps
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0fa900dc-9d8c-4e3a-868b-71ac9d9c9177n%40googlegroups.com.


[web2py] quick form styling question

2022-09-03 Thread Dave S
Warning: everything I know about BootStrap (BS4) I've learned from the 
examples, so I Don't Know Much.

I have a form with 2 integer fields, one with a label, and the other uses 
the input ID for a label.  If I use FORM(), the fields come out 
appropriately sized for about 6 digits and side by side.  If I use 
SQLFORM.factory(), the fields come out 100% of a div with class "col-sm-9", 
which is huge.   I like the look of the FORM() results, but I want 
autofocus and other support of the factory form.

How can I wrestle the latter to look more like the former?  I can change 
the width of the whole form (_style = "width:  50%"), but that line doesn't 
work in the field itself, and the inputs remain as separate divs.  The 
class defaults to "form-horizontal", so I tried setting it to 
"form-vertical", but that didn't work ... I was adding a class, not 
replacing a class.

(And beside,s that raises the question, what are those two classes really 
doing?)

Thanks for any advice,

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1dc54c3f-3603-4885-8fbc-0faa151d46den%40googlegroups.com.


[web2py] Re: Change Form Redirect URL depending on selection

2022-09-03 Thread Dave S


On Monday, August 29, 2022 at 3:20:22 AM UTC-7 silvia...@gmail.com wrote:

> That would be my controller function I know it is totally wrong but dont 
> know what tu put in there to be honest 
>
>
> def add():
> form = SQLFORM(db.projects, _name='form_add')
> 
> if country in (countryt1)
> redirect(URL('view', vars=dict(countryt1=countryt1))  
> return locals()
>

Well, maybe if you can mock up some screen shots showing  what you want the 
user to see, we can provide less vague advice.  
You may be wanting some extra buttons in your form besides the submit 
button.

BTW, if you're wanting the "country" variable to come from "form_add", you 
need to say something like
 if form_add.vars.country in  thesetofcountries:

If you're looking up the country in a database table, something like
countrydata = db.countryt1[db.countryt1.countryname == 
form_add.vars.country]
  if countrydata:

See 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Shortcuts>
and the paragrapsh following that.

/dps
 

>
> snide...@gmail.com schrieb am Montag, 29. August 2022 um 15:27:25 UTC+7:
>
>> On Sunday, August 28, 2022 at 7:50:27 PM UTC-7 silvia...@gmail.com wrote:
>>
>>> Actually I have 3 endpoints tier 1 tier 2 and tier 3 so example if 
>>> choosing Germany it should redirect to www.website/tier1.com if 
>>> choosing for example Viertnam it should redirect to www.website/
>>> tier3.com that is what I try to achieve but one thing is I have all my 
>>> countries in arrays sorted from tier 1 to tier 3. 
>>>
>>>
>> If those arrays are globally defined (as in db.py), then you just do 
>>if country in tier1_array:  redirect(URL("tier1.com", ...))"
>> which is pretty much the same as Jim's suggestion.  If you need to look 
>> into the database which tier the country is in,  you probably would look 
>> that up using one of the shortcuts shown in the DAL chapter of the book.
>>
>> /dps
>>
>>  
>>
>>> Jim S schrieb am Freitag, 26. August 2022 um 19:36:30 UTC+7:
>>>
 It is doing to depend on how your URLs are structured for each country 
 page.  I'm guessing you'll have a different endpoint for each country in 
 your set of countries.

 Likewise for Companies.  You said 'if I select company I want to 
 redirect to company'.  Based on the code you posted I'm not sure what that 
 means.  You don't have a 'company' field, just an entity type called 
 country.  What is the endpoint that you want it to redirect to?

 -Jim


 On Thursday, August 25, 2022 at 10:37:51 PM UTC-5 silvia...@gmail.com 
 wrote:

> Sure thanks in advance that is my DB so for example if I select 
> company I want it to redirect to company and if I select a certrain 
> country 
> lets say germany or so I want it to redirect to the german page of 
> company 
> would that be possible ?
>
> db.define_table('partner',
> Field('name'),
> Field('address'),
> Field('country',requires=IS_IN_SET(countries)),
> Field('postalcode'),
> Field('entity_type',requires=IS_IN_SET(['Company','Person'])),
> Field('partner_manager', 'reference auth_user', requires = 
> IS_IN_DB(db, 'auth_user.id','%(last_name)s')),
> Field('email'),
> Field('web'))
>
> that is my controller:
>
> def partner():
> form = SQLFORM(db.partner, _name='form_partner')
> if form.process().accepted:
> session.flash = 'Partner added !'
> redirect(URL('partnerlist'))
> else: 
> session.flash = 'Please try again !'
> return dict(form=form)
> Jim S schrieb am Donnerstag, 25. August 2022 um 22:30:56 UTC+7:
>
>> Can you share the code you have so far?
>>
>> I'd probably do something like:
>>
>> form = SQLFORM.factory(...your form definition here...)
>>
>> if form.process().accepted:
>> if form.vars.field_1 == 'some test case you want to redirect on':
>> redirect(URL('my_redirect_url', vars=dict(my vars to pass to 
>> the redirect))
>> elif form.vars.field_2 == 'another test case you want to redirect 
>> on':
>> redirect(URL('my other redirect url')
>>
>> -Jim
>>
>> On Thursday, August 25, 2022 at 12:48:05 AM UTC-5 silvia...@gmail.com 
>> wrote:
>>
>>> I have a form with a few selections but I want to redirect it to a 
>>> other page depends on the selection does someone know how to do that ?
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the 

[web2py] Re: Web2py deployment on a local so all computers in the network can acess it

2022-09-03 Thread Dave S


On Monday, August 29, 2022 at 3:13:02 AM UTC-7 silvia...@gmail.com wrote:

> I will run it on a virtual server I think
>

Sounds like a good choice.  Many virtual server providers make provisioning 
easy.

/dps
 

>
> snide...@gmail.com schrieb am Montag, 29. August 2022 um 15:14:58 UTC+7:
>
>> On Wednesday, August 24, 2022 at 7:59:43 PM UTC-7 silvia...@gmail.com 
>> wrote:
>>
>>> Thanks Tom I will try that
>>>
>>> Tom Clerckx schrieb am Mittwoch, 24. August 2022 um 16:53:30 UTC+7:
>>>
 Not sure what information you're looking for.
 There is no dependency on having an internet connection to deploy your 
 web2py service.

 With respect to deployment itself, you can follow the deployment 
 recipes in the web2py manual.

 Tom.


>> Yes, the approach for an intranet is basically the same as for the 
>> world-wide realm, but you don't advertise the server outside (you don't 
>> have to list it on a public DNS, and maybe don't have to register a 
>> domain).   The details vary mainly based on the host envirornment of the 
>> server.  If you have a complete choice, I recommend a linux host (or 
>> virtual host) and an nginx front-end.
>>
>> If you're constrained to using an existing environment., you may have 
>> less freedom to assemble the perfect setup.  What sort setup will the 
>> server be running on?
>>
>> /dps
>>
>>
>>
>> On Wednesday, August 24, 2022 at 11:49:13 AM UTC+2 silvia...@gmail.com 
 wrote:

> I would like to deploy web2py on a local server but I dont know what 
> to do exactly it will be the local server will not be connected to the 
> Internet so it will be more used as an intranet. Would be great if 
> someone 
> can help me out.



-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/483da7be-074a-470b-b4e2-c949173142f3n%40googlegroups.com.


[web2py] Re: Change Form Redirect URL depending on selection

2022-08-29 Thread Dave S

On Sunday, August 28, 2022 at 7:50:27 PM UTC-7 silvia...@gmail.com wrote:

> Actually I have 3 endpoints tier 1 tier 2 and tier 3 so example if 
> choosing Germany it should redirect to www.website/tier1.com if choosing 
> for example Viertnam it should redirect to www.website/tier3.com that is 
> what I try to achieve but one thing is I have all my countries in arrays 
> sorted from tier 1 to tier 3. 
>
>
If those arrays are globally defined (as in db.py), then you just do 
   if country in tier1_array:  redirect(URL("tier1.com", ...))"
which is pretty much the same as Jim's suggestion.  If you need to look 
into the database which tier the country is in,  you probably would look 
that up using one of the shortcuts shown in the DAL chapter of the book.

/dps

 

> Jim S schrieb am Freitag, 26. August 2022 um 19:36:30 UTC+7:
>
>> It is doing to depend on how your URLs are structured for each country 
>> page.  I'm guessing you'll have a different endpoint for each country in 
>> your set of countries.
>>
>> Likewise for Companies.  You said 'if I select company I want to redirect 
>> to company'.  Based on the code you posted I'm not sure what that means.  
>> You don't have a 'company' field, just an entity type called country.  What 
>> is the endpoint that you want it to redirect to?
>>
>> -Jim
>>
>>
>> On Thursday, August 25, 2022 at 10:37:51 PM UTC-5 silvia...@gmail.com 
>> wrote:
>>
>>> Sure thanks in advance that is my DB so for example if I select company 
>>> I want it to redirect to company and if I select a certrain country lets 
>>> say germany or so I want it to redirect to the german page of company would 
>>> that be possible ?
>>>
>>> db.define_table('partner',
>>> Field('name'),
>>> Field('address'),
>>> Field('country',requires=IS_IN_SET(countries)),
>>> Field('postalcode'),
>>> Field('entity_type',requires=IS_IN_SET(['Company','Person'])),
>>> Field('partner_manager', 'reference auth_user', requires = IS_IN_DB(db, 
>>> 'auth_user.id','%(last_name)s')),
>>> Field('email'),
>>> Field('web'))
>>>
>>> that is my controller:
>>>
>>> def partner():
>>> form = SQLFORM(db.partner, _name='form_partner')
>>> if form.process().accepted:
>>> session.flash = 'Partner added !'
>>> redirect(URL('partnerlist'))
>>> else: 
>>> session.flash = 'Please try again !'
>>> return dict(form=form)
>>> Jim S schrieb am Donnerstag, 25. August 2022 um 22:30:56 UTC+7:
>>>
 Can you share the code you have so far?

 I'd probably do something like:

 form = SQLFORM.factory(...your form definition here...)

 if form.process().accepted:
 if form.vars.field_1 == 'some test case you want to redirect on':
 redirect(URL('my_redirect_url', vars=dict(my vars to pass to 
 the redirect))
 elif form.vars.field_2 == 'another test case you want to redirect 
 on':
 redirect(URL('my other redirect url')

 -Jim

 On Thursday, August 25, 2022 at 12:48:05 AM UTC-5 silvia...@gmail.com 
 wrote:

> I have a form with a few selections but I want to redirect it to a 
> other page depends on the selection does someone know how to do that ?



-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7fc4aff7-cfc4-4c00-88fb-c87817ddc527n%40googlegroups.com.


[web2py] Re: Web2py deployment on a local so all computers in the network can acess it

2022-08-29 Thread Dave S

On Wednesday, August 24, 2022 at 7:59:43 PM UTC-7 silvia...@gmail.com wrote:

> Thanks Tom I will try that
>
> Tom Clerckx schrieb am Mittwoch, 24. August 2022 um 16:53:30 UTC+7:
>
>> Not sure what information you're looking for.
>> There is no dependency on having an internet connection to deploy your 
>> web2py service.
>>
>> With respect to deployment itself, you can follow the deployment recipes 
>> in the web2py manual.
>>
>> Tom.
>>
>>
Yes, the approach for an intranet is basically the same as for the 
world-wide realm, but you don't advertise the server outside (you don't 
have to list it on a public DNS, and maybe don't have to register a 
domain).   The details vary mainly based on the host envirornment of the 
server.  If you have a complete choice, I recommend a linux host (or 
virtual host) and an nginx front-end.

If you're constrained to using an existing environment., you may have less 
freedom to assemble the perfect setup.  What sort setup will the server be 
running on?

/dps



On Wednesday, August 24, 2022 at 11:49:13 AM UTC+2 silvia...@gmail.com 
>> wrote:
>>
>>> I would like to deploy web2py on a local server but I dont know what to 
>>> do exactly it will be the local server will not be connected to the 
>>> Internet so it will be more used as an intranet. Would be great if someone 
>>> can help me out.
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d68e1ba4-e93a-4c82-b6ff-35b636a5852bn%40googlegroups.com.


[web2py] Re: Bug in gluon/scheduler.py

2022-08-21 Thread Dave S


On Saturday, August 20, 2022 at 11:39:55 AM UTC-7 Tom Clerckx wrote:

> Our tasks are added using scheduler.queue_task(...) function.
>
> By default, we set the period to 0 
>

Why?  If you don't know the period, why are you queuing it?   Or are you 
using the "cron" type of task scheduling? 

 

> Later on we added to the defaults : prevent_drift = True
>
> It's this last change that triggered the observed error.
>
>
Eveything I know about the scheduler has been shown to me by Stefan 
(Niphlod), who wrote the subsystem and the tests.  I suspect I would have 
to spend quite a bit of time to come up with an analysis of what is really 
wrong, but I'm really suspicious of queuing a period of 0.

/dps

 

>
>
>
>
> On Friday, August 19, 2022 at 12:49:05 PM UTC+2 snide...@gmail.com wrote:
>
>> On Monday, August 8, 2022 at 3:50:26 AM UTC-7 Tom Clerckx wrote:
>>
>>> Version:
>>> Version 2.22.5-stable+timestamp.2022.06.04.18.13.51
>>>
>>> There is a problem with the calculation of next_run_time in 
>>> gluon/scheduler.py at line 1024
>>>
>>> It calculates:
>>> steps = secondspassed // task.period + 1
>>>
>>> However, there is no check done for task.period being 0
>>>
>>> This can cause the following scheduler error:
>>> ZeroDivisionError: float divmod()
>>>
>>> I think it would be better to initialize next_run_time and change the 
>>> last else condition to "elif task.period".
>>>
>>
>> How did you get task.period == 0?
>>
>> I'm wondering if this is a valid use-case; the scheduler has quite a test 
>> suite.
>>
>> /dps
>>  
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/38a740d4-1fb5-4454-a825-da76b7220da2n%40googlegroups.com.


[web2py] Re: Bug in gluon/scheduler.py

2022-08-19 Thread Dave S


On Monday, August 8, 2022 at 3:50:26 AM UTC-7 Tom Clerckx wrote:

> Version:
> Version 2.22.5-stable+timestamp.2022.06.04.18.13.51
>
> There is a problem with the calculation of next_run_time in 
> gluon/scheduler.py at line 1024
>
> It calculates:
> steps = secondspassed // task.period + 1
>
> However, there is no check done for task.period being 0
>
> This can cause the following scheduler error:
> ZeroDivisionError: float divmod()
>
> I think it would be better to initialize next_run_time and change the last 
> else condition to "elif task.period".
>

How did you get task.period == 0?

I'm wondering if this is a valid use-case; the scheduler has quite a test 
suite.

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/bb3962dc-6e9f-4d9b-8689-20a7e47cec54n%40googlegroups.com.


[web2py] Next 100 broken in appadmin queries?

2022-08-19 Thread Dave S
Is it just me, or has the "next 100" button (and the "previous 100" button) 
stopped working in 2.22.3?   When I try to use them, I get a form error 
with Query showing blank and the message "Cannot be empty".

URL: http://192.168.4.21:8008/QuarterMaster/appadmin/select/db?start=100
Query on the previous page (the start=0 page):  "db.QuarterMaster.id>0"

This seems pretty serious to me.

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/92ced4bd-98be-4d5f-b865-305efce55b70n%40googlegroups.com.


[web2py] Re: retrieving GET request (parameters; @service.json)

2022-08-06 Thread Dave S


On Friday, August 5, 2022 at 6:52:00 PM UTC-7 Dave S wrote:

> On Wednesday, August 3, 2022 at 12:27:11 PM UTC-7 Vlad wrote:
>
>> If the following is exposed:
>>
>> @service.json
>> def test(a, b):
>> 
>>
>> it works just fine when I submit url?a=val1;b=val2
>>
>> but when I submit a dictionary - {"a":"val1", "b":val2"} - I can't figure 
>> out how to catch the parameters in the function test()  - it gives an error 
>> that they are missing. 
>>
>> I am not fully controlling the client that does the request - I am just 
>> giving this client url and the dictionary containing parameters. 
>>
>> on the server side - i.e. in test() - how do I figure out what exactly 
>> the client is doing - how exactly the parameters are passed so that I could 
>> read and process them in test()? 
>>
>
>
> I get an "unexpected keyword argument" exception if I try to use the 
> dictionary in the url.  The manual only describes 2 syntaxes:
>   the test?a=val1=val2  version (note, '&' not ';'), and using 
> test/val1/val2.
>
> request.args is ['json', 'test'] for the first form, and ['json', 'test', 
> 'val1', 'val2'] for the second.
>

request.vars  and  
respectively. 

>
>  http://web2py.com/books/default/chapter/29/10/services#Remote-procedure-calls
> >
>
> /dps
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/71076817-c275-451d-a395-58295f598550n%40googlegroups.com.


[web2py] Re: retrieving GET request (parameters; @service.json)

2022-08-05 Thread Dave S


On Wednesday, August 3, 2022 at 12:27:11 PM UTC-7 Vlad wrote:

> If the following is exposed:
>
> @service.json
> def test(a, b):
> 
>
> it works just fine when I submit url?a=val1;b=val2
>
> but when I submit a dictionary - {"a":"val1", "b":val2"} - I can't figure 
> out how to catch the parameters in the function test()  - it gives an error 
> that they are missing. 
>
> I am not fully controlling the client that does the request - I am just 
> giving this client url and the dictionary containing parameters. 
>
> on the server side - i.e. in test() - how do I figure out what exactly the 
> client is doing - how exactly the parameters are passed so that I could 
> read and process them in test()? 
>


I get an "unexpected keyword argument" exception if I try to use the 
dictionary in the url.  The manual only describes 2 syntaxes:
  the test?a=val1=val2  version (note, '&' not ';'), and using 
test/val1/val2.

request.args is ['json', 'test'] for the first form, and ['json', 'test', 
'val1', 'val2'] for the second.

http://web2py.com/books/default/chapter/29/10/services#Remote-procedure-calls>

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/488e9a10-232d-487e-a764-7aadfa23f512n%40googlegroups.com.


[web2py] Re: Send code to sms # for 2 factor auth

2022-08-05 Thread Dave S

On Tuesday, July 19, 2022 at 2:34:44 PM UTC-7 Jim S wrote:

> For those who care, this was super-simple to implement once I took the 
> time to read the manual.  I implemented using RingCentral as a transport to 
> send sms messages.
>
> -Jim
>

I love a self-help success story!  Congratulations!  

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5b2aa0a5-545d-42d7-a3c3-fb98fcd5ed8en%40googlegroups.com.


[web2py] download uploaded files bump in the road

2022-07-13 Thread Dave S
The upload files feature in the DAL encodes the original name in base64 and 
adds that to the unique portion of the filename on the server.  Bad news if 
you want to download one of those files and the base64 '=' character 
appears in the filename., because the browser thinks you doing an illegal 
url. 

This may also apply to upload/download in py4web, depending on the base64 
setup there.

/dps



-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/27518524-4ebb-4ac2-a599-5458e369185an%40googlegroups.com.


Re: [web2py] Re: sessions folder under application

2022-07-13 Thread Dave S


On Thursday, July 7, 2022 at 1:07:02 AM UTC-7 Niphlod wrote:

> there's an handy session cleaner   web2py/sessions2trash.py at master · 
> web2py/web2py (github.com) 
>  and 
> a whole section in the docs  web2py - Deployment recipes 
> 


Hey, Stefan, hope you're keeping well!

(and I've often appreciated that script, too)

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/45f917fa-de63-4eef-bd53-0aca182e9e5dn%40googlegroups.com.


[web2py] melding css and w2p locals

2022-06-15 Thread Dave S
I've got a page where I load an image, and then if you click on the image 
it scales down (my preferred default is load full size, and then shrink as 
needed).  Yes, the browser will do this (with the opposite default) 
automatically if it is a bare image, but I want this to happen on *my* 
wrapper page, with the links I like to have at the ready, and the tooltip 
set.

I can pass the image dimensions just fine, and I can pass down a scale 
factor just fine (as in, I've figured out by hand the viewport height, and 
scale to that value).   But I want to know the viewport size dynamically, 
and scale to the current value.

I've tried
transform:  scale( calc( 100vh / {{ = picheight }} px)) ;
but this results in no scaling (probably an error)

Yes, I could do javascript to replace the python-assisted CSS, but I'd 
rather not.  Does anybody have a suggestion?  webp2y apparently doesn't 
know the viewport size (doesn't seem to be a subfield of the request var), 
and I don't know another CSS-side value for the viewport height than the vh 
units.

Thanks

Dave S
/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/36bda250-e28a-4cc6-80b1-9be630fd9738n%40googlegroups.com.


[web2py] Re: App crushed during a web2py upgrade

2022-06-13 Thread Dave S
On Saturday, June 11, 2022 at 10:04:09 PM UTC-7 mostwanted wrote:

> It says 
> * cannot import name prevent_open_redirect*
>
> under code listing it highlighted the line in red
>
> import re
> from gluon.admin import *
> from gluon.fileutils import abspath, read_file, write_file
> from gluon.utils import web2py_uuid
> *from gluon.tools import Config, prevent_open_redirect*
> from gluon.compileapp import find_exposed_functions
> from glob import glob
> from gluon._compat import iteritems, PY2, pickle, xrange, urlopen, 
> to_bytes, StringIO, to_native, reload
> import gluon.rewrite
>

Hmmm, I can find that function in the 2.22.3   version, so It's still 
around.  It will take someone with a more intimate understanding of the 
subsystem to explain the problem.

I do use a load() call in my apps, but the one I use the most loads a 
form.  It is not set up as a callback.

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9d3f35c0-6461-4ed2-a6f3-efcdea9184ecn%40googlegroups.com.


[web2py] Re: App crushed during a web2py upgrade

2022-06-11 Thread Dave S
On Saturday, June 11, 2022 at 1:11:03 AM UTC-7 mostwanted wrote:

> I was able to resolve the problem, I reloaded the app from my 
> pythonanywhere account and i was able to access my admin but i still can 
> not get my callback to work as expected. Can someone please help me! What 
> am i doing wrong or what do i need to do?! 
> It says my web2py is upgraded to 2.22.5-stable+timestamp
>
> {{=A(company.no_of_ppadb_codes, _href='#', 
> callback=URL('ppadb_codes.load', args=company.id), target="content", 
> _class="show_codes")}}
> 
>
>

So now that you can read tickets again, what is the ticket for this one?

/dps
 

> Regards
> On Saturday, June 11, 2022 at 9:53:55 AM UTC+2 mostwanted wrote:
>
>> I tried to upgrade my app to the latest version because the 
>> callback{{=A(link, callback=URL())}} functionality kept redirecting instead 
>> of calling the page to the current page div but it crushed
>>
>> When i open my admin gape i get (*Ticket issued: 
>> admin/41.77.89.202.2022-06-11.07-43-03.e76169bb-1516-4236-ab3b-6ee56ffdda39 
>> )
>>  
>> *which does not lead me anywhere, everytime i click on it it opens 
>> another page in another tab with the same ticket message, what can i do, 
>> please help me!!
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0c5ff7f4-e7ed-495d-b68b-0cea0d60b306n%40googlegroups.com.


Re: [web2py] Re: Pillow not imported by web2py-win

2022-05-13 Thread Dave S
On Monday, May 9, 2022 at 5:19:42 PM UTC-7 Dave S wrote:

> On Sunday, May 8, 2022 at 1:55:52 AM UTC-7 nico...@gmail.com wrote:
>
>> Hi Dave,
>>
>> the simplest solution is surely to use web2py from source - and it's even 
>> better on py3 if possible.
>>
>> If you're stick with the frozen app (apart from my simple guide on this 
>> at 
>> https://github.com/nicozanf/web2py-pyinstaller/blob/master/HOWTO-modules.md),
>>  
>> I don't have any special advise - you have to try all the possibilities...
>> Also, check what happens if you try to import the module from the python 
>> shell of web2py; maybe you'be a clearer traceback.
>>
>> Unfortunately the traceback above does not help me in understanding the 
>> issue. But it seems to be similar to this: 
>> https://stackoverflow.com/questions/63123335/distutils-spawn-not-available-unless-imported
>>  
>> , maybe you could follow their advices.
>>
>>
>> Ciao,
>> Nico
>>
>>
> Thanks, this gives me something to start looking at, and the fallback of 
> moving to source.  I'll try to report back when I have success.
>

You'll all be relieved to know that Pillow works fine with my installation 
of Python3 (3.10), at least for the manipulations I am interested in, 
and that I can  import it into a web2py shell just fine.  I'll soon be 
looking at how much 2->3 effort has been hiding behind the curtain, but I 
think I've got the "print -> print()" part covered.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/965e7d13-ebc7-4180-8d5b-97d2ed4ad664n%40googlegroups.com.


[web2py] Re: simple error on QLFORM.factory

2022-05-12 Thread Dave S
On Thursday, May 12, 2022 at 4:05:34 PM UTC-7 Dave S wrote:

> On Thursday, May 12, 2022 at 8:26:17 AM UTC-7 Ramos wrote:
>
>> Hello
>> Just trying to teach someone some web2py stuff from the web2py book and i 
>> got stuck at the beginning.
>> My friend computer returns this error.
>> The same code in my pc is ok
>> def first():
>> form = SQLFORM.factory(Field('visitor_name',
>>  label='what is your name?',
>>  requires=IS_NOT_EMPTY()))
>>
>>
>> any help ?
>>
>> Regards
>>
>
> Without more clues, the first thing I'd check is that both machines are 
> using the same version of Python.
>
>
Which perhaps should be 3.10 

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ef211ed3-a111-4381-91fe-0b3bb99aab64n%40googlegroups.com.


[web2py] Re: simple error on QLFORM.factory

2022-05-12 Thread Dave S


On Thursday, May 12, 2022 at 8:26:17 AM UTC-7 Ramos wrote:

> Hello
> Just trying to teach someone some web2py stuff from the web2py book and i 
> got stuck at the beginning.
> My friend computer returns this error.
> The same code in my pc is ok
> def first():
> form = SQLFORM.factory(Field('visitor_name',
>  label='what is your name?',
>  requires=IS_NOT_EMPTY()))
>
>
> any help ?
>
> Regards
>

Without more clues, the first thing I'd check is that both machines are 
using the same version of Python.

/dps
 

> Error ticket for "teste" Ticket ID 
>
> 127.0.0.1.2022-05-12.16-13-34.312f7acc-fcaf-4e3b-baff-b070321e1706
>  __init__() got an unexpected keyword argument 
> 'requires' Versão 
> web2py™ Version 2.22.3-stable+timestamp.2022.02.15.15.14.38 
> Python Python 3.8.3rc1: 
> C:\Users\convidado\AppData\Local\Programs\Python\Python38-32\python.exe 
> (prefix: C:\Users\convidado\AppData\Local\Programs\Python\Python38-32) 
> Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:/web2py/applications/teste/controllers/teste.py" 
> , line 
> 47, in 
>   File "C:\web2py\gluon\globals.py", line 430, in 
> self._caller = lambda f: f()
>   File "C:/web2py/applications/teste/controllers/teste.py" 
> , line 
> 34, in primeiro
> form = SQLFORM.factory(Field('visitor_name',requires=IS_NOT_EMPTY()))
> TypeError: __init__() got an unexpected keyword argument 'requires'
>
>
>
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fb389da8-3471-4990-8d08-e2e9f544c9b0n%40googlegroups.com.


[web2py] Re: Pillow not imported by web2py-win

2022-05-12 Thread Dave S
On Friday, May 6, 2022 at 11:00:42 PM UTC-7 Massimo Di Pierro wrote:

> can you try "pip install pillow" instead of putting it in 
> C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages 
> Not all packages like to be there and it can create problems.
>
>
I'm not sure about "can" ...  the package was pip installed into the 
standalone python, and then copied from that directory's site-packages to 
the web2py.exe's site-packages.  Does pip work directly in web2py.exe 
environment, with py.dll?

/dps
 

>
> On Wednesday, 20 April 2022 at 00:26:48 UTC-7 snide...@gmail.com wrote:
>
>> I want to do some simple image manipulation using Pillow.  I've been 
>> using Pillow in a standalone Python27 setup, and now I want to use it 
>> within my w2p app.
>>
>> Since I had done the PIP into the standalone, I copied the files from 
>> that site-packages to the web2py/site-packages.  The function that needed 
>> to use the package did 
>>
>> from PIL import Image
>>
>> which resulted in the stacktrace:
>>
>> Traceback (most recent call last):
>> File 
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py",
>>  
>> line 219, in restricted
>> exec(ccode, environment)
>> File 
>> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>>  
>> , line 
>> 2691, in 
>> File 
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\globals.py", 
>> line 430, in 
>> self._caller = lambda f: f()
>> File 
>> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>>  
>> , line 
>> 1059, in display
>> img = Image.open(deep_path)
>> File 
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>>  
>> line 2807, in open
>> if init():
>> File 
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>>  
>> line 427, in init
>> __import__("PIL.%s" % plugin, globals(), locals(), [])
>> File 
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\custom_import.py",
>>  
>> line 59, in custom_importer
>> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>> File 
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\EpsImagePlugin.py",
>>  
>> line 51, in 
>> which = distutils.spawn.find_executable
>> AttributeError: 'module' object has no attribute 'spawn'
>>
>> What are my options here, and what is the simplest way to get past this?  
>> Should I
>>
>> * try to get the appropriate distutils?
>> * try to run web2py from source on the standalone 2.7?
>> * try to run web2py-win's 3.x and switch to the matching Pillow?
>>
>> (I think I have a standalone 3.10 already, but I haven't run Pillow on 
>> that)
>>
>> Thanks for the sage advice.
>>
>> /dps
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/eeccb107-9b13-40e2-b8ef-f1222b1f2ab0n%40googlegroups.com.


Re: [web2py] Re: Pillow not imported by web2py-win

2022-05-09 Thread Dave S


On Sunday, May 8, 2022 at 1:55:52 AM UTC-7 nico...@gmail.com wrote:

> Hi Dave,
>
> the simplest solution is surely to use web2py from source - and it's even 
> better on py3 if possible.
>
> If you're stick with the frozen app (apart from my simple guide on this at 
> https://github.com/nicozanf/web2py-pyinstaller/blob/master/HOWTO-modules.md), 
> I don't have any special advise - you have to try all the possibilities...
> Also, check what happens if you try to import the module from the python 
> shell of web2py; maybe you'be a clearer traceback.
>
> Unfortunately the traceback above does not help me in understanding the 
> issue. But it seems to be similar to this: 
> https://stackoverflow.com/questions/63123335/distutils-spawn-not-available-unless-imported
>  
> , maybe you could follow their advices.
>
>
> Ciao,
> Nico
>
>
Thanks, this gives me something to start looking at, and the fallback of 
moving to source.  I'll try to report back when I have success.

Dave S
/dps

 

> Il giorno sab 7 mag 2022 alle ore 08:00 Massimo Di Pierro <
> massimo@gmail.com> ha scritto:
>
>> can you try "pip install pillow" instead of putting it in 
>> C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages 
>> Not all packages like to be there and it can create problems.
>>
>>
>> On Wednesday, 20 April 2022 at 00:26:48 UTC-7 snide...@gmail.com wrote:
>>
>>> [mumble,mumble]
>
>
 
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/4b40db47-f9cc-4d30-88b8-aa33a8bdc8a0n%40googlegroups.com.


[web2py] Pillow not imported by web2py-win

2022-04-20 Thread Dave S
I want to do some simple image manipulation using Pillow.  I've been using 
Pillow in a standalone Python27 setup, and now I want to use it within my 
w2p app.

Since I had done the PIP into the standalone, I copied the files from that 
site-packages to the web2py/site-packages.  The function that needed to use 
the package did 

from PIL import Image

which resulted in the stacktrace:

Traceback (most recent call last):
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py", 
line 219, in restricted
exec(ccode, environment)
File 
"C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
 
, line 
2691, in 
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\globals.py", line 
430, in 
self._caller = lambda f: f()
File 
"C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
 
, line 
1059, in display
img = Image.open(deep_path)
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
 
line 2807, in open
if init():
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
 
line 427, in init
__import__("PIL.%s" % plugin, globals(), locals(), [])
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\custom_import.py",
 
line 59, in custom_importer
return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\EpsImagePlugin.py",
 
line 51, in 
which = distutils.spawn.find_executable
AttributeError: 'module' object has no attribute 'spawn'

What are my options here, and what is the simplest way to get past this?  
Should I

* try to get the appropriate distutils?
* try to run web2py from source on the standalone 2.7?
* try to run web2py-win's 3.x and switch to the matching Pillow?

(I think I have a standalone 3.10 already, but I haven't run Pillow on that)

Thanks for the sage advice.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b331ae3c-65ba-48aa-8165-728bcd989d53n%40googlegroups.com.


[web2py] Re: Best way to have form submit disabled until file selected

2022-04-11 Thread Dave S
On Sunday, April 10, 2022 at 3:10:27 PM UTC-7 Ramos wrote:

> Hello i have a form with a file to upload.
> What is the best web2py way to have the submit button disabled until the 
> user selects a file  to upload?
> Regards
> António
>

I'd say javascript, since the "required" validator only works after the 
form is submitted.

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c408410a-efe6-4468-9153-1943e6644935n%40googlegroups.com.


[web2py] SQLTABLE and glosses

2022-04-06 Thread Dave S
I want to add a feature to a page where I'm using SQLTABLE to display some 
of the columns of a db table.  I want to add tooltips to some of the 
columns I'm displaying. and I want to create those tooltips from columns 
I'm not displaying.  Is there a way to do that still using SQLTABLE, or do 
I have to do my own translation of rows into HTML?

The two ways of doing tooltips for table cells that I know of are the title 
attribute and span-and-hover technique.  The title attribute could be set 
with kwargs, but doing that wouldn't be row-specific.

Tanks a lot.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/21dfdcd6-f57f-42b3-a3b7-b24f6fef8833n%40googlegroups.com.


[web2py] Re: Strange behavior slows server down

2022-04-06 Thread Dave S
Another off-topic complaint:  The current Google Groups version (for about 
a year now) will show the correct number of posts in a thread when you're 
looking at the conversations page, but when you open the thread, it only 
shows posts you've already read (in a previous read) and has a banner on 
the bottom for "2 new posts . read?"

This can hours later.

/dps "yeah, I'm griping"


On Friday, April 1, 2022 at 3:17:14 PM UTC-7 Dave S wrote:

> So far, I'm not seeing the problem with Opera as the local client, or 
> Chome across the network, but I haven't stressed things yet.
>
> BTW, have others of you seen a problem [unrelated to web2py] where Chrome 
> on W11 Home doesn't properly redraw the page after coming out of sleep?  OS 
> Build 22000.556 and Chrome  99.0.4844.84 (64-bit).
>
> /dps
>
>
> On Wednesday, March 30, 2022 at 2:53:15 AM UTC-7 Dave S wrote:
>
>> Recently, I've been seeing one of my test web2py servers get bogged down, 
>> and sometimes fail to respond to the user.  When this happens, I find the 
>> web2py.log file is getting filled with lines like
>>
>> 2022-03-29 17:38:31,480 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:38:46,710 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:38:47,776 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:39:00,003 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:39:21,467 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:40:21,421 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:41:21,367 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>> 2022-03-29 17:42:21,348 - web2py.scheduler.Dave-PC#8844 - DEBUG - 
>> defining tables (migrate=True)
>>
>> This continues even if the user (me) stops making requests.  This being 
>> Windows, I launch the server using the little GUI tool that includes a 
>> traffic monitor (seismograph of incoming requests), and that shows a 
>> regular tick that isn't connected with my clicking any links.
>>
>> The server version info:
>>
>> web2py™
>> Version 2.21.1-stable+timestamp.2020.11.28.04.10.44
>> Python
>> Python 2.7.16 (bundled)
>> The front end is the bundled Rocket code.
>>
>> The client is Chrome:
>> Version 99.0.4844.82 (Official Build) (64-bit)
>>
>> Both client and server are on a laptop:
>> EditionWindows 10 Pro
>> Version21H1
>> Installed on‎11/‎15/‎2020
>> OS build19043.1586
>> ExperienceWindows Feature Experience Pack 120.2212.4170.0
>>
>> I do have a model for a scheduler task, but I usually don't fire up the 
>> scheduler process.  If I change the filename for that model to 
>> scheduler.py.hidden, I don't get those scheduler log entries, but the 
>> seismograph still shows an event about once a minute.
>>
>> httpserver.log says it's the same three requests each time:
>>
>> 92.168.4.21, 2022-03-30 02:42:21, GET, /admin/todolist.load, HTTP/1.1, 
>> 303, 0.043000
>> 192.168.4.21, 2022-03-30 02:42:21, GET, /admin/index.load, HTTP/1.1, 404, 
>> 0.081000
>> 192.168.4.21, 2022-03-30 02:42:21, GET, /badlist/appadmin/hooks, 
>> HTTP/1.1, 200, 0.284000
>>
>> With older versions of web2py and Chrome, I've seen what I call "cache 
>> thrash"; where Chrome seemed to be issuing a blizzard of requests to 
>> refresh the cache, and web2py couldn't respond to anything else.  This 
>> would continue until I stopped the server, which often required a process 
>> kill.
>>
>> Am I see a less vicious form of cache thrash?
>>
>> I became aware of this current version of the problem when using a 
>> "public" port that is visible on the local network (having bought a new 
>> laptop), but I don't think that's the source of the problem, and the 
>> earlier version of the problem was only using 127.0.0.1 (localhost).
>>
>> /dps
>>
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/def0afb6-b8f0-4170-a360-856249f2eee0n%40googlegroups.com.


Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-04-03 Thread Dave S

On Friday, March 25, 2022 at 11:14:07 PM UTC-7 Rahul wrote:

> yes I used some things like *trunc *or *ceil *to fix it however the error 
> persists on the same line. Pretty weird. Also used what was suggested like 
> // 
> but did not work for me. I want to get this fixed soon. However, 
>  If its not possible to fix it "quickly" perhaps someone can suggest me 
> some plugin to manage fields in the layout for proper UI orientation. 
>
> All suggestions are welcome
>
> Regards,
> *Rahul*
>
>

Have you examined the type of structured_fields and it's components at the 
time of the exception?  I would add some debug prints just before the for 
statement.

/dps

On Thursday, March 24, 2022 at 4:51:46 PM UTC+5:30 snide...@gmail.com wrote:
>
>> On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:
>>
>>> This could be one problem:
>>>
>>> for i in range((max_row_lines - extra_colspan) / colspan):
>>>
>>> there are many of this. 
>>>
>>> *range* take an integer, but a division in python3 return a float...
>>>
>>>
>> Interesting, but why doesn't the exception occur in the quoted line with 
>> the range statement?
>>
>> The stack trace suggests it occurs after the for loop completes.
>>
>> (I' also dizzy from the number of places where self.structured fields get 
>> redone by enumerating itself)
>>
>> /dps
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/66548933-081a-4894-9a69-b6e38a58dfe6n%40googlegroups.com.


[web2py] Re: db.define_table("login", Field("_First Name:",requires = IS_NOT_EMPTY()), Field("_Other Names:",requires = IS_NOT_EMPTY()), Field("Profile:", "text") Field("image" ,"upload",),

2022-04-03 Thread Dave S

On Friday, April 1, 2022 at 11:29:19 PM UTC-7 igboji...@gmail.com wrote:

> this code is not working in the data base model


What does "not working" mean?  What fails?  What are you expecting?

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/632ab24f-6c91-4ebc-9cb9-ebabb982284fn%40googlegroups.com.


[web2py] Re: Strange behavior slows server down

2022-04-01 Thread Dave S
So far, I'm not seeing the problem with Opera as the local client, or Chome 
across the network, but I haven't stressed things yet.

BTW, have others of you seen a problem [unrelated to web2py] where Chrome 
on W11 Home doesn't properly redraw the page after coming out of sleep?  OS 
Build 22000.556 and Chrome  99.0.4844.84 (64-bit).

/dps


On Wednesday, March 30, 2022 at 2:53:15 AM UTC-7 Dave S wrote:

> Recently, I've been seeing one of my test web2py servers get bogged down, 
> and sometimes fail to respond to the user.  When this happens, I find the 
> web2py.log file is getting filled with lines like
>
> 2022-03-29 17:38:31,480 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:38:46,710 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:38:47,776 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:39:00,003 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:39:21,467 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:40:21,421 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:41:21,367 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
> 2022-03-29 17:42:21,348 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
> tables (migrate=True)
>
> This continues even if the user (me) stops making requests.  This being 
> Windows, I launch the server using the little GUI tool that includes a 
> traffic monitor (seismograph of incoming requests), and that shows a 
> regular tick that isn't connected with my clicking any links.
>
> The server version info:
>
> web2py™
> Version 2.21.1-stable+timestamp.2020.11.28.04.10.44
> Python
> Python 2.7.16 (bundled)
> The front end is the bundled Rocket code.
>
> The client is Chrome:
> Version 99.0.4844.82 (Official Build) (64-bit)
>
> Both client and server are on a laptop:
> EditionWindows 10 Pro
> Version21H1
> Installed on‎11/‎15/‎2020
> OS build19043.1586
> ExperienceWindows Feature Experience Pack 120.2212.4170.0
>
> I do have a model for a scheduler task, but I usually don't fire up the 
> scheduler process.  If I change the filename for that model to 
> scheduler.py.hidden, I don't get those scheduler log entries, but the 
> seismograph still shows an event about once a minute.
>
> httpserver.log says it's the same three requests each time:
>
> 92.168.4.21, 2022-03-30 02:42:21, GET, /admin/todolist.load, HTTP/1.1, 
> 303, 0.043000
> 192.168.4.21, 2022-03-30 02:42:21, GET, /admin/index.load, HTTP/1.1, 404, 
> 0.081000
> 192.168.4.21, 2022-03-30 02:42:21, GET, /badlist/appadmin/hooks, HTTP/1.1, 
> 200, 0.284000
>
> With older versions of web2py and Chrome, I've seen what I call "cache 
> thrash"; where Chrome seemed to be issuing a blizzard of requests to 
> refresh the cache, and web2py couldn't respond to anything else.  This 
> would continue until I stopped the server, which often required a process 
> kill.
>
> Am I see a less vicious form of cache thrash?
>
> I became aware of this current version of the problem when using a 
> "public" port that is visible on the local network (having bought a new 
> laptop), but I don't think that's the source of the problem, and the 
> earlier version of the problem was only using 127.0.0.1 (localhost).
>
> /dps
>
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f72ac47d-99da-4fcf-90ce-22cd09504f52n%40googlegroups.com.


[web2py] For joins, matching on a list field element.

2022-03-31 Thread Dave S
Imagine that I defined a pair of tables as

db.define_table('stuff',
Field('nickname', 'string'),
Field('durations', 'list:integer'),
 Field('tones, 'list:string'))

db.define_table('nonsense',
Field('Chapter', 'string'),
Field('timing', 'integer'),
Field('norm', 'string'))

If I know a nonsense.timing I'm interested in is 10, I can find the stuff 
that matches with

db.(db.stuff.durations.contains(10))

and the stuff that matches a nonsense.norm of "cflat" with

db.(db.stuff.tones.contains('cflat'))

But if I want to do a join, rather than a manual iteration (or nested 
selects), where the stuff.durations contains a match for some 
nonsense.timing or where the stuff.tones contains a match for some 
nonsense.norm, how do I write that?

Thanks.

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2eea53fb-a9d5-4c73-ad90-b8f5b4267a94n%40googlegroups.com.


Re: [web2py] Exporting html table as csv

2022-03-31 Thread Dave S


On Wednesday, March 30, 2022 at 8:37:29 AM UTC-7 mostwanted wrote:

> Its a permanent html table in the view with information from different 
> database tables. From there i wanna download it as CSV to be used in excel 
> reports.
>

"Permanent html table" does make sense to me.  Permanent means it is kept 
in storage and not created during page rendering.

I find I can often use cut-and-paste to transfer something from a web page 
to a spreadsheet, but this may be awkward for large tables, and maybe not 
something you want to do everyday, much less once an hour.  On the other 
hand, saving the rendered html on the client machine makes it easy to run a 
script there that parses out the table.  I have a python script I use 
frequently, but it is also something you could do in an emacs or vim 
macro.  People who keep their vbasic skills up can do it as an Excel macro.

If you're creating the html from rows selected by a join, then the example's

with open('test.csv', 'wb') as dumpfile: rows.export_to_csv_file(dumpfile)

still works, and then you can have a button to download test.csv.  If more 
than one person is going to be collecting those results, you might want to 
have a distinguishing name, either appending username to the basename, or 
using the session id.  
(refers back to 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV-one-Table-at-a-time->

/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/53334a70-2929-4f4b-85a2-28584358dde4n%40googlegroups.com.


[web2py] Strange behavior slows server down

2022-03-30 Thread Dave S
Recently, I've been seeing one of my test web2py servers get bogged down, 
and sometimes fail to respond to the user.  When this happens, I find the 
web2py.log file is getting filled with lines like

2022-03-29 17:38:31,480 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:38:46,710 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:38:47,776 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:39:00,003 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:39:21,467 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:40:21,421 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:41:21,367 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)
2022-03-29 17:42:21,348 - web2py.scheduler.Dave-PC#8844 - DEBUG - defining 
tables (migrate=True)

This continues even if the user (me) stops making requests.  This being 
Windows, I launch the server using the little GUI tool that includes a 
traffic monitor (seismograph of incoming requests), and that shows a 
regular tick that isn't connected with my clicking any links.

The server version info:

web2py™
Version 2.21.1-stable+timestamp.2020.11.28.04.10.44
Python
Python 2.7.16 (bundled)
The front end is the bundled Rocket code.

The client is Chrome:
Version 99.0.4844.82 (Official Build) (64-bit)

Both client and server are on a laptop:
EditionWindows 10 Pro
Version21H1
Installed on‎11/‎15/‎2020
OS build19043.1586
ExperienceWindows Feature Experience Pack 120.2212.4170.0

I do have a model for a scheduler task, but I usually don't fire up the 
scheduler process.  If I change the filename for that model to 
scheduler.py.hidden, I don't get those scheduler log entries, but the 
seismograph still shows an event about once a minute.

httpserver.log says it's the same three requests each time:

92.168.4.21, 2022-03-30 02:42:21, GET, /admin/todolist.load, HTTP/1.1, 303, 
0.043000
192.168.4.21, 2022-03-30 02:42:21, GET, /admin/index.load, HTTP/1.1, 404, 
0.081000
192.168.4.21, 2022-03-30 02:42:21, GET, /badlist/appadmin/hooks, HTTP/1.1, 
200, 0.284000

With older versions of web2py and Chrome, I've seen what I call "cache 
thrash"; where Chrome seemed to be issuing a blizzard of requests to 
refresh the cache, and web2py couldn't respond to anything else.  This 
would continue until I stopped the server, which often required a process 
kill.

Am I see a less vicious form of cache thrash?

I became aware of this current version of the problem when using a "public" 
port that is visible on the local network (having bought a new laptop), but 
I don't think that's the source of the problem, and the earlier version of 
the problem was only using 127.0.0.1 (localhost).

/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/544ac26e-672f-40a2-b204-c5921e6eaa35n%40googlegroups.com.


Re: [web2py] Exporting html table as csv

2022-03-30 Thread Dave S

On Saturday, March 26, 2022 at 2:24:06 AM UTC-7 mostwanted wrote:

> Thanks alot Murat, gratitude
>

Was 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV-one-Table-at-a-time->
of any help?  Are you creating a temporary table that you render the HTML 
from?

 

>
> On Friday, March 25, 2022 at 1:05:54 PM UTC+2 muratkas...@gmail.com wrote:
>
>> Hi,
>>
>> You can use the javascript on HTML file like this:
>> https://yourblogcoach.com/export-html-table-to-csv-using-javascript/
>>
>> https://stackoverflow.com/questions/15547198/export-html-table-to-csv-using-vanilla-javascript
>>
>> If you want to read CSV and insert to db, you can check the codes in 
>> appadmin.py file on admin app.
>>
>> Regards,
>> Murat.
>>
>>
>>
>> mostwanted , 25 Mar 2022 Cum, 11:11 tarihinde şunu 
>> yazdı:
>>
>>> Is there a way to download data in my html table as csv? 
>>>
>>> I have information in an html table that comes from 4 different database 
>>> tables but i want to have it downloaded to be used further in excel. Can i 
>>> download this html table that i have combined all this information in as a 
>>> single csv file with all this information?
>>>
>>> Regards;
>>>
>>> /dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c0132283-b965-4921-b1e5-acd6b3bf9acan%40googlegroups.com.


Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-03-24 Thread Dave S


On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:

> This could be one problem:
>
> for i in range((max_row_lines - extra_colspan) / colspan):
>
> there are many of this. 
>
> *range* take an integer, but a division in python3 return a float...
>
>
Interesting, but why doesn't the exception occur in the quoted line with 
the range statement?

The stack trace suggests it occurs after the for loop completes.

(I' also dizzy from the number of places where self.structured fields get 
redone by enumerating itself)

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6983bf12-0a5e-444b-9066-5c86e553730dn%40googlegroups.com.


[web2py] Re: About migrate and fake_migrate

2022-03-16 Thread Dave S
On Wednesday, March 16, 2022 at 1:56:33 AM UTC-7 Tom Clerckx wrote:

> I was a bit confused about the explanation of the fake_migrate option in 
> the web2py documentation. After some experimenting, I wrote up the 
> following information for myself, just sharing it here with you. Maybe 
> someone can merge this information in the web2py documentation, if you 
> think it contributes to making this topic more clear.
> --
>
>
I have to [sigh] relearn this frequently.   I am finally beginning to take 
to heart your last comment below.

 

> The explanation here assumes sqlite as a database, but I believe holds 
> also for other databases.
>
> When changing a model, e.g. adding a field there are two places where 
> information is updated.
>
>- In the database-metadata files. These files are located in the 
>database folder. For each table a metadata file is created. If you want to 
>inspect these files, you can inspect them by unpickling them
>
>
>- In the database.sqlite file. This is the database itself.The new 
>field will be added to the sqlite schema
>
> The database parameter *migrate* (=True by default) pushes changes that 
> are made in your model back into the meta-data file and in the sqlite file.
> Another option *fake_migrate* (=False by default) pushes changes that are 
> made in your model back into the meta-data file, *but not in the sqlite 
> database file.*
> Note also that this option will only push new Fields back into the 
> meta-data file. *It does not remove fields from the metadata file that 
> you may have removed in your model!!*
>
> For each field described in your model (and thus also in the metadata 
> file), you should have a corresponding element in the sqlite schema.
> If that is not the case, you can have one of two errors:
> Error 1: 
> The field is present in the sqlite database, it also exists in your model 
> file, but for some reason it does not exist in the metadata file. Because 
> it is defined in the model and it is not yet present in the metadata file, 
> web2py wants to create it by doing a migrate.
> This migrate, includes updating both the metadata file *and* the sqlite 
> schema. The problem however, is that in the sqlite schema, this field 
> already exists!
> This will cause an error similar as:
> *sqlite3.OperationalError: duplicate column name: blablabla*
> Solution:
> We can fix this by telling web2py to do a 'fake_migrate'.
> This is done by adding the parameter *fake_migrate=True* in the table 
> definition.
> By doing a fake migrate, web2py will only update the metadata file and NOT 
> the sqlite database. As such, the fields in the database and in the 
> metadata file will get back in sync.
> *It is important* to remove the fake_migrate parameter again after the 
> data sources are back in sync!
>
> Error 2: 
> The field is in the metadata file, it also exists in your model file, but 
> for some reason it does not exist in the sqlite schema. Because it is 
> defined in the model and in the metadata file, web2py will try to load this 
> field from the database.
> But because it is not defined in the database, you will get an error such 
> as:
> *sqlite3.OperationalError: no such column: person.blablabla*
> Solution 2:
> In this case we cannot do the fake-migrate directly, because the 
> fake-migrate option can add the new fields to the metadata file, but it 
> won't push the field to the database. So what we should do is:
>
>1. First remove again the field in question from our model.
>2. Set the fake_migrate=True option
>3. Remove the meta-data file (keep a backup of it elsewhere, just to 
>make sure)
>4. Reload the database (e.g. by doing a screen refresh in the page 
>where you use the table in question)... this will recreate the meta-data 
>file based on your current model.
>5. Set fake_migrate=False (or just remove it, as False is the default 
>value)
>6. Put back the field in question in the model 
>7. Reload the database once more
>8. By reloading the database, web2py will now push the new field again 
>in the metadatafile and it will also update the sqlite schema. Now all 
> data 
>is back in sync.
>
>
> Sidenote: Why you should not have fake_migrate=True in a normal situation
> If you would leave fake_migrate=True, you would actually cause Error 2 
> above to happen when you add a new field to your table, because in that 
> case the new field
> is only committed to the metadata-file and not to the sqlite database.
>


/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web 

[web2py] Re: web2py.com down

2022-01-31 Thread Dave S

On Monday, January 31, 2022 at 1:03:28 PM UTC-8 Vlad wrote:

> Indeed. 
>
> On Sunday, January 30, 2022 at 10:20:06 PM UTC-6 Raul Monares wrote:
>
>> The site is down :(
>
>
Continuing:

GET 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer 
500 (Internal Server Error)
favicon.ico:1 GET http://web2py.com/favicon.ico 500 (Internal Server Error)

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/573cdc43-846e-49ea-9253-dd9ecdeeca5en%40googlegroups.com.


[web2py] Re: more fun with SQLTABLE

2022-01-15 Thread Dave S


On Friday, January 14, 2022 at 11:56:57 PM UTC-8 Dave S wrote:

> I'm working on Yet Another Personal Application, and in the main table I 
> define a field as type 'upload'.  The upload works fine, and I can grab the 
> file back by the download function.  But when I make a list of uploads by 
> some criteria and then try to display that list with SQLTABLE, I don't get 
> the expected link, I just the filler text.
>
> I've verified that the ROWS object returned has the value of the upload 
> field (the obfuscated filename), but I still appear to be hitting 
> sqlhtml.py#L3603 instead of L3601.(v2.21.1).  Appadmin gets this right, 
> though.
>
> Any suggestions on what I need to correct?
>

Go back and review the book often enough, and it starts to sink in   I 
needed to set an additional parameter  with ', upload = "download" '.

Maybe I'll even remember this next time.

/dps

 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2ba567a3-ce22-4270-adff-291ba65f1fa8n%40googlegroups.com.


[web2py] more fun with SQLTABLE

2022-01-14 Thread Dave S
I'm working on Yet Another Personal Application, and in the main table I 
define a field as type 'upload'.  The upload works fine, and I can grab the 
file back by the download function.  But when I make a list of uploads by 
some criteria and then try to display that list with SQLTABLE, I don't get 
the expected link, I just the filler text.

I've verified that the ROWS object returned has the value of the upload 
field (the obfuscated filename), but I still appear to be hitting 
sqlhtml.py#L3603 instead of L3601.(v2.21.1).  Appadmin gets this right, 
though.

Any suggestions on what I need to correct?

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d7191391-36a1-4e48-95dc-9691cfb6950an%40googlegroups.com.


Re: [web2py] (PWA) Send a Subscription information to my Server

2022-01-06 Thread Dave S


On Tuesday, January 4, 2022 at 1:44:36 AM UTC-8 mostwanted wrote:

> I tried adding this to my code
>  
>
>
>
>
>
> *$.ajax({  type: "POST",  url: 
> "https://www.sesoa.co.bw/init/default/func.html 
> ",  data: 
> JSON.stringify(subscribeOptions)   }).done(function( msg ) {  
> console.log(msg);  });*
>
> when i assign *{{=URL('save_data')}}* to url: I get a 400 BAD REQUEST 
> error
> When i assign *"/init/default/func.html" *to url: I get a 500 INTERNAL 
> SERVER error
>
> I dont know what to do anymore
>

Is your [target] controller function called "save_data"  or "func"?

 For the 500 error, is a ticket generated?  If not, do you have logging 
enabled?  500s are often the result of an exception.

For the 400, what is the actual URL sent to the server?  Your front end 
should have logged that.

/dps



-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ca9a422a-d895-4f5e-b252-d377ff500311n%40googlegroups.com.


[web2py] Re: Estore Error with stripe

2022-01-03 Thread Dave S


On Sunday, January 2, 2022 at 1:55:56 AM UTC-8 mauri...@gmail.com wrote:

> Hello I got this error when trying out the Estore app.
> File "/home/maurice/web2py/applications/EStore/controllers/default.py" 
> , 
> line 
> 157, in pay
> description="Purchase".encode('utf-8')
> File "/home/maurice/web2py/gluon/contrib/stripe.py", line 115, in __init__
> self.signature = sha1(repr((self.amount,self.description))).hexdigest()
> TypeError: Unicode-objects must be encoded before hashing
>
>
This is probably a PY3-ism issue.   The value you give description in 
3.10.1 is of type bytes, and the sha1 code probably expects a string.  In 
2.7.18, that same expression yields an instance of type string.

/dps

 

>
> part of the code in default is:
>
> @auth.requires_login()
> def checkout():
> if session.checkout_form and not request.post_vars:
> for key in session.checkout_form:
> db.cart_order[key].default = session.checkout_form[key]
> form = SQLFORM(db.cart_order).process(dbio=False)
> if form.accepted:
> session.checkout_form = form.vars
> redirect(URL('pay'))
> return locals()
>
> def pay():#Not working, error # description: TypeError: Unicode-objects 
> must be encoded before hashing
> from gluon.contrib.stripe import StripeForm
> results = price_cart()
> stripe_form = StripeForm(
> pk=STRIPE_PUBLIC_KEY,
> sk=STRIPE_SECRET_KEY,
> amount=int(100*results['total_with_shipping']),  # (amount is in 
> cents)amount=int(100*results['total_with_shipping']),  
> currency='eur',
> currency_symbol='€',
> description="Purchase".encode('utf-8')
> )
> stripe_form.process()
>
> Help in correcting this error will be appreciated.
> Thank you
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b5bd81b1-01a0-42d9-b35c-db2e027e2c5bn%40googlegroups.com.


[web2py] Re: SQLTABLE columns in 2.21.1

2022-01-03 Thread Dave S


On Monday, December 20, 2021 at 8:18:43 PM UTC-8 Dave S wrote:

> The code in sqlhtml.py for SQLTABLE has changed along the way from 2.18.5 
> to 2.21.1, especially in the way it handles columns.
>
>
Well, actually from 2.14.6, as I appeared to not have run this app in 
2.18.5.  The problem was not in SQLTABLE, it was in what I'm trying to 
return.  
I initialized rowed as follows:

rowed = Rows(db)
rowed.records = []
 

and then I chew through some stuff to add rowed.record[0...n]

return dict(rowed = rowed, ...)

stopped working by 2.18.5, according to beautify(response._vars).  
Eventually I figured out I needed to copy rows.fields and rows.colnames to 
rowed.

/dps



 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6f518c41-56d9-45de-8fb4-fffae4db8df7n%40googlegroups.com.


[web2py] Re: DataTable() not a function

2021-12-23 Thread Dave S

On Tuesday, December 21, 2021 at 1:05:08 PM UTC-8 Jim S wrote:

> I wish I could help, but I'm not javascript guru.  That's why I've moved 
> to py4web, grid and htmx.
>
> Do you have the datatables .css and .js files loaded?  
> jquery.dataTables.min.js is not all that you need.
>
> cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css
> cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js
>
> -Jim
>
>

Thank you, that was a useful clue.  I am now able to get it to draw the 
table.  Next, figuring out why the data isn't showing.

/dps


 

> On Monday, December 20, 2021 at 10:01:32 PM UTC-6 snide...@gmail.com 
> wrote:
>
>> Jim?  Other datatable gurus?
>>
>> /dps
>>
>>
>> On Thursday, December 2, 2021 at 4:30:20 AM UTC-8 Dave S wrote:
>>
>>> That's the error I'm getting, according to Chrome's console.
>>>
>>> The view code is pretty simple:
>>>
>>> 
>>> var table;
>>> $(document).ready(function(){
>>>table = $('#tableXactions').DataTable( {
>>>"data": {{=results}} ,
>>>"columns": [
>>> /* { data: 'xaction.PostDate'}, */
>>>  { data: 'xaction.Id' },
>>>  { data: 'xaction.Amount' },
>>>  { data: 'xaction.Expense' },
>>>  { data: 'xaction.Tag' }
>>> 
>>> ]
>>>
>>> });
>>>
>>>  });
>>> 
>>>
>>> 
>>>
>>>
>>>   Id
>>>   Amount
>>>   Expense
>>>   Tag
>>>
>>> 
>>> 
>>> 
>>>
>>> The console shows that jquery.dataTables.min.js (and the css) is loaded 
>>> from the datatables.net cdn (1.10.19, not the latest but close).  Both 
>>> my debug code and the console show that my results are as expected, so I 
>>> don't think the controller is where I messed up.
>>>  
>>> The actual console message is 
>>>
>>> listing:96 Uncaught TypeError: $(...).DataTable is not a function
>>> at HTMLDocument. (listing:96)
>>> at i (jquery.js:2)
>>> at Object.fireWith [as resolveWith] (jquery.js:2)
>>> at Function.ready (jquery.js:2)
>>> at HTMLDocument.K (jquery.js:2)
>>> (listing is my view/default/listing.html)
>>>   
>>> I get this error even if I have no options in the DataTable() call.  
>>> (And I should be using DataTable(), not the dataTable() version, right?  
>>> Equivalent, but different return types)
>>>
>>> I have Roger's example, but it's much more complex than I'm ready for.  
>>> The sample on web2pyslices.com is about right, but uses a much older 
>>> version.  The examples on datatables.net are snippets that they assume 
>>> you know where to put them.
>>>
>>> What's the fix for my mistake (or at least, what's my mistake?)
>>>
>>> /dps
>>>
>>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b7bb9aa4-968e-4431-9daf-1b4dab898c80n%40googlegroups.com.


Re: [web2py] Re: Error ticket for "admin" when trying to create a view

2021-12-20 Thread Dave S
On Friday, December 17, 2021 at 9:12:55 AM UTC-8 mostwanted wrote:

> This is happening on a live app, its live, hosted on pythonanywhere. I am 
> starting to suspect something though, I recently received an email from 
> pythonanywhere.com informing me that I should change  the system image of 
> my app because my app is running on an old one called "dangermouse", in a 
> year's time that system image will be absolute so I was encouraged to use a 
> new one & I changed it. But they also warned that  my code might need 
> modification to run with the new system image & i am starting to suspect 
> that the system image i chose is the one affecting the normal functionality 
> of my app Just suspicions because before i changed my system image all 
> was good.
>
>
Did the python version change when you changed system images?  

Also, in the ticket you may be able to see which of request.vars.sender and 
anchor is the null value.

Dave S
/dps


 

> On Friday, December 17, 2021 at 2:52:22 PM UTC+2 Jim S wrote:
>
>> Is it possible your were no longer logged in or that you cleared your 
>> browser cache before this happened?
>>
>> Sense really weird. Have you tried with a fresh install of web2py?
>>
>> Jim
>>
>> On Fri, Dec 17, 2021, 5:56 AM mostwanted  wrote:
>>
>>> But that's just the thing, I wasn't trying pass any data, i just trying 
>>> to create a new view for a new function In my admin interface, as soon as I 
>>> clicked create the error popped up & the view failed to create.
>>>
>>> On Thursday, December 16, 2021 at 7:31:55 PM UTC+2 Jim S wrote:
>>>
>>>> Looks like you're passing some data through the request vars and the 
>>>> value is Null.  Would need to see more code to be able to help.
>>>>
>>>> -Jim
>>>>
>>>> On Wednesday, December 15, 2021 at 12:09:08 AM UTC-6 mostwanted wrote:
>>>>
>>>>> Hi guys, I'm updating one of my very early projects, I was trying to 
>>>>> create a view and I got an error:  Error ticket for "admin", I dont 
>>>>> know what's causing it, how do I fix this? Its a new error that I have 
>>>>> never encountered before, thats the traceback below. I developed it with  
>>>>> Version 2.14.6
>>>>>
>>>>> Traceback
>>>>> Traceback (most recent call last):
>>>>> File "/home/sesoa/web2py/gluon/restricted.py", line 227, in restricted
>>>>> exec ccode in environment
>>>>> File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
>>>>> <https://www.sesoa.co.bw/admin/default/edit/admin/controllers/default.py>,
>>>>>  
>>>>> line 2000, in 
>>>>> File "/home/sesoa/web2py/gluon/globals.py", line 417, in 
>>>>> self._caller = lambda f: f()
>>>>> File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
>>>>> <https://www.sesoa.co.bw/admin/default/edit/admin/controllers/default.py>,
>>>>>  
>>>>> line 1484, in create_file
>>>>> redirect(request.vars.sender + anchor)
>>>>> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
>>>>>
>>>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e58c8d44-a412-4f13-ad68-bfea6bc4c6b5n%40googlegroups.com.


[web2py] SQLTABLE columns in 2.21.1

2021-12-20 Thread Dave S
The code in sqlhtml.py for SQLTABLE has changed along the way from 2.18.5 
to 2.21.1, especially in the way it handles columns.

This used to work:
in 2.21.1, I get an error

{{=SQLTABLE(rows, truncate=35, headers = {'QuarterMaster.IssueYr':'Year', 
'QuarterMaster.StateNm':'State', 'QuarterMaster.Other':'Other', 
'QuarterMaster.Mint':'Mint', 'QuarterMaster.NumAdded':'Count'}, 
columns=['QuarterMaster.IssueYr', 'QuarterMaster.StateNm', 
'QuarterMaster.Other', 'QuarterMaster.Mint', 'QuarterMaster.NumAdded'], 
_class="table-striped myeheaders")}}

in 2.21.1, I get an error

Traceback (most recent call last):
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py", 
line 219, in restricted
exec(ccode, environment)
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\applications\QuarterMaster\views\default/sortedQ.html",
 
line 77, in 
File 
"C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\sqlhtml.py", line 
3544, in __init__
"Column %s not found (SQLTABLE)" % colname)
KeyError: 'Column IssueYr not found (SQLTABLE)'

I've tried "QuarterMaster.IssueYr", "db.QuarterMaster.IssueYr", "IssueYr", 
and "rows.IssueYr".
Same error.

If I eliminate the columns argument, no error, but my data doesn't show. 
I've verified in the controller that the data gets into rows, and looks like



What do I need to make this work again?

Dave S
/dps


-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/9cc3a2b1-635e-4477-9794-b6f1b6eec84bn%40googlegroups.com.


[web2py] Re: DataTable() not a function

2021-12-20 Thread Dave S
Jim?  Other datatable gurus?

/dps


On Thursday, December 2, 2021 at 4:30:20 AM UTC-8 Dave S wrote:

> That's the error I'm getting, according to Chrome's console.
>
> The view code is pretty simple:
>
> 
> var table;
> $(document).ready(function(){
>table = $('#tableXactions').DataTable( {
>"data": {{=results}} ,
>"columns": [
> /* { data: 'xaction.PostDate'}, */
>  { data: 'xaction.Id' },
>  { data: 'xaction.Amount' },
>  { data: 'xaction.Expense' },
>  { data: 'xaction.Tag' }
> 
> ]
>
> });
>
>  });
> 
>
> 
>
>
>   Id
>   Amount
>   Expense
>   Tag
>
> 
> 
> 
>
> The console shows that jquery.dataTables.min.js (and the css) is loaded 
> from the datatables.net cdn (1.10.19, not the latest but close).  Both my 
> debug code and the console show that my results are as expected, so I don't 
> think the controller is where I messed up.
>  
> The actual console message is 
>
> listing:96 Uncaught TypeError: $(...).DataTable is not a function
> at HTMLDocument. (listing:96)
> at i (jquery.js:2)
> at Object.fireWith [as resolveWith] (jquery.js:2)
> at Function.ready (jquery.js:2)
> at HTMLDocument.K (jquery.js:2)
> (listing is my view/default/listing.html)
>   
> I get this error even if I have no options in the DataTable() call.  (And 
> I should be using DataTable(), not the dataTable() version, right?  
> Equivalent, but different return types)
>
> I have Roger's example, but it's much more complex than I'm ready for.  
> The sample on web2pyslices.com is about right, but uses a much older 
> version.  The examples on datatables.net are snippets that they assume 
> you know where to put them.
>
> What's the fix for my mistake (or at least, what's my mistake?)
>
> /dps
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/69bebf83-c0c3-42ff-ad2b-977965a932afn%40googlegroups.com.


[web2py] Re: Learning Management System (LMS)

2021-12-13 Thread Dave S

On Wednesday, December 8, 2021 at 3:14:17 PM UTC-8 黄祥 wrote:

> is there any web2py app or example to create Learning Management System 
> (LMS) with the exam ?
>
> thanks and best regards,
> stifan
>


What is a Learning Management System?

As for exams, I didn't find anything at web2pyslices, but I'm sure 
multiple-choice quizzes have been discussed here at some point.  I'm not 
ready to search the Groups archive or stackoverflow just yet.

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ef4f44dc-32b5-4f78-ba06-b6653dc98907n%40googlegroups.com.


[web2py] Re: video app

2021-12-08 Thread Dave S
On Tuesday, December 7, 2021 at 10:47:55 PM UTC-8 mauri...@gmail.com wrote:

> Hello.
> Anyone who has a zoom/airmeet app like application / any leads on a such 
> an app  using web2py/p4web?
> Regards
>

There are 2 parts to this, I think.  One involves receiving a stream from a 
server, which seems fairly straightforward.  The other part would be 
receiving notifications. See this answer from 2016:
https://groups.google.com/g/web2py/c/_87LHOJFMR0/m/7ONiuUwABwAJ >

I suspect that this is even easier in py4web, though I'm way behind on 
studying that.

Dave S
/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/940093ba-eacd-4a0a-97af-93947c550697n%40googlegroups.com.


[web2py] Re: DataTable() not a function

2021-12-02 Thread Dave S


On Thursday, December 2, 2021 at 4:30:20 AM UTC-8 Dave S wrote:

> That's the error I'm getting, according to Chrome's console.
>
>
Do I have a conflict between dot-js files?
 

> The view code is pretty simple:
>
> 
> var table;
> $(document).ready(function(){
>table = $('#tableXactions').DataTable( {
>"data": {{=results}} ,
>"columns": [
> /* { data: 'xaction.PostDate'}, */
>  { data: 'xaction.Id' },
>  { data: 'xaction.Amount' },
>  { data: 'xaction.Expense' },
>  { data: 'xaction.Tag' }
> 
> ]
>
> });
>
>  });
> 
>
> 
>
>
>   Id
>   Amount
>   Expense
>   Tag
>
> 
> 
> 
>
> The console shows that jquery.dataTables.min.js (and the css) is loaded 
> from the datatables.net cdn (1.10.19, not the latest but close).  Both my 
> debug code and the console show that my results are as expected, so I don't 
> think the controller is where I messed up.
>  
> The actual console message is 
>
> listing:96 Uncaught TypeError: $(...).DataTable is not a function
> at HTMLDocument. (listing:96)
> at i (jquery.js:2)
> at Object.fireWith [as resolveWith] (jquery.js:2)
> at Function.ready (jquery.js:2)
> at HTMLDocument.K (jquery.js:2)
> (listing is my view/default/listing.html)
>   
> I get this error even if I have no options in the DataTable() call.  (And 
> I should be using DataTable(), not the dataTable() version, right?  
> Equivalent, but different return types)
>
> I have Roger's example, but it's much more complex than I'm ready for.  
> The sample on web2pyslices.com is about right, but uses a much older 
> version.  The examples on datatables.net are snippets that they assume 
> you know where to put them.
>
> What's the fix for my mistake (or at least, what's my mistake?)
>
> /dps
>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/03bb4594-3bc4-41e4-9a17-032526f0e348n%40googlegroups.com.


[web2py] DataTable() not a function

2021-12-02 Thread Dave S
That's the error I'm getting, according to Chrome's console.

The view code is pretty simple:


var table;
$(document).ready(function(){
   table = $('#tableXactions').DataTable( {
   "data": {{=results}} ,
   "columns": [
/* { data: 'xaction.PostDate'}, */
 { data: 'xaction.Id' },
 { data: 'xaction.Amount' },
 { data: 'xaction.Expense' },
 { data: 'xaction.Tag' }

]
   
});

 });



   
   
  Id
  Amount
  Expense
  Tag
   




The console shows that jquery.dataTables.min.js (and the css) is loaded 
from the datatables.net cdn (1.10.19, not the latest but close).  Both my 
debug code and the console show that my results are as expected, so I don't 
think the controller is where I messed up.
 
The actual console message is 

listing:96 Uncaught TypeError: $(...).DataTable is not a function
at HTMLDocument. (listing:96)
at i (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.K (jquery.js:2)
(listing is my view/default/listing.html)
  
I get this error even if I have no options in the DataTable() call.  (And I 
should be using DataTable(), not the dataTable() version, right?  
Equivalent, but different return types)

I have Roger's example, but it's much more complex than I'm ready for.  The 
sample on web2pyslices.com is about right, but uses a much older version.  
The examples on datatables.net are snippets that they assume you know where 
to put them.

What's the fix for my mistake (or at least, what's my mistake?)

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a547634f-a39b-4bf1-9f56-6699692227cfn%40googlegroups.com.


[web2py] Re: import

2021-12-02 Thread Dave S

On Wednesday, November 17, 2021 at 1:30:31 PM UTC-8 lucas wrote:

> hello one and all,
>
> this is not a web2py question or issue.  but, since many are python 
> experts, i thought i'd ask.
>
> are there any other ways to import a module or package other then the 
> "import" or "from...import..." statements?  i ask because i'm allowing 
> programming on my web2py website and i don't want any accessing packages 
> like os or sys.
>
> thank you in advance and have a great day, lucas
>

I believe web2py uses a custom importer, and I know of at least one other 
o/s project that does that (originally Py2, but now Py3).  AIUI, this is a 
subclassing thing, but look through gluon for the actual implementation.

/dps



 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b547a4ad-1a70-4b4b-85c0-110733eb7b80n%40googlegroups.com.


[web2py] Re: Twinning tables in DAL

2021-12-02 Thread Dave S

On Monday, October 4, 2021 at 5:29:05 AM UTC-7 Anthony wrote:

> See 
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-inheritance
> .
>
>
Thank you.


/dps
 

> On Saturday, October 2, 2021 at 6:21:42 PM UTC-4 snide...@gmail.com wrote:
>
>> I need a reminder:
>>
>> If I want a given table structure to be used in multiple tables 
>> (different instances existing at the same time), how do I set up my model?  
>> For small tables (lines of def) and a small number of tables, I can do a 
>> block copy, but is there a more, um, dynamic way to do this?
>>
>> /dps
>>
>>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d777f22e-82f2-415a-ae91-479d4f71172cn%40googlegroups.com.


[web2py] Twinning tables in DAL

2021-10-02 Thread Dave S
I need a reminder:

If I want a given table structure to be used in multiple tables (different 
instances existing at the same time), how do I set up my model?  For small 
tables (lines of def) and a small number of tables, I can do a block copy, 
but is there a more, um, dynamic way to do this?

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0e39f0ab-a077-4757-92df-933b446a3e98n%40googlegroups.com.


[web2py] Re: update_or_insert on an existing record returns None

2021-10-02 Thread Dave S


On Friday, September 24, 2021 at 2:18:44 AM UTC-7 Ramos wrote:

> Why update_or_insert on an existing record returns None ??
> If the record does not exist it returns the created record id but if 
> updating an existing record i get None.
>
> Regards
> António
>

Possibly so you can tell it was an update and not an insert.

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0210cd59-3a75-44fe-b850-36e42a65c195n%40googlegroups.com.


[web2py] Re: Web2py site ssl expired

2021-09-22 Thread Dave S


On Wednesday, September 15, 2021 at 2:39:19 AM UTC-7 dirman wrote:

>
> Well same from my end. SSL expired
> On Saturday, September 11, 2021 at 2:04:38 PM UTC+1 rodrig...@gmail.com 
> wrote:
>
>> Hello my friends, I don't know for report this.
>> https://web2py.com/ when I access this url.
>> This not show with http.
>>
>
http probably doesn't check certificates.

However, what Opera says I'm seeing with http*s* now is 
NET::ERR_CERT_COMMON_NAME_INVALID

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d2f29fab-4945-4339-81a2-226f0e98affan%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-02 Thread Dave S
Good to hear from you again!  Keeping busy?

/dps


On Thursday, September 2, 2021 at 12:34:56 AM UTC-7 Niphlod wrote:

> the timeout is part of rocket webserver, not web2py. if you're running 
> fastcgi, that's where you want to set a timeout: as configuration in IIS 
> (see  python - How do I stop FastCGI process exceeding the configured 
> request timeout - Stack Overflow 
> 
>   
> or something like that )
>
> On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
> wrote:
>
>> I would like to increase the timeout parameters to see if it resolves 
>> some issues we are having with internal server error messages. 
>>
>> Get Outlook for Android 
>> --
>> *From:* web...@googlegroups.com  on behalf of 
>> Niphlod 
>> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
>> *To:* web2py-users 
>> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
>> it is running as an application pool on IIS? 
>>  
>> what command line argument, specifically ?
>>
>> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>>
>> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
>> wrote:
>>
>> Hi web2py folks, 
>>
>> I would like to add a command line argument to the startup of web2py 
>> which is running on an IIS web server.  Can someone tell me the place where 
>> I need to add those parameters on the IIS?
>>
>> Kind Regards,
>> David
>>
>>
>>
>> I can't, but perhaps the archives can help.  One of the long-time 
>> masters, Simone, ran IIS configurations and sometimes discussed his 
>> setups.  Use the search string "
>> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
>> posts.  (There are a lot; he did the Scheduler and also the JWT 
>> implementation, so you may want to refine the search.) 
>>
>> /dps
>>
>>
>>  
>>
>> -- 
>> 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-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/530191a9-a355-4db3-8a79-05336f2e493cn%40googlegroups.com.


[web2py] How to do hidden fields with SQLFORM.factory?

2021-09-02 Thread Dave S
I have a factory-built form that I've been happily using for a while, but 
now I want to add a field that is hidden unless a boolean in that form has 
been checked.

The right thing for database table form is in the book:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields>
Is there an easy way to do this for my non-DB form, or do I have dive into 
JS libraries?

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a9949845-5c83-44cc-9673-18b768c7e1e7n%40googlegroups.com.


[web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-08-30 Thread Dave S

On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com wrote:

> Hi web2py folks,
>
> I would like to add a command line argument to the startup of web2py which 
> is running on an IIS web server.  Can someone tell me the place where I 
> need to add those parameters on the IIS?
>
> Kind Regards,
> David
>


I can't, but perhaps the archives can help.  One of the long-time masters, 
Simone, ran IIS configurations and sometimes discussed his setups.  Use the 
search string 
"https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
posts.  (There are a lot; he did the Scheduler and also the JWT 
implementation, so you may want to refine the search.)

/dps


 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a5e0c402-9b41-45ab-be8f-09238952421en%40googlegroups.com.


[web2py] Re: Internal Server Error 500 when doing medium to heavy data processing

2021-08-29 Thread Dave S

On Thursday, August 26, 2021 at 4:34:43 AM UTC-7 david@gmail.com wrote:

> Version
>
> 2.18.5-stable+timestamp.2019.04.08.04.22.03
> (Running on Microsoft-IIS/10.0, Python 3.6.8)
>
> Hello,
>
> We have been using web2py for a couple of years with very few issues, but 
> lately we have been getting *Internal Server Error 500 *error messages 
> when certain scripts are called.  These scripts due some relatively heavy 
> processing.
>

Are these scripts running outside of web2py or as modules within the 
application?  ("Scripts"  has so many connotations that it is a good idea 
to be more specific)

If the scripts are outside, can they be launched as independent processes?  
If they are modules, can you use the scheduler to run them?   With either 
of those and a long-running processing job, I'd invoke the job from the 
page (link) that you use now, but instead of waiting for the results just 
return a link to a page with the results.  This gives the user quick 
feedback that the system has accepted the request, but the two-step process 
adds a little extra time without screwing with your timeouts, but as 
processing time increases you can have the 2nd link respond with "busy" 
until it isn't.  If you don't like the user to actually have to click that 
second link, you can experiment with the LOAD() apparatus, which also 
allows you to display a busy icon.

 

> I am not sure if this is related to web2py or purely a server, resource or 
> network problem but I thought that someone here may have had similar issues 
> and can recommend some configuration change to remedy this.
>
> Kind Regards, 
>
> David
>

You haven't sketched a lot of context,   I've taken a stab at an answer 
based on my workflows, some of which were learned here 5 or  more years 
ago.  One place where I've used the above technique was in discovering 
certain types of work nodes, which involved sending queries over the network

I've done other processing where a file is chewed upon for certain 
keywords; with the link being used to upload the file for processing.  The 
application says "thank you, got it", schedules the processing, and returns 
HTTP 200.  The processing, when it completes, sends email telling the 
Interested Parties where the report is.

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c02ccd45-44cf-4154-9ebd-a4d63dd22bb2n%40googlegroups.com.


[web2py] Re: DAL Select(fields) puzzle

2021-08-25 Thread Dave S
On Wednesday, August 25, 2021 at 3:39:34 PM UTC-7 Rob Paire wrote:

> Hi Web2py 
> I hope someone can explains this puzzling behavior. The code below was 
> taken from the book, and it works as given, but when I remove the  
> "yes_or_no" condition from the field list parameters it causes 
> a KeyError('id') error, and I don't understand why. 
>
>
> *condition = db.person.name.startswith('B')*
> *yes_or_no = condition.case('Yes', 'No')*
> *rows = db(db.person.name  == 
> 'Bob').select(db.person.name ,yes_or_no 
> ).as_dict()  *
> *rows = db(db.person.name  == 
> 'Bob').select(db.person.ALL).as_dict()  *
> *## the two select examples above works as expected*
>
> *rows = db(db.person.name  == 
> 'Bob').select(db.person.name ).as_dict()  *
> This last example in red throws a KeyError('id') error when trying to name 
> specific fields, but  works fine when returning ALL fields, or when a 
> condition is specified.
>

I don't have a complete answer, but it's the as_dict() that throws the 
error, because it's looking for a key that isn't there.  If you do 
for row in rows:
  print row
 you see that row doesn't have "id" as a key; it only has 'name' as a key.  
as_dict() and as_list() must have a requirement for an id field, and if you 
make your select
rows = db(db.person.name == 'Bob').select(db.person.name
,db.person,id).as_dict()
it should work as expected.
[The requirement isn't mentioned in the book]

/dps

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d30845f7-41c9-4f34-b2e0-789cc6112d0en%40googlegroups.com.


[web2py] Re: How to encrypt password

2021-07-30 Thread Dave S

On Friday, July 30, 2021 at 1:34:44 PM UTC-7 isi_jca wrote:

> Hi everybody:
>
> I was able to solve my problem. 
>
>>
>>
Good to hear!

/dps
 

-- 
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-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/43723c6b-86d8-4d84-a7df-cf60926d2681n%40googlegroups.com.


  1   2   3   4   5   6   7   8   9   10   >