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_version <

[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,

[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) ---

[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

[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' +

[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'> column "

[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

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

2020-11-20 Thread Alex Glaros
) AS person_list' >>>>>>>>>> groupby = db.PERSON-PROJECT-PRIORITY.project_fk, >>>>>>>>>> ) >>>>>>>>>> >>>>>>>>>> суббота, 14 ноября 2020 г. в 09:40:17 UTC+3, alexg...@gmail.c

[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_fk)).select() >>

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

2020-11-14 Thread Alex Glaros
rson_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
ou 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 >> >> Thanks, >>

[web2py] How to sort a join by count

2020-11-13 Thread Alex Glaros
ooks 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.com/we

[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,

[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,),

[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,

[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=

[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),

[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

[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

[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(

[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']='myclass' Thanks Alex -- Resources: - http

[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

[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 > >

[web2py] Re: Vue2pyj - alternative web IDE

2019-09-30 Thread Alex Beskopilny
e() 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 Server Error" to client but received socket error Ale

[web2py] big data "out of memory" error

2019-08-12 Thread Alex Glaros
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 slows things down. thanks, Alex Glaros -

[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, abort

[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',

[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

[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;

[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

[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

[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: - http://web2py.com - http://web2p

[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

[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

[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 /scriptiframe; which is not valid js because the attribute quotes should not be escaped btw, I'm using web2py 2.12.3 - maybe that's fixed/improved in future versions? or am I doing something

Re: [web2py] Re: error connecting to postgrsql when running web2py from source on windows

2019-04-08 Thread Alex Glaros
ms\Python\Python37\Scripts > > (and if you have other python versions installed, use pip3 or even pip3.7 ) > > Cheers, > Nico > > Il giorno lun 8 apr 2019 alle ore 07:15 Alex Glaros > ha scritto: > >> How to pip install psycopg2? I get the following error: >>

[web2py] Re: pycharm "No python interpreter selected"

2019-04-07 Thread Alex Glaros
I installed source version of web2py windows and that worked. I guess windows binary doesn't have a path to python.exe -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: error connecting to postgrsql when running web2py from source on windows

2019-04-07 Thread Alex Glaros
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (D

[web2py] Re: pycharm "No python interpreter selected"

2019-04-06 Thread Alex Glaros
my understanding is that it is looking for a file name python.exe but the binary version of windows web2py does not have that file. Do I just point to the gluon directory? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: pycharm "No python interpreter selected"

2019-04-06 Thread Alex Glaros
I see this attached. What value am I supposed to specify? -- 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

[web2py] Re: pycharm "No python interpreter selected"

2019-04-06 Thread Alex Glaros
same question with Wing IDE, what do I enter for python path? -- 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

[web2py] pycharm "No python interpreter selected"

2019-04-06 Thread Alex Glaros
I have community version of pycharm and windows 10 binary version of web2py. Pycharm: "No python interpreter selected" How to resolve this? thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source cod

[web2py] Re: How to create a nested json dictionary by loading data from a flat, parent-referencing list?

2019-03-21 Thread Alex Glaros
Works like a charm, thanks so much! -- 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

[web2py] Re: How to create a nested json dictionary by loading data from a flat, parent-referencing list?

2019-03-21 Thread Alex Glaros
It kind of works but adds a an opening and closing bracket "[" that surrounds the whole data like this: var datascource = [{"id": 2, "name": "Fred", all the rest of the data for the whole process}]; If I paste the json directly into the JavaScript function and manually delete the

[web2py] Re: How to create a nested json dictionary by loading data from a flat, parent-referencing list?

2019-03-20 Thread Alex Glaros
"as_trees" works great, but but how to remove the "Row<" verbiage from the result? You mentioned "serialize the result into json". Can you please show example? At the current stage, the data looks like this: [, , etc thanks, Alex Glaros -- Reso

[web2py] Re: How to create a nested json dictionary by loading data from a flat, parent-referencing list?

2019-03-08 Thread Alex Glaros
ject_fk == db.object_super_object.id)).select().as_trees(parent_name=db.role_member.object_super_object_fk) File "C:\alex\alt_web2py_11_new_boot\web2py_win\web2py\gluon\packages\dal\pydal\objects.py", line 2470, in as_trees drows[row.id] = row File "C:\alex\alt_web2py_11_new_boot\w

[web2py] How to create a nested json dictionary by loading data from a flat, parent-referencing list?

2019-03-07 Thread Alex Glaros
Miao', 'title': 'department manager' }, { 'name': 'Chun Miao', 'title': 'department manager' } ] }; Could Pandas be used to convert the data? thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: 2.18.1 is OUT

2019-02-24 Thread Alex Glaros
am on Windows -- 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"

[web2py] Re: 2.18.1 is OUT

2019-02-24 Thread Alex Glaros
in default.py: from reportlab.platypus import * produces the following error: (ImportError('No module named reportlab.platypus',), )Version web2py™ Version 2.18.1-stable+timestamp.2019.02.24.06.24.15Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File "C:

[web2py] off topic - npm for visualization dependencies and set up

2019-02-24 Thread Alex Glaros
that mean it's also available for regular database work if I find any further use for it such as non-ACID transactions and searches? thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com

[web2py] Re: How to preserve line breaks in text field

2019-01-16 Thread Alex Glaros
story.append(Paragraph(escape(text), styles["Normal"])) On Tuesday, January 15, 2019 at 8:15:50 AM UTC-8, Alex Glaros wrote: > > When converting to PDF, line breaks from a text field are collapsed. How > to retain the line breaks? Here is the PDF-cr

[web2py] How to preserve line breaks in text field

2019-01-15 Thread Alex Glaros
also tried db.client_controlled_documentation_stakeholder_content.client_controlled_documentation_stakeholder_content_narrative_description.represent = lambda v, r: DIV(v, _style='white-space:nowrap') Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source cod

[web2py] how to wrap column titles in grid?

2018-11-23 Thread Alex Glaros
past due 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 to the Google Groups &qu

[web2py] Re: off topic: pg_dump syntax for pythonanywhere

2018-11-04 Thread Alex Glaros
Alexandra, I have not used it recently and only have my notes below: pg_dump --host=yourPythonAnywhereDbName.postgres.pythonanywhere-services.com --dbname=postgres_myDbName --(note: I don't know how to handle password) --port=10097 --username=yourPythonAnywhereRole --format=c

[web2py] sidebars still used in 2.17.2?

2018-10-29 Thread Alex Glaros
okay, guess I'll this use BS4 to create web page columns - https://getbootstrap.com/docs/4.0/layout/grid/ One of three columns One of three columns One of three columns -- Resources: - http://web2py.com -

[web2py] sidebars still used in 2.17.2?

2018-10-29 Thread Alex Glaros
Also, where is this linked from? It’s in the welcome site: \web2py\applications\examples\views\default\support.htm -- 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

[web2py] sidebars still used in 2.17.2?

2018-10-28 Thread Alex Glaros
}} {{include 'default/personal_connections_menu.html'}} {{end}} {{block right_sidebar}} {{end}} {{extend 'layout.html'}} thanks, Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p

Re: [web2py] no stack trace in error ticket (Python 3)

2018-10-17 Thread Alex
the issue is still > present. > > El 01/09/18 a las 12:28, Carlos Cesar Caballero Díaz escribió: > > maybe is related with Python version, let me test > > El 01/09/18 a las 11:44, Alex escribió: > > Hi Carlos, > > thanks for your response. On a Mac with Python 3

Re: [web2py] Re: how to create pdf report in web2py???

2018-09-25 Thread Alex
Django and web2py so it's easier for you to understand how everything fits together. regards, Alex On Tuesday, November 28, 2017 at 2:33:17 PM UTC+1, Ramos wrote: > > Great > I´m loving your tool... > Regards > > > 2017-11-28 13:29 GMT+00:00 Alex >: > >> yo

Re: [web2py] no stack trace in error ticket (Python 3)

2018-09-01 Thread Alex
Hi Carlos, thanks for your response. On a Mac with Python 3.7 this does not seem to happen. Does anyone know if it is related to the OS or Python version? Alex On Saturday, September 1, 2018 at 5:32:24 PM UTC+2, Carlos Cesar Caballero wrote: > > Hi Alex, seems a bug with Python 3,

[web2py] no stack trace in error ticket (Python 3)

2018-09-01 Thread Alex
the latest web2py 2.17.1, anyone got an idea what's wrong? Traceback (most recent call last): File "/home/alex/web2py/web2py_2.17.1/gluon/restricted.py", line 219, in restricted exec(ccode, environment) ZeroDivisionError: division by zero During handling of the above exceptio

[web2py] non-SMS 2FA

2018-08-01 Thread Alex Glaros
I've read that two-factor authorization using SMS is insecure <https://www.wired.com/story/two-factor-authentication-apps-authy-google-authenticator/> . Is there available, or has anyone installed google authentictor or authy on their sites? thanks Alex Glaros -- Resources:

Re: [web2py] Required field label

2018-06-22 Thread Alex Glaros
s = SQLFORM.factory(db.role_member_status_instance, labels={'role_member_status_fk':P('Role Member Status', B('*',_style= 'color:Red;font-size:140%'))}) thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google

[web2py] Re: python2 and python3 in 1 machine

2018-05-19 Thread Alex Beskopilny
You are right , sym-link is simple example. In multi-python multi-web2py envs I use to full path to python (centos 7 /etc/systemd/syste/gunicorn.service) --- [Unit] Description=Gunicorn instance to serve web2py After=network.target [Service] User=w2p Group=w2p

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread Alex Beskopilny
you missed adduser pyuser sudo su pyuser :( вторник, 8 мая 2018 г., 3:11:37 UTC+3 пользователь 黄祥 написал: > > plan to test web2py both python2 and python3 in 1 machine, any idea how to > do that in the safety way? > already googling found this: > > brew update > brew install python > brew

[web2py] Re: python2 and python3 in 1 machine

2018-05-18 Thread Alex Beskopilny
use anaconda . 1 adduser pyuser 2 su pyuser 3 install anaconda https://conda.io/miniconda.htmlto ~/opt 4 conda create --name mypython3 python=3 ln -s ~/.conda/envs/mypython3/bin/python3 ~/bin/mypy3 5 conda create --name mypython2 python=2 ln -s

[web2py] Re: FYI: A tutorial on how to customize export in SQLFORM.grid

2018-04-03 Thread Alex Beskopilny
Hi! exporter example 0 pip install xlwt 1 at end of gluon/sqlhtml.py class ExporterXLS(ExportClass): label = 'XLS' file_ext = "xls" content_type = ".xls" # https://gist.github.com/brendano/22764 # https://groups.google.com/forum/#!topic/web2py/MR_8JzzP9o4 def

[web2py] Re: compiling application ?

2018-03-02 Thread Alex Beskopilny
try this cd /home/w2p/web2py python -c "import gluon.compileapp; gluon.compileapp.compile_application('applications/myapp')" # for using gzip compression with nginx # https://www.digitalocean.com/community/tutorials/how-to-add-the-gzip-module-to-nginx-on-ubuntu-14-04 #

[web2py] Re: only static files forbidden on centos 7.4 apache 2.4

2018-02-14 Thread Alex Beskopilny
also, it's very useful sslh https://github.com/yrutschle/sslh works fine with nginx суббота, 10 февраля 2018 г., 17:11:43 UTC+3 пользователь lucas написал: > > hey all, > > setting up a new server on centos 7.4 and apache 2.4. web2py is running > fine for i get the welcome content but none of

[web2py] Re: only static files forbidden on centos 7.4 apache 2.4

2018-02-14 Thread Alex Beskopilny
we use nginx with http2 rebuild nginx with http2 support on centos 7 - export NXT_CC_NAME=gcc # default compiller for nginx OPENSSL="openssl-1.0.2h" # ok with nginx-1.11.13-1

[web2py] Re: only static files forbidden on centos 7.4 apache 2.4

2018-02-13 Thread Alex Beskopilny
nginx much better :) simple setup - https://www.digitalocean.com/community/tutorials/how-to-deploy-web2py-python-applications-with-uwsgi-and-nginx-on-centos-7 суббота, 10 февраля 2018 г., 17:11:43 UTC+3 пользователь lucas написал: > > hey all, > > setting up a new server on centos 7.4 and

[web2py] Re: Resetting the database

2018-01-29 Thread Alex Beskopilny
truncate with foreign-key depends on DB. for postgresql : def clear_tbls(): str1 = ','.join( [ t for t in db.tables() if "auth_" not in t] ) if len(str1): db.executesql( 'truncate {} RESTART IDENTITY'.format(str1) ) понедельник, 14 ноября 2011 г., 3:38:15 UTC+3

[web2py] Re: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

2018-01-15 Thread Alex Beskopilny
use encode () decode() for utf8 message example: 1 def cyr2upper(inp,up=True): if len(inp) > STR_LEN_LIMIT: inp= inp[:STR_LEN_LIMIT] try: inp=inp.decode('utf8') except UnicodeDecodeError, e: inp=u'Уточните данные , плс, :)' symbols =

[web2py] Re: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

2018-01-14 Thread Alex Beskopilny
we can set page encoding in models/db.py T.force('ru') if request.env.wsgi_url_scheme in ['https', 'HTTPS']: session.secure() ... пятница, 5 января 2018 г., 22:41:19 UTC+3 пользователь Alexey Zaytsev написал: > > >

[web2py] Re: web2py gunicorn dockerfile

2018-01-09 Thread Alex Beskopilny
small fix - use dockerDNS 1 # run.sh docker rm $(docker stop $(docker ps -a -q --filter ancestor=w2pnginx --format="{{.ID}}")) docker rm $(docker stop $(docker ps -a -q --filter ancestor=w2pguni --format="{{.ID}}")) docker network rm w2pnet docker network create --subnet=172.25.0.0/16 w2pnet

[web2py] Re: web2py gunicorn dockerfile

2018-01-09 Thread Alex Beskopilny
four files in same directory 1 #guniDoc FROM python:2.7 RUN apt update && apt install -y unzip wget ENV PATH=/usr/local/bin:$PATH RUN pip install gunicorn RUN useradd -m -r web2py USER web2py WORKDIR /home/web2py RUN wget -c http://web2py.com/examples/static/web2py_src.zip && \ unzip -o

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread Alex Beskopilny
small fix 1 FROM python:2.7 RUN apt update && apt install -y unzip wget RUN /usr/local/bin/pip install gunicorn RUN groupadd -r web2py && useradd -m -r -g web2py web2py USER web2py WORKDIR /home/web2py RUN wget -c http://web2py.com/examples/static/web2py_src.zip && unzip -o web2py_src.zip &&

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread Alex Beskopilny
1 Dockerfile FROM python:2.7 RUN apt update && apt install -y unzip wget RUN /usr/local/bin/pip install gunicorn RUN groupadd -r web2py && useradd -m -r -g web2py web2py USER web2py RUN cd /home/web2py/ && wget -c http://web2py.com/examples/static/web2py_src.zip && unzip -o web2py_src.zip

[web2py] Re: web2py gunicorn dockerfile

2018-01-05 Thread Alex Beskopilny
Hi set WORKDIR in Dockerfile .. WORKDIR /home/site/web2py EXPOSE 80 CMD . /home/.. .. docker run 3001:80 image-name On Friday, January 5, 2018 at 5:45:04 AM UTC+3, 黄祥 wrote: > > just wondering why gunicorn dockerfile with web2py/anyserver.py is not > work when use with python:2.7

[web2py] Re: execute web2py modules in terminal on 2.16.1

2018-01-04 Thread Alex Beskopilny
Hi! replace print "install" with print ("install") On Tuesday, January 2, 2018 at 10:06:31 PM UTC+3, 黄祥 wrote: > > cant execute from terminal web2py modules while in previous version is > work fine > *step on local machine (terminal)* > python -V > Python 2.7.10 > cd > rm -rf

[web2py] Re: Creating users and set the password, how??

2017-12-22 Thread Alex Beskopilny
#model/db.py if not db().select(db.auth_user.ALL).first(): uid=db.auth_user.insert( password = db.auth_user.password.validate('mypassword')[0], email = 'n...@null.com', first_name = 'Sy', last_name = 'Adm', )

[web2py] Re: fonts.googleapis

2017-12-13 Thread Alex Beskopilny
On Friday, December 8, 2017 at 1:06:35 PM UTC+3, T.R.Rajkumar wrote: > > I have an application. The views extend layout.html. When there is no > internet connection my pages wait for fonts.googleapis.com > I dont want that to happen. How to remove the dependecy on > fonts.gooleapis.com >

[web2py] css missing on startup page for Version 2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Roc

2017-12-10 Thread Alex Glaros
is there any css missing on startup page for windows: Version 2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Rocket 1.2.6, Python 2.7.9) see top links and whited out button on attached thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation

[web2py] Re: fonts.googleapis

2017-12-08 Thread Alex Beskopilny
On Friday, December 8, 2017 at 1:06:35 PM UTC+3, T.R.Rajkumar wrote: > > I have an application. The views extend layout.html. When there is no > internet connection my pages wait for fonts.googleapis.com > I dont want that to happen. How to remove the dependecy on > fonts.gooleapis.com > hI!

[web2py] Re: Glyphicons not showing

2017-12-07 Thread Alex Glaros
>From another thread here: Bootstrap 4 dropped the bootstrap 3 included glyphicons. You need to use fontawesome or something like that and give a ui dict to grid with the proper classes to use. Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

Re: [web2py] Re: how to create pdf report in web2py???

2017-11-28 Thread Alex
your attached report is only 1,8 kB reports can get large in case you include large images. currently the image data itself is not resized, so if you have a very large image the report could get very large as well. Further if you use additional fonts the fonts are embedded in the pdf. about

  1   2   3   4   5   6   7   8   9   10   >