Re: [web2py] Systemd/uwsgi issue on setup-web2py-nginx-uwsgi-ubuntu.sh install

2016-12-09 Thread wish7code
Yes, I took master.. I think, I now identified the issue: the installer starts the service on first run (see https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L218), but it fails to activate it permanently. What's missing here is a systemctl enable emper

[web2py] Re: Starting scheduler worker from controller

2016-12-09 Thread Gael Princivalle
Ok I've made the perfect system that start a new worker when it's necessary. My problem is that web2py don't run the tasks and I don't know why (so my system is not so perfect!!). I've add this task in the scheduler. It only save a file "alert_file.txt": def save_alert_file(): file = open('

[web2py] Scheduler task every first day of every month ?

2016-12-09 Thread António Ramos
Hello all, i dont know how to define a task to run every 1st day of every month. Thank you Antonio -- 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 r

[web2py] Re: assign content to sqlform help-block

2016-12-09 Thread Pierre
this one was tough form = SQLFORM() form.elements('span.help-block')[2].insert(0, T("blablablabla.")) -- 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] Re: Scheduler task every first day of every month ?

2016-12-09 Thread 黄祥
pls try : *controllers/default.py* start_bom = '%s-%s-01 00:00:00' % (request.now.year, request.now.month) def queue_task_0(): scheduler.queue_task('scheduler_name', start_time = start_bom, next_run_time = start_bom) session.flash = T("Task 0 Queued") redirect(URL('index.html') ) best regards, s

[web2py] Re: Video write

2016-12-09 Thread Marlysson Silva
How are your code? Em quinta-feira, 8 de dezembro de 2016 22:33:04 UTC-3, J Boggy escreveu: > > Yes .i have been try >

[web2py] Re: Blog Template - Github

2016-12-09 Thread Marlysson Silva
What your doubt? Em quinta-feira, 8 de dezembro de 2016 18:07:26 UTC-3, David escreveu: > > Thanks for replying > > The correct address is > http://hypenews.pythonanywhere.com/init/default/hypenewsthehypenewsqq123 > > I created the repository but step two has me stumped. Can you elaborate? > >

[web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread Marlysson Silva
The problem it with make the sheduler or with date? To try using some_year/some_month/1 dont't work? Em sexta-feira, 9 de dezembro de 2016 07:17:14 UTC-3, Ramos escreveu: > > Hello all, > i dont know how to define a task to run every 1st day of every month. > > Thank you > Antonio > -- Resourc

Re: [web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread António Ramos
and via appadmin how do i do that? 2016-12-09 11:44 GMT+00:00 黄祥 : > pls try : > *controllers/default.py* > start_bom = '%s-%s-01 00:00:00' % (request.now.year, request.now.month) > > def queue_task_0(): > scheduler.queue_task('scheduler_name', start_time = start_bom, > next_run_time = start_bom)

[web2py] Re: good solution for indexing script which should run always

2016-12-09 Thread Mirek Zvolský
So I have received no recommendation to this. There was no problem with the systemd service, but (to be more portable,...) I have moved now to the scheduler. If somebody is interested, here is my code. I can/need initialize the scheduler with one (admins) access to url myapp/sysadmin/start_idx.

Re: [web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread António Ramos
how do i define first day of every month ? [image: Imagem inline 1] 2016-12-09 12:18 GMT+00:00 Marlysson Silva : > The problem it with make the sheduler or with date? > > To try using some_year/some_month/1 dont't work? > > > Em sexta-feira, 9 de dezembro de 2016 07:17:14 UTC-3, Ramos escreveu:

Re: [web2py] Re: Web2py with ngix

2016-12-09 Thread Mirek Zvolský
Thanks, Richard. I have my Web2py fork and I will send PR in the future if I will know, what to improve. I have just now compared current Web2py script --vs-- version of script I have used (it was in my fork, but I have reinstalled without it) --vs-- configuration files on my well working serve

Re: [web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread Marlysson Silva
Why you don't make this programmatically? there you could use libs as calendar to get first day of the month.. Or get current day and calculate difference to next first day of the month Em sexta-feira, 9 de dezembro de 2016 10:44:34 UTC-3, Ramos escreveu: > > how do i define first day of every mo

[web2py] Re: Blog Template - Github

2016-12-09 Thread David
"Git init in your folder" I'm not sure what this means -- 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 subscri

[web2py] Re: Blog Template - Github

2016-12-09 Thread Marlysson Silva
Do you have git installed in your pc? Em sexta-feira, 9 de dezembro de 2016 12:15:22 UTC-3, David escreveu: > > "Git init in your folder" > > I'm not sure what this means > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: Smartgrid linked tables gotcha

2016-12-09 Thread Eric Waldman
Bumping this because it saved me while trying to figure out why my tables weren't linking. I don't believe this is mentioned anywhere in the book/docs and they should be updated. Is there any way I can help with that? On Tuesday, October 15, 2013 at 3:00:09 PM UTC-4, Cliff Kachinske wrote: > > A

Re: [web2py] Re: auth.settings.registration_requires_approval has no effect

2016-12-09 Thread Teemu R
I fought today with this specific issue (whatever I did, I was not able to get registrations to having a pending state, but all new registrations ended up being logged in immediately.) The culprit in my case turned out to be an innocent looking row that somehow had been inserted at the beginnin

[web2py] Non-Editable field in SQLFORM

2016-12-09 Thread Amit Kumar Modak
Hello, How can I make a field non-editable in SQLFORM, while it should be allowed to take a value in insert. Regards, Amit -- 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] download stream file

2016-12-09 Thread Htet Wai Kyu
def serve(): filename=request.args(0) response.headers['ContentType']="application/octet-stream"; response.headers['Content-Disposition']='attachment;filename='+filename; path=os.path.join(request.folder,"static","videos",filename) return response.stream(path) Download It's wo

[web2py] Re: DAL SQLFORM.grid sort error

2016-12-09 Thread Michael Griffiths
I had this exact error. Turned out I was setting request.vars['order'] to a value that conflicted with SQLFORM.grid. If your using the 'order' variable name - change it to something else. On Monday, September 14, 2015 at 11:10:12 PM UTC+10, Dmitri Ermolaev wrote: > > DAL error > h = CAT( >

Re: [web2py] Re: Removing need for first and last name in auth

2016-12-09 Thread Alexei Vinidiktov
Thanks, stifan. Now, the only problem is the first and last name fields on the profile page are required. Can I make them optional? On Fri, Dec 9, 2016 at 4:28 AM, 黄祥 wrote: > i think you can use conditional if to check the url and then hide the > fields > e.g. > if 'register' in request.args :

Re: [web2py] Show images and pdf online

2016-12-09 Thread Massimo Di Pierro
assuming db.define_table('mytable',Field('myfile','upload')) and from = SQLFORM(db.mytable) and record = db.mytable(somenumber) You can do {{if record.myfile.endswith('.jpg'):}} {{else:}} download {{pass}} On Monday, 5 December 2016 22:06:58 UTC-6, Áureo Dias Neto wrote: > > No, th

Re: [web2py] Re: Web2py with ngix

2016-12-09 Thread Richard Vézina
Yes, there were a lot of changes related to systemd as the way to init deamon as change a lot... Despite all the criticism about systemd, I found it a lot more simpler to write init (just a few lines of code) compare to the old /etc/init.d/ bash script file... Regards Richard On Fri, Dec 9, 20

[web2py] Re: switch to python 3

2016-12-09 Thread Massimo Di Pierro
Very interested. In fact I recently made this: http://iotcallme.com/ (still experimental) Massimo On Wednesday, 7 December 2016 06:48:45 UTC-6, dlypka wrote: > > I propose a new framework: > things2py > (Massimo might guess what I am talking about - think hardware and the "T" > in IoT). > I hav

[web2py] Re: Jquery Decision Tree

2016-12-09 Thread Massimo Di Pierro
Sorry I just got It. My recommendation is to use vue.js here is an example Shoot! a: ${a}, b:${b}, c:${c}, message:${message} https://cdnjs.cloudflare.com/ajax

[web2py] Re: Blog Template - Github

2016-12-09 Thread David
Yes, I just now downloaded it to my laptop and went through the tutorial -- 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

Re: [web2py] Systemd/uwsgi issue on setup-web2py-nginx-uwsgi-ubuntu.sh install

2016-12-09 Thread Richard Vézina
Yes, you should have a look if there is no issue open, open a new issue, and if there is no PR pending correcting this issue submit one... I fix that in my own environnement restoring script, but I guess I forgot to report this problem, but I remember having notice this issue a couples of months a

Re: [web2py] Systemd/uwsgi issue on setup-web2py-nginx-uwsgi-ubuntu.sh install

2016-12-09 Thread Richard Vézina
If you include the id of the issue in your commit message it will close the opened issue when your PR will be accepted. Richard On Fri, Dec 9, 2016 at 10:55 AM, Richard Vézina wrote: > Yes, you should have a look if there is no issue open, open a new issue, > and if there is no PR pending corre

[web2py] Re: reading file from path

2016-12-09 Thread Massimo Di Pierro
What error do you get? I am surprised about the file name. Normally files in uploads are put there but SQLFORM and they have a much longer name. On Thursday, 8 December 2016 20:33:40 UTC-6, J Boggy wrote: > > I USE cv2.VideoCapture(os.path.join(reques.folder,'uploads','success.mp4') > to get vid

Re: [web2py] Re: Web2py with ngix

2016-12-09 Thread wish7code
https://github.com/web2py/web2py/issues/1545 Cheers Toby On Friday, 9 December 2016 02:32:58 UTC+1, Richard wrote: > > Could you link issue here? > > > Richard > > On Thu, Dec 8, 2016 at 5:03 PM, > wrote: > >> I just posted an issue with uwsgi and setup-web2py-nginx-uwsgi-ubuntu.sh to >> the mai

Re: [web2py] Systemd/uwsgi issue on setup-web2py-nginx-uwsgi-ubuntu.sh install

2016-12-09 Thread wish7code
Sorry, I guess I just opened a duplicate issue.. The behaviour was already reported with https://github.com/web2py/web2py/issues/1443 On Friday, 9 December 2016 16:55:34 UTC+1, Richard wrote: > > Yes, you should have a look if there is no issue open, open a new issue, > and if there is no PR p

[web2py] Difference of two date field in years

2016-12-09 Thread Amit Kumar Modak
How to get the difference of two date field in years. dateutil.relativedelta.relativedelta is not working as it is not able to recognise date fields as date. Thanks, Amit -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Jquery Decision Tree

2016-12-09 Thread Massimo Di Pierro
To other web2py users. I would like to add that Mark Billion is a lawyer from Delaware. He is a terrific lawyer. Most importantly is the only lawyer I know who is also a developer. This is a unique set of skills and some of you may find valuable. Massimo On Friday, 9 December 2016 09:52:26 U

[web2py] global name 'web2py_extract' is not defined

2016-12-09 Thread Amit Kumar Modak
The following line of code is giving error global name 'web2py_extract' is not defined response.flash=web2py_extract('month', db.Player.DateOfBirth) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.

[web2py] Re: reading file from path

2016-12-09 Thread J Boggy
Sry my mistake. cap=cv2.VideoCapture(path to /static/videos/success.mp4). when i checked cap.isOpened() it return false but i also check os.path.exists(path to success.mp4) it return true.But it was not web2py error.it was opencv error.now i have been fixed. -- Resources: - http://web2py.com

[web2py] Re: Web2py multiple table joins

2016-12-09 Thread Val K
Maybe try to replace db.auth_user.id with auth.user.id or just auth.user_id On Friday, December 9, 2016 at 9:13:27 AM UTC+3, mfarees...@gmail.com wrote: > > Hi > I want to write a query in web2py. The purpose of this query is to return > all users that belong to a user group specified in the

[web2py] Re: global name 'web2py_extract' is not defined

2016-12-09 Thread Anthony
That means the function web2py_extract has not been defined within that context. Is that a function you created? If so, where is it defined, and in what context are you attempting to call it? On Friday, December 9, 2016 at 11:43:52 AM UTC-5, Amit Kumar Modak wrote: > > The following line of cod

[web2py] Re: Difference of two date field in years

2016-12-09 Thread Anthony
On Friday, December 9, 2016 at 11:31:37 AM UTC-5, Amit Kumar Modak wrote: > > How to get the difference of two date field in years. > dateutil.relativedelta.relativedelta is not working as it is not able to > recognise date fields as date. > Always show your code. -- Resources: - http://web2py.

[web2py] Re: Smartgrid linked tables gotcha

2016-12-09 Thread Anthony
On Friday, December 9, 2016 at 10:39:01 AM UTC-5, Eric Waldman wrote: > > Bumping this because it saved me while trying to figure out why my tables > weren't linking. I don't believe this is mentioned anywhere in the > book/docs and they should be updated. Is there any way I can help with that? >

Re: [web2py] improving DAL for normalized DB

2016-12-09 Thread Val K
Thank you for your reply, Richard! " a normalized way to represent web2py list:reference field with a proper many-to-many relation table " - yes! this is what I meant, 'alias_name' - just very bad example of field name - it isn't about aliasing - sorry for the mess About views I think I found

Re: [web2py] improving DAL for normalized DB

2016-12-09 Thread Richard Vézina
Note you can do such query : db(db.table.id > 0).select("sql_field_name AS new_sql_field_name") but I don't recall how you access value of a field query like that (plain sql passed into select...) You can experiment... There is a presentation from Anthony Bastardi about these undocumented feature

[web2py] Re: Difference of two date field in years

2016-12-09 Thread Dave S
On Friday, December 9, 2016 at 8:31:37 AM UTC-8, Amit Kumar Modak wrote: > > How to get the difference of two date field in years. > dateutil.relativedelta.relativedelta is not working as it is not able to > recognise date fields as date. > > > datetime.timedelta ? https://docs.python.org/2/lib

Re: [web2py] Re: Removing need for first and last name in auth

2016-12-09 Thread 黄祥
pls try *models/db.py* custom_auth_table = db[auth.settings.table_user_name] # get the custom_auth_table custom_auth_table.first_name.notnull = False custom_auth_table.last_name.notnull = False custom_auth_table.first_name.required = False custom_auth_table.last_name.requires = False auth.settin

Re: [web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread 黄祥
just an idea why not set default value? e.g. from gluon.scheduler import Scheduler scheduler = Scheduler(db) start_bom = '%s-%s-01 00:00:00' % (request.now.year, request.now.month) db.scheduler_task.start_time = start_bom db.scheduler_task. next_run_time = start_bom best regards, stifan -- Reso

Re: [web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread Dave S
On Friday, December 9, 2016 at 5:44:34 AM UTC-8, Ramos wrote: > > how do i define first day of every month ? > > [image: Imagem inline 1] > > 2016-12-09 12:18 GMT+00:00 Marlysson Silva >: > >> The problem it with make the sheduler or with date? >> >> To try using some_year/some_month/1 dont't wo

Re: [web2py] Re: Scheduler and Serial Port Problems

2016-12-09 Thread Richard Brown
Hi José, Thank you for your post. You are correct that it is a feature of the Arduino architecture that a transition on RTS resets the target microcontroller to enable automatic programming, and it is possible to disable this feature, either as you describe or by removing the capacitor which c

Re: [web2py] Re: Scheduler task every first day of every month ?

2016-12-09 Thread António Ramos
start_time=next_run_time??? 2016-12-09 21:50 GMT+00:00 黄祥 : > just an idea why not set default value? > e.g. > from gluon.scheduler import Scheduler > scheduler = Scheduler(db) > > start_bom = '%s-%s-01 00:00:00' % (request.now.year, request.now.month) > db.scheduler_task.start_time = start_bom >

[web2py] substantial increase in page load time after upgrade to web2py 2.14.6 (only for grid pages)

2016-12-09 Thread Gaurav Vichare
I did following steps to upgrade: 1. From admin panel, I cleaned, caches, sessions and errors using "clean". (also cleaned my browser cache and cookies) 2. Then created w2p package using "pack all" 3. Downloaded latest web2py 2.14.6 from http://web2py.com/init/default/download 4. Then installed

Re: [web2py] Re: Web2py with ngix

2016-12-09 Thread J Boggy
thz i have been solved. Now other error is i cannot import some module althougn i have been installed and tested on python. But in web2py controller i can't import module -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -