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:
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' +
myid = 10L
sql_str = "xxx where id=%s;" % (str(myid))
db.executesql( sql_str )
examples: https://web2py.wordpress.com/tag/db-executesql/
On Friday, November 20, 2020 at 7:56:07 AM UTC+3 alexg...@gmail.com wrote:
> for example
>
> where mytable.id = someWeb2PyVariable
>
> thanks,
>
>
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
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,
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,),
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
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,
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=
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),
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) ] +
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
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
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(
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):
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:
-
[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
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
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
суббота, 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
>
>
суббота, 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
>
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
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
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',
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
понедельник, 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;
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
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
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
>
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
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
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
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
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
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
#
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
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
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
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
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 =
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
написал:
>
>
>
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
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
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 &&
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
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
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
#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',
)
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
>
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!
50 matches
Mail list logo