Re: [web2py] VSCODE with linter + debugging in WEB2PY

2022-11-27 Thread Alex Glaros
vscode is not understanding where web2py syntax is defined. I get following error Exception has occurred: NameError name 'request' is not defined File " C:\alex\alt_w2p_06_source\web2py\applications\lower_case_8\models\db.py", line 8, in if request.global_settings.web2py_ve

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

2022-11-27 Thread Alex Glaros
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? 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...

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

2022-11-25 Thread Alex Glaros
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) --- Yo

[web2py] Re: Slider example

2022-08-31 Thread Alex Beskopilny
unfortunately, I don't have the code. I once made such a form from a book web2py Application Development Cookbook (I remember that there were errors in the book, but the code that came with the book worked after obvious changes) On Tuesday, August 30, 2022 at 11:04:41 AM UTC+3 Kenneth wrote: >

[web2py] How to measure performance?

2022-01-15 Thread Alex Glaros
I put start-time capture at top of view, and end time-capture at bottom of view. Start and end time are always result in identical values but seems that end time should be different. In view I have: {{startTime = request.now}} [this is a top of view] {{for a in ...takes a few seconds to r

[web2py] Re: rendering rows as a generator and displaying via SQLTABLE

2020-12-24 Thread Alex Beskopilny
Hi! You can create a table in memory and use grid working example: def pro_report1(): # https://web2py.wordpress.com/category/web2py-and-databases/ # https://stackoverflow.com/questions/33674532/web2py-sqlform-grid-with-executesql tbl = 'proverka' #f_short_proverka = [ 'f' + s

[web2py] Re: How to add another field to select clause?

2020-11-28 Thread Alex Glaros
alexg...@gmail.com wrote: > >> using Postgres >> >> On Thursday, November 26, 2020 at 11:18:00 PM UTC-8 Alex Glaros wrote: >> >>> How to add db.role_member.id within select clause as highlighted below? >>> >>> If I leave it out, it runs fine

[web2py] Re: How to add another field to select clause?

2020-11-27 Thread Alex Glaros
using Postgres On Thursday, November 26, 2020 at 11:18:00 PM UTC-8 Alex Glaros wrote: > How to add db.role_member.id within select clause as highlighted below? > > If I leave it out, it runs fine. If I add it, I get error: > class 'psycopg2.errors.GroupingError'> col

[web2py] How to add another field to select clause?

2020-11-26 Thread Alex Glaros
How to add db.role_member.id within select clause as highlighted below? If I leave it out, it runs fine. If I add it, I get error: class 'psycopg2.errors.GroupingError'> column "role_member.id" must appear in the GROUP BY and if I make it appear in the group by section as suggested by the error

[web2py] Re: How to sort a join by count

2020-11-20 Thread Alex Glaros
AT(person.person_name,",") AS person_list' >>>>>>>>>> groupby = db.PERSON-PROJECT-PRIORITY.project_fk, >>>>>>>>>> ) >>>>>>>>>> >>>>>>>>>> суббота, 14 ноября 20

[web2py] Re: How to pass variables to db.executesql?

2020-11-20 Thread Alex Beskopilny
Variable > > thanks, > > Alex Glaros > -- 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 t

[web2py] How to pass variables to db.executesql?

2020-11-19 Thread Alex Glaros
for example where mytable.id = someWeb2PyVariable thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

[web2py] Re: Dashboard library for Web2py performance/recommendation python vs. js

2020-11-18 Thread Alex Beskopilny
dasjboards for web2py https://github.com/ali96343/facew2p dashboards for py4web https://github.com/ali96343/facep4w charts Highcharts.js On Tuesday, November 17, 2020 at 11:47:04 AM UTC+3 Jonsubs wrote: > Hi everyone, > I need to implement a dashboard and some charts in my webapp. And honestly

[web2py] Re: How to sort a join by count

2020-11-14 Thread Alex Glaros
>>>>>>> person_fk >>>>>>> project_fk >>>>>>> >>>>>>> prioritySet = db((db.PERSON.id == >>>>>>> PERSON-PROJECT-PRIORITY.person_fk) & (PROJECT.id == >>>>>>> PERSON-PROJECT-PRIORITY.project_f

[web2py] Re: How to sort a join by count

2020-11-14 Thread Alex Glaros
;>>>> person_fk >>>>> project_fk >>>>> >>>>> prioritySet = db((db.PERSON.id == PERSON-PROJECT-PRIORITY.person_fk) >>>>> & (PROJECT.id == PERSON-PROJECT-PRIORITY.project_fk)).select() >>>>

[web2py] Re: How to sort a join by count

2020-11-14 Thread Alex Glaros
2) >> >> If you have additional time, how to write so output looks like: >> >> Paint-the-house (10) Tom, Sue, Tony, Ted, Mary, Fred, Sal, Chris, Ed, >> Sally >> Plant-a-garden (5) Harry, George, Joanne, Tony, Janet >> Clean-out-garage (2) Clyde, Jane >>

[web2py] How to sort a join by count

2020-11-13 Thread Alex Glaros
put looks like: Paint-the-house (10) Tom, Sue, Tony, Ted, Mary, Fred, Sal, Chris, Ed, Sally Plant-a-garden (5) Harry, George, Joanne, Tony, Janet Clean-out-garage (2) Clyde, Jane Thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.c

[web2py] Re: SQLFLORMGRID

2020-10-08 Thread Alex Beskopilny
maybe you could do this def art_manage(): if len(request.args) >= 2 and ('new' == request.args[0]): # some code return ' create ' records= SQLFORM.grid(query=db.t_art,maxtextlength = 40,deletable=False,create=True, fields=[db.t_art.f_name, db.t_art.f_team, d

[web2py] Re: Streaming pdf in a browser

2020-09-28 Thread Alex Beskopilny
1 create new app and mkdir docfiles in it # models/db1.py db.define_table( 'zurina', Field('jenka_fnm', requires=IS_NOT_EMPTY(), label='orig_file_name' ), Field("fld",label="Remark", length=3500,), Field('new_image_fil

[web2py] Re: Streaming pdf in a browser

2020-09-28 Thread Alex Beskopilny
it's work with web2py inline for pdf, jpeg, png ... save file fot other file types def doc2user(): # read from db.table orig file name and path to file in upfolder import os prn_id = request.args(0,cast=int) task = db.zurina(prn_id) or error() qu=db.zurina.id == prn_id

[web2py] Re: Streaming pdf in a browser

2020-09-25 Thread Alex Beskopilny
only pdf to browser - inline def doc2user(): import os prn_id = request.args(0,cast=int) task = db.zurina(prn_id) or error() qu=db.zurina.id == prn_id res= db(qu).select().first() upfolder= os.path.join(request.folder, 'docfiles') file_path = os.path.join( upfolder, res

[web2py] Re: Streaming pdf in a browser

2020-09-25 Thread Alex Beskopilny
Hi! solution https://stackoverflow.com/questions/20508788/do-i-need-content-type-application-octet-stream-for-file-download web2py func def doc2user(): import os prn_id = request.args(0,cast=int) task = db.zurina(prn_id) or error() qu=db.zurina.id == prn_id res= db(qu).sel

[web2py] Re: How to sort a smartgrid with your own custom sorted id list

2020-07-03 Thread Alex Beskopilny
smartgrid sort with three one to many tables def uvidomlen_all(): table=db.operacia gqu = lambda tnm : (tnm.id>0) if auth.user.is_admin else (tnm.created_by == me) oqu = lambda tnm : ~db[tnm].id constraints = {'operacia':gqu(db.operacia), 'os1doc':gqu(db.os1doc), 'os2doc':gqu(d

[web2py] Re: How to sort a smartgrid with your own custom sorted id list

2020-07-03 Thread Alex Beskopilny
Hi! some working solution 1 build a sqlite-table in memory, as required 2 insert data in the table 3 show table in smartgird def pro_report1(): tbl = 'proverka' l = [e for e in db[tbl].fields if e in f_short_proverka ] memf = [ Field('oid', 'integer', label='П id', default= 0) ] +

[web2py] Re: Standard way of removing X-Powered-By: web2py http header?

2020-04-12 Thread Alex Beskopilny
cd web2py/gluon grep -r X-Powered-By ./globals.py:self.headers['X-Powered-By'] = 'xping' воскресенье, 12 апреля 2020 г., 16:02:13 UTC+3 пользователь Yan Wong написал: > > I'm a bit disappointed that web2py by default sets `X-Powered-By: web2py` > in the http header, thus making it easie

[web2py] Re: Web2py, react, typescript, visual studio code setup

2020-03-13 Thread Alex Beskopilny
Thanks Larry! great example. maybe in *webpack.config.js* *- app: './static/reactsrc/index.tsx'* + app: './static/src/index.tsx' среда, 11 марта 2020 г., 18:59:40 UTC+3 пользователь Larry Weinberg написал: > > Several people have asked about how to set up web2py to work with React > (and Typ

[web2py] Re: About menu and current page

2020-03-04 Thread Alex Beskopilny
items_sub_menu= [] menu_item = [ (chr( 0x0001f534 ), False, URL('default', 'index'), items_sub_menu) ] save_orig_menu= response.menu response.menu = menu_item response.menu += save_orig_menu items_sub_menu.append( (T('home'), False, URL(_app, 'default', 'index') ),) items_sub_menu.append( (T('app

[web2py] Re: Searching by date using SQLFORM.factory

2020-02-19 Thread Alex Beskopilny
import cPickle, os def put_on_disk(file_name, data): uploadfolder=os.path.join(request.folder, 'uploads') fn = os.path.join(uploadfolder, file_name) out_file = open(fn, 'w') cPickle.dump(data, out_file) out_file.close() def get_from_disk(file_name):

[web2py] py4web Form customization

2020-02-12 Thread Alex Beskopilny
is that possible? similar to the web2py {{=form.custom.begin}}Name: {{=form.custom.widget.name}}{{=form.custom.submit}}{{=form.custom.end}} form.element('input[name=name]')['_id']='myid' form.element('input[name=name]')['_class

[web2py] Re: py4web nw version and new example

2020-02-10 Thread Alex Beskopilny
[X] loaded _dashboard [FAILED] loading myfeed .. FileNotFoundError: [Errno 2] No such file or directory: 'apps/myfeed/databases/sql.log' - mkdir apps/myfeed/databases and restart понедельник, 10 февраля 2020 г., 9:13:46 UTC+3 пользователь Massimo Di Pierro написал:

[web2py] Re: SQLFORMGRID - CSS - LAYOUT

2019-12-07 Thread Alex Beskopilny
Hi! Here is the script and working examples for sqlform and customform https://github.com/ali96343/facew2p http://alibsk.pythonanywhere.com среда, 4 декабря 2019 г., 18:47:26 UTC+3 пользователь L c написал: > > Hi, > Soory but i do not find answer: > > I did that : > >1. Create a subfolder

[web2py] Re: language file overwritten

2019-10-24 Thread Alex
. On Monday, October 14, 2019 at 3:28:31 PM UTC+2, Alex wrote: > > We have upgraded to the latest web2py version 2.18.5 (from a very old > 2.12.3) and also changed from Python 2 to 3. > > Most things are working fine but we have one major issue: from time to > time a

[web2py] Re: How to easily implement another CSS-Framework

2019-10-14 Thread Alex Beskopilny
1: views/default/myindex.html Mysite myown unique page with my_css {{=message}} 2: def index(): response.view = 'default/myindex.html' return dict(message=T('Welcome to web2py!')) пятница, 11 октября 2019 г., 8:38:52 UTC+3 пользователь Jay B написал: > > Hello guys, > > I'm tryi

[web2py] Re: Vue2pyj - alternative web IDE

2019-09-30 Thread Alex Beskopilny
суббота, 11 мая 2019 г., 5:12:26 UTC+3 пользователь Val K написал: > > As result of experimenting with Rapydscript I want to present my > alternative web IDE for web2py, > (that could be easily ported to web3py as well) > https://github.com/valq7711/vue2pyj > > Any feedback is appreciated > > 2

[web2py] Re: Vue2pyj - alternative web IDE

2019-09-30 Thread Alex Beskopilny
;, line 1339, in read_request_line d = sock_file.readline() File "/home/w3p/anaconda3/lib/python3.7/socket.py", line 589, in readinto return self._sock.recv_into(b) ConnectionResetError: [Errno 104] Connection reset by peer ERROR:Rocket.Errors.Thread-5:Tried to send "500 Se

[web2py] big data "out of memory" error

2019-08-12 Thread Alex Glaros
rules into the database? My clone kept the requires statements: requires = IS_IN_DB(db, 'my_big_tables.id' ... and still ran fast so can the "reference my_big_tables" statement be safely, and completely eliminated from db.py? The "reference" statement really slo

[web2py] Re: py4web: how to import Template and change delimiters

2019-08-06 Thread Alex Beskopilny
it's port lte-2.4.15 to py4web https://github.com/ali96343/lteadmin-py4web четверг, 1 августа 2019 г., 10:48:02 UTC+3 пользователь Alex Beskopilny написал: > > Hi! > I put lte-2.4.15 to py4web and lte works with controllers.py : > > from py4web import action, request,

[web2py] Re: py4web: how to import Template and change delimiters

2019-08-01 Thread Alex Beskopilny
69.54 четверг, 1 августа 2019 г., 10:48:02 UTC+3 пользователь Alex Beskopilny написал: > > Hi! > I put lte-2.4.15 to py4web and lte works with controllers.py : > > from py4web import action, request, abort, redirect, URL > from yatl.helpers import A > from . common impor

[web2py] py4web: how to import Template and change delimiters

2019-08-01 Thread Alex Beskopilny
Hi! I put lte-2.4.15 to py4web and lte works with controllers.py : from py4web import action, request, abort, redirect, URL from yatl.helpers import A from . common import db, session, T, cache, auth @action('index') @action.uses('index.html', ) #@action.uses(Template('index.html', delimiters

[web2py] Re: web2py multiple domains on nginx + gunicorn

2019-07-01 Thread Alex Beskopilny
start second guicorn You have to run your projects on different ports like firsrone on 8000 and secondone on 8001. Then in nginx conf, in place of location /, you have to write location /firstone/ and proxy pass this to port 8000 and then write same location object for second one as location

[web2py] Re: web2py multiple domains on nginx + gunicorn

2019-07-01 Thread Alex Beskopilny
понедельник, 1 июля 2019 г., 16:23:30 UTC+3 пользователь Áureo Dias Neto написал: > > > . > for me works 1 up second gunicorn 2 dom2.conf upstream gunidom2 { server unix:/home/w2p/var/guni-dom2.sock fail_timeout=0; } server { listen xx.yy.zz.ww:443 ssl http2; server_na

[web2py] Re: is it possible to make social site like facebook/linkedin by web2py ?

2019-06-27 Thread Alex Beskopilny
Hi! imran tube _only_ web2py ! download css-html-template and run app builder some demo https://alibsk.pythonanywhere.com/ четверг, 27 июня 2019 г., 6:08:54 UTC+3 пользователь imran tube написал: > > which framework best for me django or web2py? > web2py all demo site not work or old or unfin

[web2py] Re: Upload files

2019-06-22 Thread Alex Beskopilny
if any ( ['.jpg' in file_name, '.JPG' in file_name , ] ): ? суббота, 22 июня 2019 г., 11:18:42 UTC+3 пользователь Константин Комков написал: > > I made upload form for files that winter and today when project is working > 3 days user told me that he can't load file. When I saw that file it

[web2py] backup page when site is broken

2019-05-19 Thread Alex Glaros
ough a SSL service and my routes.py looks like: #!/usr/bin/python # -*- codingf-8 -*- routers = dict( # base router BASE=dict( default_application='myDomain', domains={'www.myDomain':'myDomain'} ), ) thanks, Alex Glaros -- Resources: - ht

[web2py] Re: css templates layouts for web2py

2019-05-11 Thread Alex Beskopilny
This is not a template generator. This is a template installer to web2py env. Examples for some free admin dashboards in applications dir четверг, 9 мая 2019 г., 21:25:00 UTC+3 пользователь Alex Beskopilny написал: Hi ! > >https://github.com/ali96343/facew2p.git > >

[web2py] css templates layouts for web2py

2019-05-09 Thread Alex Beskopilny
Hi ! https://github.com/ali96343/facew2p.git Here is a script that generates web2py application from css templates. The script generates layouts, form (from html tag ), tables (from html tag ). The script has been tested on 50 templates. Thanks and best regards, Alex Beskopilny

[web2py] Re: howto prevent XSS in json data

2019-04-18 Thread Alex
This also happens with the latest web2py version 2.18.5 I've opened an issue here: https://github.com/web2py/web2py/issues/2182 On Wednesday, April 17, 2019 at 2:54:00 PM UTC+2, Leonel Câmara wrote: > > Please open an issue, you're right, this is a bug and a security problem, > it's also very ea

[web2py] Re: howto prevent XSS in json data

2019-04-16 Thread Alex
Thanks for your suggestions. Although nothing gets me the desired result. If I use urllib.quote or XML in the controller way too much gets escaped (all < and > signs, blanks, etc.) which is not what I want. And I'd have to do this for all attributes in every controller function. My problem is e

[web2py] Re: howto prevent XSS in json data

2019-04-15 Thread Alex
thanks for your answer. Problem is when I use sanitize then the output is var filterSettings = {"section": "