Re: [web2py] Re: book help

2017-08-16 Thread Dave S


On Wednesday, August 16, 2017 at 7:05:38 PM UTC-7, Richard wrote:
>
> When you push your branch over your repo it will appears over it, you need 
> to send PR then...
>
> Richard
>

GitHub Desktop sent the* PR *to my repo.   If I accept it there, can I then 
send it to the official one?

/dps


> On Wed, Aug 16, 2017 at 5:08 PM, Dave S > 
> wrote:
>
>>
>>
>> On Wednesday, August 16, 2017 at 6:30:52 AM UTC-7, Richard wrote:
>>>
>>> Now you make a PR (Pull Request)... But I think you commit againts 
>>> master/trunk... You should have create a branch (git checkout -b 
>>> branch/name-that-describe-the-nature-of-the-change)
>>>
>>>
>> Richard -- I've done PRs against the book before.  I got confused about 
>> what master was being pointed at, so the branch shows in MY repository 
>> instead of the official one.
>>
>> /dps
>>
>>  
>>
>>> Always 
>>> git checkout master, make sure master is up to date then create a branch 
>>> from master... 
>>>
>>>
>>> *Step by step commands :*
>>>
>>> git fetch upstream
>>> git merge upstream/master
>>> git push origin master (update you github clone repo)
>>> *Then*
>>> git checkout -b branch/name-that-describe-the-nature-of-the-change
>>> *Then make your change (don't edit to much file in the same commit, 
>>> preferably one file one change except of you change need modification to 
>>> many files at once)*
>>> git commit -m "your commit message description that shouldn't exceed 
>>> 50-70 characters"
>>> *Then *
>>> git push origin branch/name-that-describe-the-nature-of-the-change
>>> *Then you go over you github repo (clone) and you make a PR*
>>>
>>> *Before all this you need a local repository instance*
>>>
>>> *git clone git-repo-name 
>>> (https://help.github.com/articles/cloning-a-repository/ 
>>> )*
>>> *Then*
>>> *Configue origin and upstream : 
>>> https://help.github.com/articles/configuring-a-remote-for-a-fork/ 
>>> *
>>>
>>> *Of course you need git install and up to date and you need to configure 
>>> it 
>>> : 
>>> https://git-scm.com/book/fr/v1/Personnalisation-de-Git-Configuration-de-Git 
>>> *
>>> *In linux you can simply edit .gitconfig and paste :*
>>> [user]
>>> name = YOUR NAME
>>> email = your@domain.com
>>>
>>> Happy hacking and contribution...
>>>
>>> Richard
>>>
>>>
>>>
>>> On Wed, Aug 16, 2017 at 5:03 AM, Dave S  wrote:
>>>


 On Wednesday, August 9, 2017 at 4:44:45 AM UTC-7, Leonel Câmara wrote:
>
> 5. the ANY_OF validator also needs to be documented
>


 I've done pull requests for ASSIGNJS and ANY_OF, but they went to my 
 fork :-(

 https://github.com/snidelytoo/web2py-book/pulls>

 The Windows GitHub Gooey-App doesn't seem interested in having me 
 redirect them to the official tree.  If they can be grabbed from my fork, 
 or one of you can coach me in how to get them to the right place, then we 
 may have something.

 /dps



 -- 
 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" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> 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" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: book help

2017-08-16 Thread Richard Vézina
When you push your branch over your repo it will appears over it, you need
to send PR then...

Richard

On Wed, Aug 16, 2017 at 5:08 PM, Dave S  wrote:

>
>
> On Wednesday, August 16, 2017 at 6:30:52 AM UTC-7, Richard wrote:
>>
>> Now you make a PR (Pull Request)... But I think you commit againts
>> master/trunk... You should have create a branch (git checkout -b
>> branch/name-that-describe-the-nature-of-the-change)
>>
>>
> Richard -- I've done PRs against the book before.  I got confused about
> what master was being pointed at, so the branch shows in MY repository
> instead of the official one.
>
> /dps
>
>
>
>> Always
>> git checkout master, make sure master is up to date then create a branch
>> from master...
>>
>>
>> *Step by step commands :*
>>
>> git fetch upstream
>> git merge upstream/master
>> git push origin master (update you github clone repo)
>> *Then*
>> git checkout -b branch/name-that-describe-the-nature-of-the-change
>> *Then make your change (don't edit to much file in the same commit,
>> preferably one file one change except of you change need modification to
>> many files at once)*
>> git commit -m "your commit message description that shouldn't exceed
>> 50-70 characters"
>> *Then *
>> git push origin branch/name-that-describe-the-nature-of-the-change
>> *Then you go over you github repo (clone) and you make a PR*
>>
>> *Before all this you need a local repository instance*
>>
>> *git clone git-repo-name
>> (https://help.github.com/articles/cloning-a-repository/
>> )*
>> *Then*
>> *Configue origin and upstream :
>> https://help.github.com/articles/configuring-a-remote-for-a-fork/
>> *
>>
>> *Of course you need git install and up to date and you need to configure
>> it
>> : https://git-scm.com/book/fr/v1/Personnalisation-de-Git-Configuration-de-Git
>> *
>> *In linux you can simply edit .gitconfig and paste :*
>> [user]
>> name = YOUR NAME
>> email = your@domain.com
>>
>> Happy hacking and contribution...
>>
>> Richard
>>
>>
>>
>> On Wed, Aug 16, 2017 at 5:03 AM, Dave S  wrote:
>>
>>>
>>>
>>> On Wednesday, August 9, 2017 at 4:44:45 AM UTC-7, Leonel Câmara wrote:

 5. the ANY_OF validator also needs to be documented

>>>
>>>
>>> I've done pull requests for ASSIGNJS and ANY_OF, but they went to my
>>> fork :-(
>>>
>>> https://github.com/snidelytoo/web2py-book/pulls>
>>>
>>> The Windows GitHub Gooey-App doesn't seem interested in having me
>>> redirect them to the official tree.  If they can be grabbed from my fork,
>>> or one of you can coach me in how to get them to the right place, then we
>>> may have something.
>>>
>>> /dps
>>>
>>>
>>>
>>> --
>>> 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" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] pycharm and web2py - setup project

2017-08-16 Thread Richard Vézina
Real don't like needing to install pyDAL as pycharm install it in python
packages with pip... so you end with a specific version of pyDAL install
with kind of override your web2py included instance if the version is
superior to the version of web2py you work with... I just spent quite some
times figure out why I had weird trace back error that I never had before
searching where it was coming from... Until I recall that I had install the
pyDAL with pycharm... I un install it with pip then dam dam, work as
expected...

So for sure someone would better use virtual environment... I recall having
trying to configure pycharm project within venv, I think there is tool to
do so in pycharm I don't regularly use venv...

I would say never install pyDAL with pip without venv...

Richard

On Tue, Aug 15, 2017 at 10:07 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Ok, I confirm, I did have to install pyDAL too in order to allow
> autocompletion of db.define_table...
>
> I use to test in controller and it was working with request... Not sure
> why...
>
> I guess this is cause by the fact that pyDAL is a external product since
> sometimes and PyCharm didn't address this change...
>
> Richard
>
> On Mon, Aug 14, 2017 at 4:51 PM, Kirill Shatalaev 
> wrote:
>
>> Richard, as you can see at 2:20, parameter info is NOT working (indexing
>> is finished, view->parameter info or ctrl+p is not working too)
>> After that I've added pyDAL package (2:43)
>> And ONLY then it starting to work, yes (3:26).
>>
>> Pycharm is professional version, 2017.2.1
>>
>> понедельник, 14 августа 2017 г., 17:21:45 UTC+4 пользователь Richard
>> написал:
>>>
>>> hmm... I don't understand why you say it not working... Once the pycharm
>>> indexing end, at the end of your vid you have autocomplete working no???
>>>
>>> I do have last pycharm version
>>>
>>> PyCharm 2017.2
>>> Build *#PY-172.3317.103*, built on July 25, 2017
>>> JRE: 1.8.0_152-release-915-b5 amd64
>>> JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
>>> Linux 4.4.0-89-generic
>>>
>>> Richard
>>>
>>> On Mon, Aug 14, 2017 at 5:11 AM, Kirill Shatalaev 
>>> wrote:
>>>
 Richard, how did you do that?

 This is my scrincast on a clean installation and without any virtual
 environment. Does not work.

 https://youtu.be/51mmwUSJ_VM


 пятница, 11 августа 2017 г., 17:57:46 UTC+4 пользователь Richard
 написал:
>
> Kirill, I just try to create a new project and the autocompletion was
> working, so I guess the issue is limited to virtual environement...
>
>
> --
 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" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
>> 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" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py with js framework

2017-08-16 Thread António Ramos
The first video tut about this deserves a beer...


Sem
vírus. www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

2017-08-16 20:29 GMT+01:00 Val K :

> @Massimo and @All concerned
> Uploaded  to github with short
> manual and examples.
> Discussion is welcome!
>
>
> On Wednesday, August 16, 2017 at 6:00:36 AM UTC+3, Massimo Di Pierro wrote:
>>
>> I want to know more.
>>
>> On Tuesday, 15 August 2017 18:40:57 UTC-5, Val K wrote:
>>>
>>>
>>> Considering the number of views, this issue is quite exciting.
>>>
>>> Here is my experience. I use RapydML and  RapydScript to generate
>>>  Vue-components.
>>>
>>> I wrote brute-force parser + made some hacks of RapydML-compiler so, as
>>> exhaust I receive single js-file with embeded template as html-string.
>>>
>>> If anyone is interested, I can describe in more detail. In gVim it looks
>>> like this:
>>>
>>>
>>>
>>>
>>>
>>> 
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tuesday, August 15, 2017 at 8:23:34 AM UTC+3, Limedrop wrote:

 @Carlos...I don't know if this is better, but it is different.
 Probably more suited to bigger apps.  My basic assumption is that if you're
 going to use vue.js then, ultimately, it will be a lot easier if you stick
 to the proper vue.js way of doing things.  In general this means letting
 vue.js do it's stuff with the frontend and leaving web2py with the data and
 backend.

 Specifically it means setting up your view files like this:
 https://vuejs.org/v2/guide/single-file-components.html

 And using this:
 https://github.com/vuejs-templates/webpack

 In development mode I have web2py running on one port and node running
 on another (node's hot-reloading seems like magic, and you can use the
 chrome VueDevtools plugin to debug). When I'm ready to commit I run "npm
 run build".  The index file is then compiled to
 "/views/default/index.html", and the assets are compiled to "/static".

 In production I get web2py to serve the index file and then get vue.js
 to load whatever else it needs via ajax (axios).

 A basic outline of the key files are given below.  Note that these are
 just snippets to show you how you might do it...the code is incomplete and
 it will NOT work out-of-the-box.


 \web2py\applications\app\controllers\default.py

 def index():
 """ Starts vue.js session

 The uuid is injected into the html  tag as
 the id.  For example: 

 vue.js then uses status_load() to retrieve the session details.
 """
 uuid = session_new()
 return dict(UUID=uuid)

 def status_load():
 uuid, error = IS_MATCH('[0-9a-f]{8}-[0-9a-f]
 {4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\Z')(request.
 vars['uuid'])
 if error:
 raise HTTP(403, "Not authorized")
 query = (db.vue_session.uuid==uuid)
 session = db(query).select(orderby=~db.v
 ue_session.expiry_datetime).first()
 if not session:
 raise HTTP(403, "Not authorized")
 return response.json(session)


 \web2py\applications\app\views\index.html
 ## The COMPILED VUE.JS FILE GOES HERE!!!


 \vue\index.html
 
 
   
   
   
 
 
   
 

 \vue\src\App.vue
 
   
 
 
 
   
 

 
 export default {
   name: 'app',
   components: {
   },
   data () {
 return {
 }
   },
   computed: {
   },
   methods: {
   },
   mounted: function () {
 // The uuid is injected into the parentElement by web2py
 // The store will then use the uuid to get the session from web2py
 // and may redirect to the restore_point
 this.$store.dispatch('NEW_UUID', { uuid: this.$el.parentElement.id
 })
   }
 }
 

 \vue\src\store\index.js
 import Vue from 'vue'
 import Vuex from 'vuex'
 import axios from 'axios'
 import router from '../router'
 Vue.use(Vuex)
 var axiosi = axios.create({
   baseURL: '/myapp/default/',
   timeout: 5000
 })
 const store = new Vuex.Store({
   state: {
 // put your session variables here
   },
   actions: {
 NEW_UUID: function ({ commit, dispatch, state }, { uuid }) {
   // At the start of each session web2py gives us a uuid
   // We then go back to web2py and retrieve the session state
   commit('SET_UUID', { uuid: 

[web2py] Re: troubles with scheduler

2017-08-16 Thread Val K
Hi, Mirek!
It's to hard to say something, because  heaven knows what does `codex2020` 
look like (is there any outgoing db-connections/url-requests/sub processes) 
and what is the DB where the scheduler is mounted (Postgres?).
Exclusion method is universal - just make workers to dig something like 
Fibonacci numbers from fence to lunch with smoke breaks for a minute - if 
they will done the work then scheduler is OK 


On Wednesday, August 16, 2017 at 6:32:12 PM UTC+3, Mirek Zvolský wrote:
>
> I have a task about 15 minutes long which run great on localhost with 
> command
> python web2py.py -a "q" -K codex2020 -X
>
> In production, Debian9+systemd+nginx+uwsgi I have
> - emperor.uwsgi.service for web server,
> - web2py-scheduler.service for tasks, where
> ExecStart=/usr/bin/python /home/www-data/web2py/web2py.py -K 
> codex2020,codex2020,codex2020
>
> Task starts well, but after about 4 mins
> - workers are restarted (they have later different job id's),
> - scheduler_task has 1 RUNNING record
> - scheduler_run has 2 RUNNING records, first one with earlier worker, 
> second one with (new) restarted worker.
> There is no information (traceback or so) in the records, and all records 
> stay as RUNNING.
>
> The task is repeated from beginning.
> I have found this is (I think) because the systemd service restarts the 
> task after the crash.
>
> So when I run without the systemd service, just with the shell command
> nohup /usr/bin/python /home/www-data/web2py/web2py.py -K 
> codex2020,codex2020,codex2020 &
> then the 2nd record in scheduler_run is not created and the task stops.
>
> Both records in scheduler_task and scheduler_run stay as RUNNING without 
> any crash info (no traceback, times_failed=0,..).
> "jobs" command output before and after the crash is:
> jobs 
> [1]+  Running nohup /usr/bin/python 
> /home/www-data/web2py/web2py.py -K codex2020,codex2020,codex2020 & 
> root@mzDebian:/# jobs 
> [1]+  Donenohup /usr/bin/python 
> /home/www-data/web2py/web2py.py -K codex2020,codex2020,codex2020
>
> I show the postgres db content using DBeaver manager and after the task 
> crash I MUST RECONNECT. THE CONNECTION HANGS.
> So maybe it has nothing to do with web2py/scheduler.
>
> Any idea what could I try?
> Thanks, Mi
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: book help

2017-08-16 Thread Dave S


On Wednesday, August 16, 2017 at 6:30:52 AM UTC-7, Richard wrote:
>
> Now you make a PR (Pull Request)... But I think you commit againts 
> master/trunk... You should have create a branch (git checkout -b 
> branch/name-that-describe-the-nature-of-the-change)
>
>
Richard -- I've done PRs against the book before.  I got confused about 
what master was being pointed at, so the branch shows in MY repository 
instead of the official one.

/dps

 

> Always 
> git checkout master, make sure master is up to date then create a branch 
> from master... 
>
>
> *Step by step commands :*
>
> git fetch upstream
> git merge upstream/master
> git push origin master (update you github clone repo)
> *Then*
> git checkout -b branch/name-that-describe-the-nature-of-the-change
> *Then make your change (don't edit to much file in the same commit, 
> preferably one file one change except of you change need modification to 
> many files at once)*
> git commit -m "your commit message description that shouldn't exceed 50-70 
> characters"
> *Then *
> git push origin branch/name-that-describe-the-nature-of-the-change
> *Then you go over you github repo (clone) and you make a PR*
>
> *Before all this you need a local repository instance*
>
> *git clone git-repo-name 
> (https://help.github.com/articles/cloning-a-repository/ 
> )*
> *Then*
> *Configue origin and upstream : 
> https://help.github.com/articles/configuring-a-remote-for-a-fork/ 
> *
>
> *Of course you need git install and up to date and you need to configure 
> it 
> : https://git-scm.com/book/fr/v1/Personnalisation-de-Git-Configuration-de-Git 
> *
> *In linux you can simply edit .gitconfig and paste :*
> [user]
> name = YOUR NAME
> email = your@domain.com 
>
> Happy hacking and contribution...
>
> Richard
>
>
>
> On Wed, Aug 16, 2017 at 5:03 AM, Dave S > 
> wrote:
>
>>
>>
>> On Wednesday, August 9, 2017 at 4:44:45 AM UTC-7, Leonel Câmara wrote:
>>>
>>> 5. the ANY_OF validator also needs to be documented
>>>
>>
>>
>> I've done pull requests for ASSIGNJS and ANY_OF, but they went to my fork 
>> :-(
>>
>> https://github.com/snidelytoo/web2py-book/pulls>
>>
>> The Windows GitHub Gooey-App doesn't seem interested in having me 
>> redirect them to the official tree.  If they can be grabbed from my fork, 
>> or one of you can coach me in how to get them to the right place, then we 
>> may have something.
>>
>> /dps
>>
>>
>>
>> -- 
>> 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" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py with js framework

2017-08-16 Thread Val K
@Massimo and @All concerned  
Uploaded  to github with short 
manual and examples.
Discussion is welcome! 


On Wednesday, August 16, 2017 at 6:00:36 AM UTC+3, Massimo Di Pierro wrote:
>
> I want to know more.
>
> On Tuesday, 15 August 2017 18:40:57 UTC-5, Val K wrote:
>>
>>
>> Considering the number of views, this issue is quite exciting.
>>
>> Here is my experience. I use RapydML and  RapydScript to generate 
>>  Vue-components.
>>
>> I wrote brute-force parser + made some hacks of RapydML-compiler so, as 
>> exhaust I receive single js-file with embeded template as html-string.
>>
>> If anyone is interested, I can describe in more detail. In gVim it looks 
>> like this:
>>
>>
>>
>>
>>
>> 
>>
>>
>>
>>
>>
>>
>> On Tuesday, August 15, 2017 at 8:23:34 AM UTC+3, Limedrop wrote:
>>>
>>> @Carlos...I don't know if this is better, but it is different.  Probably 
>>> more suited to bigger apps.  My basic assumption is that if you're going to 
>>> use vue.js then, ultimately, it will be a lot easier if you stick to the 
>>> proper vue.js way of doing things.  In general this means letting vue.js do 
>>> it's stuff with the frontend and leaving web2py with the data and backend.
>>>
>>> Specifically it means setting up your view files like this:
>>> https://vuejs.org/v2/guide/single-file-components.html
>>>
>>> And using this:
>>> https://github.com/vuejs-templates/webpack
>>>
>>> In development mode I have web2py running on one port and node running 
>>> on another (node's hot-reloading seems like magic, and you can use the 
>>> chrome VueDevtools plugin to debug). When I'm ready to commit I run "npm 
>>> run build".  The index file is then compiled to 
>>> "/views/default/index.html", and the assets are compiled to "/static".
>>>
>>> In production I get web2py to serve the index file and then get vue.js 
>>> to load whatever else it needs via ajax (axios).
>>>
>>> A basic outline of the key files are given below.  Note that these are 
>>> just snippets to show you how you might do it...the code is incomplete and 
>>> it will NOT work out-of-the-box.
>>>
>>>
>>> \web2py\applications\app\controllers\default.py
>>>
>>> def index():
>>> """ Starts vue.js session
>>> 
>>> The uuid is injected into the html  tag as
>>> the id.  For example: >> id="14e4de39-dc9e-467f-a28e-9c78bd485bc1">
>>> 
>>> vue.js then uses status_load() to retrieve the session details.
>>> """
>>> uuid = session_new()
>>> return dict(UUID=uuid)
>>>
>>> def status_load():
>>> uuid, error = 
>>> IS_MATCH('[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\Z')(request.vars['uuid'])
>>> if error:
>>> raise HTTP(403, "Not authorized")
>>> query = (db.vue_session.uuid==uuid)
>>> session = 
>>> db(query).select(orderby=~db.vue_session.expiry_datetime).first()
>>> if not session:
>>> raise HTTP(403, "Not authorized")
>>> return response.json(session)
>>> 
>>>
>>> \web2py\applications\app\views\index.html
>>> ## The COMPILED VUE.JS FILE GOES HERE!!!
>>>
>>>
>>> \vue\index.html
>>> 
>>> 
>>>   
>>> 
>>>   
>>> 
>>> 
>>>   
>>> 
>>>
>>> \vue\src\App.vue
>>> 
>>>   
>>> 
>>> 
>>> 
>>>   
>>> 
>>>
>>> 
>>> export default {
>>>   name: 'app',
>>>   components: {
>>>   },
>>>   data () {
>>> return {
>>> }
>>>   },
>>>   computed: {
>>>   },
>>>   methods: {
>>>   },
>>>   mounted: function () {
>>> // The uuid is injected into the parentElement by web2py
>>> // The store will then use the uuid to get the session from web2py
>>> // and may redirect to the restore_point
>>> this.$store.dispatch('NEW_UUID', { uuid: this.$el.parentElement.id 
>>> })
>>>   }
>>> }
>>> 
>>>
>>> \vue\src\store\index.js
>>> import Vue from 'vue'
>>> import Vuex from 'vuex'
>>> import axios from 'axios'
>>> import router from '../router'
>>> Vue.use(Vuex)
>>> var axiosi = axios.create({
>>>   baseURL: '/myapp/default/',
>>>   timeout: 5000
>>> })
>>> const store = new Vuex.Store({
>>>   state: {
>>> // put your session variables here
>>>   },
>>>   actions: {
>>> NEW_UUID: function ({ commit, dispatch, state }, { uuid }) {
>>>   // At the start of each session web2py gives us a uuid
>>>   // We then go back to web2py and retrieve the session state
>>>   commit('SET_UUID', { uuid: uuid })
>>>   var data = {}
>>>   data.uuid = uuid
>>>   axiosi.post('status_load', data).then((response) => {
>>> commit('UPDATE_STATUS', { newState: response.data })
>>>   }, (err) => {
>>> console.log(err)
>>> router.push({ name: 'error', params: { errorMessage: 
>>> err.response.data } })
>>>   })
>>> }
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.

[web2py] troubles with scheduler

2017-08-16 Thread Mirek Zvolský
I have a task about 15 minutes long which run great on localhost with 
command
python web2py.py -a "q" -K codex2020 -X

In production, Debian9+systemd+nginx+uwsgi I have
- emperor.uwsgi.service for web server,
- web2py-scheduler.service for tasks, where
ExecStart=/usr/bin/python /home/www-data/web2py/web2py.py -K 
codex2020,codex2020,codex2020

Task starts well, but after about 4 mins
- workers are restarted (they have later different job id's),
- scheduler_task has 1 RUNNING record
- scheduler_run has 2 RUNNING records, first one with earlier worker, 
second one with (new) restarted worker.
There is no information (traceback or so) in the records, and all records 
stay as RUNNING.

The task is repeated from beginning.
I have found this is (I think) because the systemd service restarts the 
task after the crash.

So when I run without the systemd service, just with the shell command
nohup /usr/bin/python /home/www-data/web2py/web2py.py -K 
codex2020,codex2020,codex2020 &
then the 2nd record in scheduler_run is not created and the task stops.

Both records in scheduler_task and scheduler_run stay as RUNNING without 
any crash info (no traceback, times_failed=0,..).
"jobs" command output before and after the crash is:
jobs 
[1]+  Running nohup /usr/bin/python 
/home/www-data/web2py/web2py.py -K codex2020,codex2020,codex2020 & 
root@mzDebian:/# jobs 
[1]+  Donenohup /usr/bin/python 
/home/www-data/web2py/web2py.py -K codex2020,codex2020,codex2020

I show the postgres db content using DBeaver manager and after the task 
crash I MUST RECONNECT. THE CONNECTION HANGS.
So maybe it has nothing to do with web2py/scheduler.

Any idea what could I try?
Thanks, Mi

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Access a particular element of a form from pultiple form inside a page

2017-08-16 Thread Anthony
Please show your code and explain what you are trying to do. Do you want to 
access a DOM element via Javascript, a server-side DOM element, or a 
server-side form input value after submission?

Anthony

On Wednesday, August 16, 2017 at 7:27:26 AM UTC-4, Gyanendro Loitongbam 
wrote:
>
> How could I access a particular element of a form when I have multiple 
> form having same element name but different form name in a page?
> Please help me out with this issue. Thanks.
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: book help

2017-08-16 Thread Richard Vézina
Now you make a PR (Pull Request)... But I think you commit againts
master/trunk... You should have create a branch (git checkout -b
branch/name-that-describe-the-nature-of-the-change)

Always
git checkout master, make sure master is up to date then create a branch
from master...


*Step by step commands :*

git fetch upstream
git merge upstream/master
git push origin master (update you github clone repo)
*Then*
git checkout -b branch/name-that-describe-the-nature-of-the-change
*Then make your change (don't edit to much file in the same commit,
preferably one file one change except of you change need modification to
many files at once)*
git commit -m "your commit message description that shouldn't exceed 50-70
characters"
*Then *
git push origin branch/name-that-describe-the-nature-of-the-change
*Then you go over you github repo (clone) and you make a PR*

*Before all this you need a local repository instance*

*git clone git-repo-name
(https://help.github.com/articles/cloning-a-repository/
)*
*Then*
*Configue origin and upstream :
https://help.github.com/articles/configuring-a-remote-for-a-fork/
*

*Of course you need git install and up to date and you need to configure it
: https://git-scm.com/book/fr/v1/Personnalisation-de-Git-Configuration-de-Git
*
*In linux you can simply edit .gitconfig and paste :*
[user]
name = YOUR NAME
email = your.em...@domain.com

Happy hacking and contribution...

Richard



On Wed, Aug 16, 2017 at 5:03 AM, Dave S  wrote:

>
>
> On Wednesday, August 9, 2017 at 4:44:45 AM UTC-7, Leonel Câmara wrote:
>>
>> 5. the ANY_OF validator also needs to be documented
>>
>
>
> I've done pull requests for ASSIGNJS and ANY_OF, but they went to my fork
> :-(
>
> https://github.com/snidelytoo/web2py-book/pulls>
>
> The Windows GitHub Gooey-App doesn't seem interested in having me redirect
> them to the official tree.  If they can be grabbed from my fork, or one of
> you can coach me in how to get them to the right place, then we may have
> something.
>
> /dps
>
>
>
> --
> 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" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Admin UI - Error ticket less information in the latest web2py releases

2017-08-16 Thread Paolo Caruccio
ticket open https://github.com/web2py/web2py/issues/1740


Il giorno mercoledì 16 agosto 2017 04:58:17 UTC+2, Massimo Di Pierro ha 
scritto:
>
> very weird. Can you open a ticket about this?
>
> On Tuesday, 15 August 2017 10:19:42 UTC-5, Paolo Caruccio wrote:
>>
>> Hello everyone.
>>
>> In a view, I have a trivial NameError: name 'fattura' is not defined due 
>> to
>>
>> {{for ft in fatture:}}
>> {{=fattura.id}}
>> {{pass}}
>>
>> But the Error Ticket returned by web2py is different depending on the 
>> development environment.
>>
>> *Case 1 (best)*
>> SO: windows 8
>> Web2py: Version 2.14.6-stable + timestamp.2016.05.10.00.21.47
>> Python: Python 2.7.13
>>
>>
>> 
>>
>>
>> *Case 2*
>> SO: windows 8
>> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
>> Python: Python 2.7.13
>> *Filename missing*
>>
>>
>> 
>>
>>
>> *Case 3*
>> SO: Linux MInt 8.2
>> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
>> Python: Python 2.7.12
>> *The same as the case 2 but also Error snapshot and Python version are 
>> missing. *
>>
>>
>> 
>>
>>
>> *Case 4 (worse)*
>> SO: Linux MInt 8.2
>> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
>> Python: Python 3.6.2
>> *Python version, reference to filename and line are missing. New 
>> exception occurred.*
>>
>>
>> 
>>
>>
>>
>> Has anyone ever encountered this problem? How did he solve it?
>>
>> Thank you.
>>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Access a particular element of a form from pultiple form inside a page

2017-08-16 Thread Gyanendro Loitongbam
How could I access a particular element of a form when I have multiple form 
having same element name but different form name in a page?
Please help me out with this issue. Thanks.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: book help

2017-08-16 Thread Dave S


On Wednesday, August 9, 2017 at 4:44:45 AM UTC-7, Leonel Câmara wrote:
>
> 5. the ANY_OF validator also needs to be documented
>


I've done pull requests for ASSIGNJS and ANY_OF, but they went to my fork 
:-(

https://github.com/snidelytoo/web2py-book/pulls>

The Windows GitHub Gooey-App doesn't seem interested in having me redirect 
them to the official tree.  If they can be grabbed from my fork, or one of 
you can coach me in how to get them to the right place, then we may have 
something.

/dps



-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: have view, still getting generic

2017-08-16 Thread Dave S
 Admin let me mispell the directory ...
http://127.0.0.1:8000/admin/default/edit/shortcuts/controllers/default.py?id=controllers__default__py#shortcutsviewsdafaultaddsegmenthtml

Maybe I should have my routes.py map "dafault"  to "default".

/dps

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py with js framework

2017-08-16 Thread Carlos Kitu
@valk: wow, that looks great. One of the most annoying things of working with 
vue.js was the need to write html. 

After getting used to the helpful web2py's html helpers, writing pure html 
feels really verbose. With the code you showed, the view seems somewhat similar 
to working with html helpers, and also looks great to write the controller in 
python to have it translated to javascript, if you are used to python.
Thank you for sharing it.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Weird problems generating menu from database

2017-08-16 Thread Вячеслав Анатольевич

Thank you so much, Massimo!

That's what I need!

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py with js framework

2017-08-16 Thread Carlos Kitu
I agree with you, @limedrop, for a fully "reactive"(let's call it that way) 
application I would also go your way. The use case I described only makes sense 
if you only need a small part of your application truly reactive.
Best regards.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.