[web2py] Re: raise HTTP(503, "")

2018-05-15 Thread
already tried : raise HTTP(503, response.render('503.html') ) raise HTTP(503, response.view= '503.html') both return an error perhaps you can learn from this url: https://groups.google.com/forum/#!searchin/web2py/404|sort:date/web2py/5slFfxWJ_-k/FWBcDdJIBwAJ best regards, stifan -- Resources:

[web2py] legacy database : extract database models

2018-05-09 Thread
tryin to learn extract database models, all database is generated from web2py app, then create new web2py app named test1, copy the database (sqlite) to test1 databases folder, for mysql test is remaining from another web2py app *sqlite using terminal* python

[web2py] python2 and python3 in 1 machine

2018-05-07 Thread
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 install python3 any thought or comment? thx and best regards, stifan -- Resources: - http://web2py.com -

[web2py] Re: build api

2018-04-29 Thread
clear enough, thx anthony. in another thread, you said : As for @request.restful, it may be a bit slower because the decorator involves some additional logic, but most of the time will probably be spent on the select and the serialization anyway. *ref*:

[web2py] build api

2018-04-28 Thread
*controllers/api.py* #from gluon.tools import Service #service = Service() def call(): #session.forget() return service() @service.run def service_call(table_name, id): if id.isdigit() and int(id) > 0: content = db[table_name](id) else: content =

[web2py] Re: json-rpc

2018-04-24 Thread
*json rpc (1.1 and 2) * *for curl should be* curl -X POST -d '{"method": "add", "params": [42, 23], "id": 1}' -i http://127.0.0.1:8000/test/default/call/jsonrpc curl -X POST -d '{"method": "add", "params": {"a": 42, "b": 23}, "id": 1}' -i http://127.0.0.1:8000/test/default/call/jsonrpc curl -X

[web2py] Re: json-rpc

2018-04-24 Thread
trying to learn rpc *controllers/default.py* from gluon.tools import Service service = Service() def call(): return service() @service.xmlrpc @service.jsonrpc @service.jsonrpc2 def add(a, b): return a + b *using curl* curl -X GET -d '{"jsonrpc":"2.0","method":"add","params":["1","2"] }'

[web2py] Re: 1 field with 2 different represent

2018-04-23 Thread
thanks all, will try it best regards, stifan On Monday, April 23, 2018 at 10:06:52 PM UTC+7, Anthony wrote: > > Then in a view you could do something like: >> >> {{=record.mobile_phone.whatsapp}} >> > > Keep in mind that the represent function is not applied when adding an > individual field to

Re: [web2py] Re: web2py 2.16.1 and login menu on mobile systems NOT WORKING

2018-04-23 Thread
> > I'm sorry. What is "in trunk"? > it means you should try the fixed version from the github repo itself by: git clone --recursive https://github.com/web2py/web2py.git best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] 1 field with 2 different represent

2018-04-21 Thread
*case:* let say i have field mobile_phone in the table, i want whatever user input can shown in two format: 123 and https://api.whatsapp.com/send?phone=123;>123 is it possible to have 1 field with 2 different represent or should i create virtual field or just create new field? thx and best

Re: [web2py] _href to URL()

2018-04-20 Thread
m[0]}} {{pass}} {{pass}} {{pass}} best regards, stifan On Wednesday, March 7, 2018 at 9:46:53 PM UTC+7, Anthony wrote: > > On Wednesday, March 7, 2018 at 12:39:42 AM UTC-5, 黄祥 wrote: >> >> agree, so what is the be

[web2py] web2py pwa

2018-04-19 Thread
interest in learn web2py with pwa support, test the welcome scaffolding app, got unsatisified result using lighthouse (chrome extension) any pointer or suggestion where to start it? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: appconfig local vs api provide by another web2py app

2018-04-18 Thread
On Wednesday, April 18, 2018 at 9:12:22 PM UTC+7, Anthony wrote: > > Why not: > > myconf = AppConfig(configFile=os.path.join(request.folder, '..', > 'appconfig', 'private', 'app0.json')) > > Making an HTTP request will add some overhead, though it shouldn't matter > as long as you leave the

[web2py] Re: Automatically repeat field text in another before record insertion

2018-04-18 Thread
perhaps you can use before_insert callback or onvalidate, then assign article_link with the article_title that already converted with function .replace('', '-') best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] appconfig local vs api provide by another web2py app

2018-04-17 Thread
just curious, is there any performance difference while storing appconfig in local (private/appconfig.ini) or by using json api that provide by another web2py app? *objective* to create central configuration webapp between web2py app *e.g. for json api that provide by another web2py app*

[web2py] Re: Requires web2py 2.15.5 or newer?

2018-04-15 Thread
you can comment or delete the code in models/db.py (around line 15-16) *e.g. in web2py version 2.16.1* if request.global_settings.web2py_version < "2.15.5": raise HTTP(500, "Requires web2py 2.15.5 or newer") best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: StackShare

2018-04-15 Thread
yeah, 3 years later, web2py still not listed in stackshare, just interest what's another technology can be integrate with web2py listed in stackshare ref: https://stackshare.io/submit cheers, stifan On Friday, April 3, 2015 at 5:40:59 AM UTC+7, Louis Amon wrote: > > Just pointing out that

[web2py] Re: Using variables in db.table.field expressions

2018-04-08 Thread
perhaps you can print the value of fields writable then compare it *e.g.* field_writable = db.table.field.writable *ref:* http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Run-time-field-and-table-modification best regards, stifan -- Resources: - http://web2py.com -

[web2py] Re: How to update script deployment with the latest master commit ?

2018-04-05 Thread
perhaps you can change this part wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip with (untested and assuming git already installed on your machine) git clone --recursive https://github.com/web2py/web2py.git best regards, stifan -- Resources: - http://web2py.com -

Re: [web2py] How do I upload the .w2py file?

2018-04-03 Thread
like marco said, it's just tar.gz file, think you can extract it in web2py/applications folder with the command (not tested) tar -xzvf web2py_file.w2p best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: seperate the request.args() with the extension

2018-04-03 Thread
pardon, my bad, i misunderstood the place of extension, the extension should be after the function name, not the args one, so the above is work well, when put it like: curl -X GET -i http://127.0.0.1:8000/test/api/rows_as_list .xml

[web2py] Re: seperate the request.args() with the extension

2018-04-03 Thread
*controllers/api.py* def rows_as_list(): tablename = request.args(0) #id = request.args(1) id, ext = request.args(1).split('.') if int(id) > 0 : query = (db[tablename]['id'] == id) else: query = (db[tablename]['id'] > 0) #query = (db.table0.id > 0) rows = db(query).select().as_list() return

[web2py] seperate the request.args() with the extension

2018-04-03 Thread
is it possible to seperate the request.args() with the extension? *e.g.* *controllers/api.py* def rows_as_list(): tablename = request.args(0) id = request.args(1) if int(id) > 0 : query = (db[tablename]['id'] == id) else: query = (db[tablename]['id'] > 0) #query = (db.table0.id > 0) rows =

[web2py] Re: service function with header key

2018-04-03 Thread
after several test and relearn from the book *controllers/api.py* def http_api_key(): api_key = request.env.http_api_key # change api_key with the parameter you want in curl request header if api_key == 'your_api_key': query = (db.table0.id > 0) rows = db(query).select() else: rows =

[web2py] Re: service function with header key

2018-03-31 Thread
this post clearer than before *controllers/api.py* @service.json def get_table(table_name, id): response.headers['key'] = '123' return dict(content = db[table_name](id) ) *terminal* curl -X GET --user admin:password -i http://127.0.0.1:8000/test/api/call/json/get_table/table0/1 --header 'key:

[web2py] service function with header key

2018-03-31 Thread
just wondering how to create service function (restful or else) that can support something like this using web2py way (--header 'key: your-api-key') curl -X GET \ --url 'http://127.0.0.1:8000/test/api/table?id=1' \ * --header 'key: your-api-key'* any idea? thx and best regards, stifan --

[web2py] Re: web2py & react

2018-03-30 Thread
tried it for learn, nice app, at first thought that the form submitted will store in database, hehe *installation and running step :* *terminal_0* cd path/web2py/applications git clone https://github.com/jredrejo/web2pyreactpoc cd web2pyreactpoc/static/src npm install ./node_modules/.bin/webpack

[web2py] Re: How could I create a validator to show the field based on the membership?

2018-03-29 Thread
*pls try (not tested)* has_membership_admin = 'Admin' in set(auth.user_groups.values() ) db.table.field.readable = has_membership_admin or has_membership_admin = 'Admin' in set(auth.user_groups.values() ) db.table.field.show_if = has_membership_admin best regards, stifan -- Resources: -

Re: [web2py] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-23 Thread
yeah, already checked that too, just a suggestion, perhaps better to leave the vue code (under static/vue/*.min.js) unminified, it's make other learn the vue code that integrate with web2py more clearly best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-23 Thread
cool, thx for sharing *installation and running step :* *terminal_0* cd path/web2py/applications git clone https://github.com/marcomansilla/yava cd yava/dev npm install ./node_modules/.bin/grunt *terminal_1* python path/web2py/web2py.py --nogui --no-banner -a a -i 0.0.0.0 -p 8000 *terminal_2*

[web2py] Re: Allow to add new record from formdropdown list

2018-03-22 Thread
perhaps you can do it with bootstrap modal (in views) and dal table constructor comment *e.g. (not tested)* *models/db.**py* db.Firmware.DeviceID.comment = A(_class="glyphicon glyphicon-plus-sign", **{ "_data-toggle":"modal", "_data-target":"#modal_device"} ) *controllers**/default.**py* def

Re: [web2py] _href to URL()

2018-03-07 Thread
thanks for the pointer, anthony best regards, stifan -- 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

Re: [web2py] _href to URL()

2018-03-06 Thread
agree, so what is the best way to make a menu in web2py that can contain a href with it's attribute like accesskey and title? best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: SQLFORM.grid buttons

2018-03-06 Thread
in latest version web2py use bootstrap 4 that is by default doesn't include any icon for that, think you can try some of this option: 1. try trunk or github version, it included font awesome as an icon 2. put the icon by yourself in static/css side (font awesome or glyphicons.css) and put it on

[web2py] Re: Option to load modified appconfig in rocket server

2018-03-01 Thread
i think you can do it programmitacally, using the variable or create multiple appconfig.ini e.g. (dev_appconfig.ini), for the first suggestion, usually do this *models/db.py* from gluon.contrib.appconfig import AppConfig config_path = os.path.join(request.folder, 'private') configuration =

Re: [web2py] _href to URL()

2018-02-26 Thread
no worries, since massimo plan to release new web2py version, is MENU() helper already included in layout.html for the will coming version? or should we use custom menu-generating code for the will coming version ? thx n best regards, stifan -- Resources: - http://web2py.com -

Re: [web2py] _href to URL()

2018-02-26 Thread
1. start from scratch download web2py_src.zip from web2py.com in mac: 2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Rocket 1.2.6, Python 2.7.10) and pythonanywhere: (2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Unknown, Python 2.7.6)) 2. created new web2py app from admin 3.

[web2py] Re: cache response.render in views

2018-02-26 Thread
very detail and make everything clear thx anthony best regards, stifan -- 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

Re: [web2py] _href to URL()

2018-02-26 Thread
*web2py version :* 2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Rocket 1.2.6, Python 2.7.10) *step to reproduce:* 1. create new web2py app 2. edit models/menu.py response.menu = [ (T('Address'), False, URL('master', 'address'), [] ), (A('None', _href='/test/master/address',

Re: [web2py] _href to URL()

2018-02-25 Thread
@anthony, tested your code but the result is not expected, it's added another a href *usually use in response.menu :* (T('Address'), False, URL('master', 'address'), [] ), *result:* Address *change into :* (A('Address', _href='/test/master/address', _class='dropdown-item'), False, *None*),

[web2py] Re: cache response.render in views

2018-02-25 Thread
pardon, is this function is cached? on which side database, views, or function? *modules/test_report.py* @cache.action(time_expire = cache_time_expire, cache_model = cache_model, quick = cache_quick, prefix = cache_prefix) *# cache function, isn't it?* def report_0(cache_db, print_controller):

[web2py] cache response.render in views

2018-02-23 Thread
according to book : http://web2py.com/books/default/chapter/29/04/the-core?search=response.render, the response.render is used in controllers, let say, my controller is contain nested loop and i decide to put it on views, but i don't want to lose the web2py cache function *e.g.*

[web2py] Re: How to have a view getting data from a long running time controller ?

2018-02-13 Thread
just an idea, perhaps you can use loading animation (javascript, etc) in the view during waiting the long awaited data so that the user dont get bored, after the data is calculated, you can show the data in the view (replace the loading animation). best regards, stifan -- Resources: -

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

2018-02-10 Thread
better use nginx to serve web2py, found a lot of problem when using apache with web2py best regards, stifan -- 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: install js package to web2py

2018-02-10 Thread
i think, it's depend where do you installed it (global or not), assuming you follow the instruction on github and execute npm install nipplejs --save in folder static then in your view, you define the path on that folder e.g. not tested views/default/index.html best regards, stifan --

[web2py] Re: Help with MSSQL Connection

2018-02-07 Thread
i face the same problem, the solution above is not clear for me. any hints ? *installed pyodbc on docker container using alpine:latest image* apk add --no-cache python python-dev py-pip py-setuptools unzip wget openssl gcc build-base unixodbc-dev pip install pyodbc ... the rest of the code is

[web2py] Re: web2py modal forms

2018-02-05 Thread
pls try e.g. *models/db.py* db.table.auth_user.comment = A(_class = "glyphicon glyphicon-plus-sign", **{"_data-toggle":"modal", "_data-target":"#modal_table_auth_user"} ) *controllers/default.py* def modal_auth_user(): table = db.auth_user target_response = '(function($)

[web2py] Re: web2py gunicorn dockerfile

2018-02-04 Thread
done best regards, stifan -- 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] Re: how to hash the a users password in bash script

2018-02-04 Thread
pls try: *e.g.* *test/controllers/install.py (for running with curl)* def index(): if db(db.auth_permission).isempty() and db(db.auth_membership).isempty(): auth_user_id_1 = db.auth_user.insert(first_name = 'Admin', last_name = 'Admin', email = 'ad...@test.com', username = 'admin', password =

[web2py] Re: json to request.vars

2018-02-03 Thread
perhaps you can use restful web service ref: http://web2py.com/books/default/chapter/29/10/services#Restful-Web-Services best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: SQLFORM - update record, save datetime to table field

2018-02-02 Thread
think you can use grid parameter onupdate, then assign the request.now as the value ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: web2py gunicorn dockerfile

2018-01-27 Thread
want to share the docker stack recipe, if anyone interest perhaps i can pr to the web2py repo or share it on this group [stack] $ ls | grep web2py web2py-gunicorn-nginx web2py-rocket-nginx web2py-rocket-ssl-nginx web2py-rocket-ssl-nginx-db-adminer web2py-rocket-ssl-nginx-memcached

[web2py] Re: Clean app by script

2018-01-12 Thread
i think you can do it with shell script or batch script, create the script that remove (rm) or move (mv) the logs or error and execute it (manually (via web2py or terminal), schedully (cron) ) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: uploadfolder outside web2py

2018-01-12 Thread
pls try: table.image.uploadfolder = os.path.join(request.folder, '..', '..', '..', 'webapps', 'uploads') assuming there are folders: /home/web2py/applications/adminmod /home/webapps/uploads according to your path, i think it just a little adjustment of parent folder ,'..', '..' best regards,

[web2py] rocket web2py ssl non ssl

2018-01-09 Thread
if i'm not wrong, in the past we can run web2py using rocket for both port 443 (ssl) and 80 within 1 line command *e.g.* sudo python ~/web2py/web2py.py --nogui --no-banner -a 'a' -c web2py.crt -k web2py.key --interfaces=0.0.0.0:443:web2py.key:web2py.crt;0.0.0.0:80 -p 443 in recent version can

[web2py] Re: web2py gunicorn dockerfile

2018-01-09 Thread
it works well, my bad, forgot about shell variable is translated when created file using cat thanks and best regards, stifan -- 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: web2py gunicorn dockerfile

2018-01-09 Thread
thanks again alex, when executed same like previous tested in https://labs.play-with-docker.com, return an error (acceptable i think because the link and port provided is work (shown web2py welcome apps) ) *error traceback* PING 172.25.0.23 (172.25.0.23): 56 data bytes --- 172.25.0.23 ping

[web2py] Re: web2py gunicorn dockerfile

2018-01-09 Thread
thanks alex, tested in https://labs.play-with-docker.com, it works fine never thought to combine it with gunicorn and make nginx as a reverse proxy (correct me if i'm wrong, still not sure the different with forward proxy yet, hehe) and never thought to build some dockerfiles make it into 1 bash

[web2py] Re: web2py gunicorn dockerfile

2018-01-08 Thread
trying with latest ubuntu and web2py/scripts/setup-web2py-ubuntu.sh return an error Failed to connect to bus: No such file or directory step i took echo '# Emperor uWSGI script description "uWSGI Emperor" start on runlevel [2345] stop on runlevel [06] ## #remove the comments in the next section

[web2py] Re: Future of web2py

2018-01-07 Thread
any plan to work with another tools? ref: https://github.com/kamranahmedse/developer-roadmap thanks and best regards, stifan -- 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: web2py gunicorn dockerfile

2018-01-07 Thread
is there any dockerfile that contain web2py with nginx ? thanks and best regards, stifan -- 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

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread
after reread and relearn your dockerfile again it works with some modification with python image (installed gunicorn from pip install not from apt install, and port set into 8000, port 80 not work) docker run -p 80:80 imageid [2018-01-07 01:02:10 +] [8] [INFO] Starting gunicorn 19.7.1

[web2py] Re: web2py gunicorn dockerfile

2018-01-06 Thread
yes, it works when using os base image (tested using ubuntu (like in the first post), centos, debian, fedora), the problem occured when using python base image. the point is when using os base image, it took longer (to install prerequisites package like python curl, git, dll) than using python

[web2py] Re: web2py gunicorn dockerfile

2018-01-05 Thread
trying to modify but got another error *e.g.* *step i took on play-with-docker.com* cat < Dockerfile FROM python:2.7 RUN apt update && \ apt install -y unzip wget gunicorn RUN groupadd -r web2py && \ useradd -m -r -g web2py web2py USER web2py RUN cd /home/web2py/ && \ wget -c

[web2py] web2py gunicorn dockerfile

2018-01-04 Thread
just wondering why gunicorn dockerfile with web2py/anyserver.py is not work when use with python:2.7 image e.g. *step i took* cat < Dockerfile FROM python:2.7 RUN apt update && \ apt install -y unzip wget gunicorn RUN groupadd -r web2py && \ useradd -m -r -g web2py web2py USER web2py RUN cd

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

2018-01-04 Thread
it works well now, thanks alex and anthony best regards, stifan -- 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

[web2py] execute web2py modules in terminal on 2.16.1

2018-01-02 Thread
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/applications/test cp -R ~/web2py/applications/welcome/ ~/web2py/applications/test rsync -zavr ~/git/web2py/test ~/web2py/applications/

[web2py] auth actions_disabled in 2.16.1

2018-01-02 Thread
web2py latest version auth actions_disabled doesn't work anymore *models/db.py* #auth.settings.actions_disabled = configuration.take('auth.actions_disabled') auth.settings.actions_disabled = ['profile', 'register'] *result* the url to sign up is exist, when clicked the sign up it return 404 NOT

[web2py] Re: ChartistJS in web2py

2017-12-21 Thread
had you inspect it (chrome)? is it loaded in console tab in the browser inspection ? usually not put it (chartist.min.css and chartist.min.js) on the layout.html, just the html page that show the chart, because it will loaded in every page that extend layout.html (with or without the chart on

[web2py] Re: .gtilab-ci.yml for Continuous integration web2py projects

2017-12-20 Thread
*./gitlab-ci.yml* image: ubuntu:latest before_script: - apt-get update - apt-get install -y python python-pip python-setuptools unzip wget gunicorn - pip install --upgrade pip - wget -c http://web2py.com/examples/static/web2py_src.zip - unzip -o web2py_src.zip - rm -rf

[web2py] Re: How to translate extra fields in auth form?

2017-12-18 Thread
*pls try (not tested):* custom_auth_table = db[auth.settings.table_user_name] custom_auth_table.avatar.label = T('Avatar') best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: manage web2py app

2017-12-11 Thread
thanks for the detail info, richard, i'll learn more about it best regards, stifan -- 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

[web2py] Re: 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
no, i think, tested on web2py 2.16.1 src version, perhaps you still use the previous *.css, or need force refresh browser or you can inspect it through the browser and see in the console what is missing. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] manage web2py app

2017-12-08 Thread
just curious how do people manage their web2py app (versioning, testing, deployment), trying to combine the tools to web2py project like dropbox, github, jenkins, etc. e.g. # dropbox git run in terminal cd ~/dropbox/git/web2py/web2pyapp git clone https://github.com/username/web2pyapp cd

[web2py] Re: fonts.googleapis

2017-12-08 Thread
i think you can download it (*.ttf, *.woff, *.woff2, etc) and change the url (font.googleapis.com) into your downloaded path in your css best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Storing the value of a calculation in my db table

2017-11-25 Thread
there's a lot of way to achieve it, you can use computed (dal), before or after database callback (dal) or onvalidation (controller) ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Computed-fields

[web2py] Re: CREATING A SCHEDULED DATABASE BACKUP

2017-11-25 Thread
just an idea, why not use the backup database schedule to the system backup (cron, bacula, etc) to lower database web2py io? best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: How to distribute your applications as binaries¶

2017-11-22 Thread
On Thursday, November 23, 2017 at 12:19:51 PM UTC+7, mostwanted wrote: > > Hi guys, i am trying to make my application a widnows desktop app, (i'm > from Ubuntu), i'm reading the steps in the link below > >

[web2py] Re: Getting wrong Results with my grading system

2017-11-19 Thread
think the answer is right in front of you (just a matter of conditional logic): What i want is to reflect an a 'A' if a student gets anything between 100% and 80%, hence the line if perc>=100: grade='A' *pls try (not tested):* if perc>=80 and perc<=100: grade='A' and get grade 'B' if a student

[web2py] Re: web2py 2.16.1 is OUT

2017-11-16 Thread
just want to have access key like in previous version, now i used the default welcome menu btw just tested grid and smartgrid, showbuttontext = False, the icon is disappear *controllers/default.py* @auth.requires_login() def manage_users(): grid = SQLFORM.grid(db.auth_user, showbuttontext =

Re: [web2py] Web2Py + VueJS SPA (Webpack)

2017-11-14 Thread
i'm interest too, could you give some simple example (crud) to learn how it works? thanks and best regards, stifan -- 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

Re: [web2py] Re: web2py 2.16.1 is OUT

2017-11-14 Thread
yes, comment or delete the LI(_class = "divider") solve the problem, thank you massimo in previous version the menu can be created with *models/menu.py* if auth.user: response.menu += [ (SPAN(T('Settings'), _title = T('Settings') ), False, URL('settings', 'index'), [

Re: [web2py] Re: web2py 2.16.1 is OUT

2017-11-14 Thread
*Traceback (most recent call last):* File "/Users/sugizo/project/python/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/Users/sugizo/project/python/web2py/applications/test/controllers/install_demo.py", line 490, in File

Re: [web2py] Re: web2py 2.16.1 is OUT

2017-11-14 Thread
*Traceback (most recent call last):* File "/Users/MacBookPro/project/python/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/Users/MacBookPro/project/python/web2py/applications/test/views/default/index.html", line 60, in File

Re: [web2py] Re: web2py 2.16.1 is OUT

2017-11-13 Thread
forget it, just the variable name, old version use myconf, while in the recent version use configuration for appconfig best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: web2py 2.16.1 is OUT

2017-11-13 Thread
Traceback (most recent call last): File "/Users/MacBookPro/project/python/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/Users/MacBookPro/project/python/web2py/applications/test/views/default/user.html", line 129, in NameError: name

[web2py] Re: Upgrade Web2py version button broken on PythonAnywhere admin console

2017-11-06 Thread
i usually start from fresh, backup the application folder first then upgrade it (remove, download, then restart app) ref: http://www.web2pyslices.com/slice/show/1942/upgrade-web2py-on-pythonanywhere best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread
had you try: from gluon import utils best regards, stifan -- 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] static site generator

2017-10-31 Thread
is web2py can generate static site like cactus, jekyll, etc? is web2py can minified the static files e.g. css, js, html? what is template that web2py using django template, jinja or something else? thanks and best regards stifan -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: simple example of using d3.js for plotting Graphs based on data retreived from the data base

2017-10-31 Thread
never try d3.js but in highchart, i do *controllers/default.py* def form(): redirect_url = 'chart' form = SQLFORM.factory( #your_field ) if form.process(formname = request.function).accepted: # assign form variable response.new_window = URL(redirect_url, args = show) #redirect(URL(redirect_url,

[web2py] Re: firebird error when tries to execute auth.defines_tables()

2017-10-27 Thread
thanks villas, after modified the dal parameter DAL(..., ignore_field_case = True, entity_quoting = False, ...), theres a lot of thing deal with auth_user in firebird: e.g. 1. deal with auth_user password field (already posted above) auth.settings.password_field = 'password2'

[web2py] Re: Custom maintenance message

2017-10-21 Thread
learn from anthony respond in stackoverflow it is in routes.py in web2py root folder not in app root folder (tested using routes.py in app root folder is not work, no error occured but the result is not expected) *e.g. *(replace web2pyapp with your web2py application name) cd ~/web2py/ cp

[web2py] Re: Custom maintenance message

2017-10-20 Thread
i just interest for modif the 404 error not found, when trying to modif static/404.html, the result is not expected (no error traceback occur) e.g. *static/404.html* this page doesn't exist *result* invalid controller (123/index) *expected result* this page doesn't exist any idea to achieve it

[web2py] Re: response view with markdown

2017-10-20 Thread
got it, pretty much clear, thanks anthony, massimo and bernhart, perhaps for now i just stick with the bernhart code to transform markdown into html in controller, because i don't know how to create generic.md (or generic.markdown) that will transform markdown into html, hehe thanks and best

[web2py] Re: Restful api for uploading files

2017-10-18 Thread
had you read the book : http://web2py.com/books/default/chapter/29/10/services#Restful-Web-Services theres an example to do a post best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: response view with markdown

2017-10-17 Thread
why web2py can't render the views in markdown format that been assign (*.md) in most simple way? e.g. def testmd(): response.view = 'default/testmd.md' #response.render = 'default/testmd.md' return locals() think about github pages can render it thanks and best regards, stifan --

[web2py] Re: response view with markdown

2017-10-16 Thread
yes you are right, anthony, forgot to put the controllers in the response view. thanks. it's work like charm, thanks bernhard. e.g. controllers/default.py def testmd(): #response.view = 'default/testmd.md' #return locals() # Read plugin description and display. # Some logic

[web2py] response view with markdown

2017-10-15 Thread
i plan to reduce db io by put the static data that rarely change into markdown file (*.md) e.g. *controllers/default.py* def testmd(): response.view = 'testmd.md' return locals() views/default/testmd.md content is using web2py README.markdown content (just for testing) when access

Re: [web2py] Deleting a db table row

2017-10-14 Thread
think you can do it by store the user created id (auth.signature or code it by your self) in your table and use it as a condition *e.g. not tested* query = ((db.table.id == id) & (db.table.created_by == auth.user_id) ) db(query).delete() best regards, stifan > -- Resources: -

[web2py] Re: Did anybody got expiriences with WSL (Windows 10 and Ubuntu bash) ?

2017-10-13 Thread
great, thx 4 sharing, thought this day people use vagrant (vm) or docker (container) to use the *.nix env. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

<    1   2   3   4   5   6   7   8   9   10   >