[web2py] Re: Using Sphinx to document web2py based application

2016-06-03 Thread pysab
Hi,

Did you have decorators in your code when you made it work? 
If I have no decorator, the generation works with the includes but as soon 
as I have decorators, I can't manage make them known during the generation. 

Regards!

On Thursday, 28 April 2016 00:11:43 UTC+2, Leonel Câmara wrote:
>
> I made it work another day but I don't remember exactly how, what I did 
> was something like making sure all the folders in the app (namely the 
> models, controllers and the app folder itself) have an __init__.py then I 
> added the application folder to sys.path in conf.py
>

-- 
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: Is there a way to make scheduler tasks be picked by workers up even quicker?

2016-06-03 Thread Mark Smith
I just tried switching to a simple ajax call and like you said and it's 
much faster (and there's no unresponsiveness :) ) on pythonanywhere. When I 
test it locally I see a bit of unresponsiveness but I think that's because 
pythonanywhere has webworkers while locally there's only a single 
non-threaded web2py process?

Thanks for all the help Niphlod! Really appreciate it :).

On Friday, 3 June 2016 14:18:33 UTC-4, Niphlod wrote:
>
> an ajax request is just like a user hitting a page. 
> They get queued until a thread from your web-workers is free (which is 
> usually ALWAYS the case) and it gets executed right away.
> It'll definitely be quicker than the IPC done by the scheduler if you want 
> semi-realtime execution.  
>
> On Friday, June 3, 2016 at 7:39:44 PM UTC+2, Mark Smith wrote:
>>
>> Thanks for the response :). I want to explain my situation a bit more if 
>> that's alright with you Niphlod (I'm a newbie at web dev haha). You're 
>> right, I think I can use a simple ajax request to do it instead, however I 
>> think the task may run a bit slower/make the UI a bit unresponsive? From my 
>> understanding every connection is handled by a single thread so it might be 
>> the case where a 1-2 second task would take 3-4 seconds to run and in that 
>> time the server wouldn't be able to handle any further tasks (like updating 
>> other UI?). Not sure if the previous statements are true however. In my 
>> case when the user clicks "submit" there's no other UI interaction until 
>> the server returns back the results of the task so I don't think the UI 
>> will be any slower (since it'll be an ajax request), but the task might 
>> actually take longer for the server to run (though anything less than 6 
>> seconds would be an improvement :) ).
>>
>> I'll try implementing it with just an ajax request (and no scheduler) and 
>> get back with the results. Thanks again for the helpful response!
>> On Friday, 3 June 2016 12:45:19 UTC-4, Niphlod wrote:
>>>
>>> long story short, no. 
>>> You can get better "pick-up-times" (the time that elapses from when you 
>>> queue the task to when it's started) with the redis version of the 
>>> scheduler but in any case the worst possible scenario won't drop under 
>>> "heartbeat" which is 3 seconds. 
>>> Got it, would be wonderful if the scheduler was even snappier than it is 
>>> but the current limitation just makes sense for small corner cases, 
>>> which are:
>>> - need to run the task on another server than the web-serving one
>>> - need to run zillions of tasks in a hundred workers farm to offload 
>>> something the webserver can't keep up
>>>
>>> That being said, there's another, which is "need to run tasks that go 
>>> beyond the 60 seconds timeout which is enforced in most webservers"... but 
>>> in that case waiting 6 seconds is not that much in comparison.
>>>
>>> The thing here is : 
>>> a) you're using pythonanywhere, so you're out of "worker farms"
>>> b) your tasks are super-duper-speedy (they complete well-below the usual 
>>> timeout for webserver which is 60 seconds) 
>>> c) you want sub-6 seconds "pick-up time" 
>>>
>>> why don't you just use a simple ajax request ?
>>>
>>>

-- 
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] dumbest question ever: how do you jump to line in the w2p ide

2016-06-03 Thread Mark Billion
I cant find this anywhere, but Ive seen it somewhere.  Say Im editing in 
the admin application and want to jump to line 1000.  Whats the key binding 
for it?

Feel free to heckle as long as you also provide the answer ;)

-- 
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 deployment: LetsEncrypt Nginx auto renew deployment script

2016-06-03 Thread Mark Graves
Anthony,

Any idea if the ISRG root CA is included in browsers yet?

https://community.letsencrypt.org/t/which-browsers-and-operating-systems-support-lets-encrypt/4394

This is the most recent article I could find but it is over 6 months old.

-Mark

On Fri, May 27, 2016 at 7:31 AM, Anthony  wrote:

> On Friday, May 27, 2016 at 5:39:04 AM UTC-4, Mark Graves wrote:
>>
>> Thank Niphlod and Anthony.
>>
>> I agree.  The technology is not quite mainstream enough to really rely on
>> yet.
>>
>
> About a month ago, it was already the third largest certificate authority
> by number of certificates, and since then it has nearly doubled its number
> of issued certificates. Wordpress now offers it
> 
> on all (million-plus) custom domains that they host. And it has been 
> integrated
> with the Caddy web server
>  for automatic HTTPS.
>
> Anthony
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Mq_1YfEjrC8/unsubscribe.
> To unsubscribe from this group and all its topics, 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: new feature in trunk

2016-06-03 Thread Alex Glaros
okay, got this below to work but am confused about the resulting order data 
is displayed in.

DATA

post.id 

post.parent_id 

post.body 

1  None 

 
http://127.0.0.1:8000/checking_something/appadmin/update/db/post/2> 1 
 <2nd 
dog - re...
3  1 
 < 3nd 
dog dow...
4  2 
 
http://127.0.0.1:8000/checking_something/appadmin/update/db/post/5> 1 
 http://127.0.0.1:8000/checking_something/appadmin/update/db/post/6> 2 
 < 
record #6, ...

Here is the result:

This is the default/show1.html template <2nd dog - record #2 points to 1>  < record #6, points to 2> < 3nd dog down - record #3 
directly points to record# 1> 

shouldn't < 3nd dog down - record #3 directly points to record# 1>  be 
positioned right after parent record #1?

CONTROLLER

def show1():
def show(row,n=0):
return '  '*n+row.body+'\n'+''.join(show(c,n+1) for c in 
row.children)
roots = db(db.post).select().as_trees()
return locals()

MODEL

db.define_table('post',
Field('parent_id','reference post'),
Field('body'))


VIEW

{{extend 'layout.html'}}
This is the default/show1.html template
{{=show(roots[0])}}


   - How to wrap a href URL around each individual data item?
   - Is the resulting data intended to be feed into a visualizer like 
   fancyTree?
   

thanks

Alex

-- 
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: error starting scheduler: error retreiving status

2016-06-03 Thread Bart
Thanks Niphlod, It works!

I added 
self.db_thread.executesql("set search_path to scheduler, auth, ... ;")
in gluon/scheduler.py
after the self.db_thread = DAL(  line and before the 
self.define_tables( ... line

I am aware of the fact that it is not supported, but the database uses a 
strict schema policy so i don't have a choice really.

I am wondering how worker startup works when the python web2py.py -K myapp 
statement is executed.
How does the scheduler get the database uri, if the models aren't executed 
at scheduler worker startup?
Does scheduler only search for de db - DAL(... statement, omitting the 
other code?

Op vrijdag 3 juni 2016 20:24:01 UTC+2 schreef Niphlod:
>
> the scheduler though doesn't know anything about the search path when it 
> rebuilds its own model... that's why setting search_path is undocumented ^_^
>
> you can try fiddling with the source of the scheduler (along these lines 
> https://github.com/web2py/web2py/blob/master/gluon/scheduler.py#L948) to 
> set the same search path.
>
> Please be aware that even if it seems to work, support for it is not 
> assured (so use at your own risk)
>
> On Friday, June 3, 2016 at 7:19:02 PM UTC+2, Bart wrote:
>>
>> Hi Niphlod,
>>
>> Normally i just put a record in the scheduler_task table with appadmin. 
>> That works fine (no errors), but nothing happens because the scheduler 
>> worker is not running.
>>
>> In db.py the database schema is set via db.executesql("set search_path 
>> to auth,scheduler, ... ;")
>>
>> In case migrate is True, the search_path is set to scheduler, auth, ... 
>> just before the scheduler = Scheduler(db) statement.
>>
>>
>>
>> Op vrijdag 3 juni 2016 18:35:07 UTC+2 schreef Niphlod:
>>>
>>> what happens when you try to queue a task from the app ? AFAIK I'd be 
>>> eager to know how can it work if there is no "public" schema, unless you 
>>> tinkered with scheduler's table definitions
>>>
>>> On Friday, June 3, 2016 at 4:57:23 PM UTC+2, Bart wrote:

 Addition:

 I am using several schema's in the postgres database.

 The scheduler tables are in schema 'scheduler'

 Schema 'public' does not exist.

 Can this cause the problem?

>>>

-- 
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: new feature in trunk

2016-06-03 Thread Alex Glaros
how to pass it to the view? 


-- 
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] Issue with web2py and mongodb id's

2016-06-03 Thread arihant daga
I think his is an issue with web2py and mongo db and combo. 
When using mongodb as application's database the primary key is for some 
docment look like this in monogdb-  *26985031207145552773431411972*. While 
in mongoDB it's value is something like- 57317ea0f804663444afc504. 

*Now the problem is*- When i am sending in response a row with having id in 
json format,While parsing this JSON in Javascript it converts this id to 
it's scientific notation which is something like *"*
*2.7013073652338503e+28". *Wchich now we can't use for a reference.
for ex. 
itemID=JSON.parse('response of the request').['SomeRow'][0]['id];  


 here itemID varaible will not be equal to *26985031207145552773431411972 
and rather **2.7013073652338503e+28** . * So i can't send this itemID back 
to server for any further need. 
ex. 
"Veg Main Course":[
   
   1. {
  - "category":27013046129796342702616905670,
  - "description":"",
  - "price":100.0,
  - "is_active":true,
  - "id":27013073652338500677267916755,
  - "disabled":null,
  - "sales_count":null,
  - "image":"",
  - "name":"Aloo 65"
   }
   2. will convert to JS eval -
   3. "Veg Main Course":[
  1. {
 - "category":*2.7013046129796345e+28,*
 - "description":"",
 - "price":100,
 - "is_active":true,
 - "id":2.7013073652338503e+28,
 - "disabled":null,
 - "sales_count":null,
 - "image":"",
 - "name":"Aloo 65"
  },
   
Any suggestion for this ?? Can i use something else or does web2py have a 
solution for 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: reading values from request.vars

2016-06-03 Thread Anthony
On Friday, June 3, 2016 at 12:35:49 PM UTC-4, ktesr123...@gmail.com wrote:
>
> it is a single select, the values are populated from controller into a 
> view dynamically in jquery
>

OK, so what's wrong with your current approach? What are you trying to 
achieve? Hard to help without seeing your code (e.g., model definitions, 
etc.). Also, why are you using .getlist for a variable that isn't a list, 
and then just extracting the first element (which you would get if not 
using .getlist)?

Anthony


> On Friday, June 3, 2016 at 6:32:34 AM UTC-6, Anthony wrote:
>>
>> Hard to say because it's not clear (a) what kind of data are in opt1, 
>> opt2, etc. (are they multi-select widgets producing lists or just single 
>> selects?) and (b) how the form inputs map to your database fields.
>>
>> Anthony
>>
>> On Thursday, June 2, 2016 at 11:55:13 PM UTC-4, ktesr...@gmail.com wrote:
>>>
>>> Anthony
>>>
>>> I wanted to iterate all the values from request.vars these values are 
>>> passed using ajax function from View, in the View each row will have 3 drop 
>>> downs and 1 textbox to take input from user
>>> there can be minimum 1 row. I am passing all the control names thru ajax 
>>> function
>>>
>>> View
>>> ===
>>> 
>>> /* jquery that builds html form written here */
>>>
>>> ajax('{{=URL('insert_data')}}',['opt1','opt2','opt3','txtt1'],'target'); 
>>> // opt1, opt2 and opt3 are dropdown control names and txt1 is the name if 
>>> textbox control all are html controls dynamically crated using jquery
>>>
>>> 
>>> 
>>> 
>>>
>>> Controller
>>> ==
>>> def insert_timesheet():
>>>  
>>>  orglist = request.vars.getlist("opt1")
>>>  response.flash = str(orgval)
>>>
>>>  ##db.Table.insert(field1=opt1[0],.)
>>>  return locals()
>>>
>>>
>>>
>>> On Thursday, June 2, 2016 at 7:34:04 PM UTC-6, Anthony wrote:
>>>
 Please show some code and explain exactly what you want to do. To get a 
 particular value from request.vars, just do request.vars.name_of_variable.

 Anthony

 On Thursday, June 2, 2016 at 8:07:13 PM UTC-4, ktesr...@gmail.com 
 wrote:
>
> I am getting selected values from View to Controller using request.vars
>
> I can see the values are coming as key value pair but not able to 
> figure out how to read each value and insert them in DB
>
>
>

-- 
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] Issure with web2py- Problem in handling MongoDB BSON ids

2016-06-03 Thread arihant daga

I think his is an issue with web2py and mongo db and combo. 
When using mongodb as application's database the primary key is for some 
docment look like this in monogdb-  *26985031207145552773431411972*. While 
in mongoDB it's value is something like- 57317ea0f804663444afc504. 

*Now the problem is*- When i am sending in response a row with having id in 
json format,While parsing this JSON in Javascript it converts this id to 
it's scientific notation which is something like *"**2.7013073652338503e+28". 
*Wchich now we can't use for a reference.
for ex. 
itemID=JSON.parse('response of the request').['SomeRow'][0]['id];  


 here itemID varaible will not be equal to *26985031207145552773431411972 
and rather **2.7013073652338503e+28** . * So i can't send this itemID back 
to server for any further need. 
ex. 
"Veg Main Course":[
   
   1. {
  - "category":27013046129796342702616905670,
  - "description":"",
  - "price":100.0,
  - "is_active":true,
  - "id":27013073652338500677267916755,
  - "disabled":null,
  - "sales_count":null,
  - "image":"",
  - "name":"Aloo 65"
   }
   2. will convert to JS eval -
   3. "Veg Main Course":[
  1. {
 - "category":*2.7013046129796345e+28,*
 - "description":"",
 - "price":100,
 - "is_active":true,
 - "id":2.7013073652338503e+28,
 - "disabled":null,
 - "sales_count":null,
 - "image":"",
 - "name":"Aloo 65"
  },
   
Any suggestion for this ?? Can i use something else or does web2py have a 
solution for 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: Is there a way to make scheduler tasks be picked by workers up even quicker?

2016-06-03 Thread Anthony
On Friday, June 3, 2016 at 12:45:19 PM UTC-4, Niphlod wrote:
>
> long story short, no. 
> You can get better "pick-up-times" (the time that elapses from when you 
> queue the task to when it's started) with the redis version of the 
> scheduler but in any case the worst possible scenario won't drop under 
> "heartbeat" which is 3 seconds. 
>

The documentation claims tasks will be picked up within one heartbeat with 
immediate=True, though in this case it looks like it's taking at least 
three heartbeats. Is that to be expected unless using redis, in which case, 
we should update the docs?

Anthony

-- 
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: Modification in version 2.14.6 not documented ?

2016-06-03 Thread Anthony
The documentation you quote is for SQLFORM.grid, but you are using 
SQLFORM.smartgrid, which lets you use most of the grid parameters, but 
within a dictionary keyed for each table of the smartgrid. Nothing has 
changed.

Anthony

On Friday, June 3, 2016 at 3:33:36 PM UTC-4, omicron wrote:
>
> It's on smartgrid for my application
>
> Le vendredi 3 juin 2016 20:24:41 UTC+2, Niphlod a écrit :
>>
>> is this on grid or smartgrid ?
>>
>> On Friday, June 3, 2016 at 7:15:33 PM UTC+2, omicron wrote:
>>>
>>> I have just seen this modification for parameter 'exportclasses' in 
>>> grids. The manual say "If you pass a dict like 
>>> dict(xml=False, html=False)
>>>
>>> you will disable the xml and html export formats", but with the last 
>>> version you must change you code to pass a dict like this 
>>> dict(tablename = dict(xml=False, html=False))
>>>
>>>
>>> And it's the same for other dicts options like "maxtextlength" for 
>>> example.
>>>
>>>
>>>

-- 
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: Modification in version 2.14.6 not documented ?

2016-06-03 Thread omicron
It's on smartgrid for my application

Le vendredi 3 juin 2016 20:24:41 UTC+2, Niphlod a écrit :
>
> is this on grid or smartgrid ?
>
> On Friday, June 3, 2016 at 7:15:33 PM UTC+2, omicron wrote:
>>
>> I have just seen this modification for parameter 'exportclasses' in 
>> grids. The manual say "If you pass a dict like 
>> dict(xml=False, html=False)
>>
>> you will disable the xml and html export formats", but with the last 
>> version you must change you code to pass a dict like this 
>> dict(tablename = dict(xml=False, html=False))
>>
>>
>> And it's the same for other dicts options like "maxtextlength" for 
>> example.
>>
>>
>>

-- 
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] cloudflare SSL on pythonAnywhere

2016-06-03 Thread Alex Glaros
using cloudflare SSL 

but does not make the alias seem to be secure: 

http://www.engagementsquared.com/


PythonAnywhere said their browser shows above as correctly certed by 
clouldFlare, but my browser does not.

my host nameservers correctly state the clouldFlare server name

anyone have experience with this?  Do I have to edit routes.py?

thanks,

Alex Glaros

FROM PythonAnywhere: Actually, it's working correctly for 
www.engagementsquared.com (check the cert in your browser and you'll see 
that it's a CloudFlare cert) and alexglaros.pythonanywhere.com is using the 
cert that PythonAnywhere provides for all the domains that we host with 
pythonanywhere.com in the URL.


-- 
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] When will the next conference on web2py

2016-06-03 Thread LC LC
everything is in the  title

-- 
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: error starting scheduler: error retreiving status

2016-06-03 Thread Niphlod
the scheduler though doesn't know anything about the search path when it 
rebuilds its own model... that's why setting search_path is undocumented ^_^

you can try fiddling with the source of the scheduler (along these lines 
https://github.com/web2py/web2py/blob/master/gluon/scheduler.py#L948) to 
set the same search path.

Please be aware that even if it seems to work, support for it is not 
assured (so use at your own risk)

On Friday, June 3, 2016 at 7:19:02 PM UTC+2, Bart wrote:
>
> Hi Niphlod,
>
> Normally i just put a record in the scheduler_task table with appadmin. 
> That works fine (no errors), but nothing happens because the scheduler 
> worker is not running.
>
> In db.py the database schema is set via db.executesql("set search_path to 
> auth,scheduler, ... ;")
>
> In case migrate is True, the search_path is set to scheduler, auth, ... 
> just before the scheduler = Scheduler(db) statement.
>
>
>
> Op vrijdag 3 juni 2016 18:35:07 UTC+2 schreef Niphlod:
>>
>> what happens when you try to queue a task from the app ? AFAIK I'd be 
>> eager to know how can it work if there is no "public" schema, unless you 
>> tinkered with scheduler's table definitions
>>
>> On Friday, June 3, 2016 at 4:57:23 PM UTC+2, Bart wrote:
>>>
>>> Addition:
>>>
>>> I am using several schema's in the postgres database.
>>>
>>> The scheduler tables are in schema 'scheduler'
>>>
>>> Schema 'public' does not exist.
>>>
>>> Can this cause the problem?
>>>
>>

-- 
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] web2py 1.89.5

2016-06-03 Thread Roman Molotkovski
Thanks a lot! I'll test it when I'll get the chance. 
Really appreciate the help.

Roman

On Friday, June 3, 2016 at 9:29:23 PM UTC+3, Ricardo Pedroso wrote:
>
> On 6/3/16, Ricardo Pedroso  wrote: 
> > On 5/26/16, Roman Molotkovski  wrote: 
> >> 
> >> I've been looking for old versions of python and but I can't find 
> >> anything 
> >> older than 2.0.2 (on github). 
> >> A previous thread in this group mentioned this link : h 
> >> ttp://code.google.com/p/web2py/source/list 
> >>  which was supposedly 
> >> referring to older versions, but it just refers to the github 
> repository. 
> >> 
> >> I'm specifically interested in version 1.89.5. 
> >> Any ideas where can I get it? 
> > 
> > I found a web2py mercurial clone repository on my laptop with releases 
> > starting from 1.77.1 until 2.5.1. 
> > 
> > I did the following: 
> > 
> > $ hg checkout -r R-1.89.5 
> > $ hg archive /tmp/web2py-1.89.5.tar.gz 
> > 
> > I attached the resulting web2py-1.89.5.tar.gz (~5MB) 
> > 
>
> gmail didn't allow send the file. 
> I uploaded to google drive, you can download here: 
>
> https://drive.google.com/open?id=0B0DHm6u1f0KxWXIwVUdHWnc2aXc 
>
> Ricardo 
>

-- 
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] web2py 1.89.5

2016-06-03 Thread Ricardo Pedroso
On 6/3/16, Ricardo Pedroso  wrote:
> On 5/26/16, Roman Molotkovski  wrote:
>>
>> I've been looking for old versions of python and but I can't find
>> anything
>> older than 2.0.2 (on github).
>> A previous thread in this group mentioned this link : h
>> ttp://code.google.com/p/web2py/source/list
>>  which was supposedly
>> referring to older versions, but it just refers to the github repository.
>>
>> I'm specifically interested in version 1.89.5.
>> Any ideas where can I get it?
>
> I found a web2py mercurial clone repository on my laptop with releases
> starting from 1.77.1 until 2.5.1.
>
> I did the following:
>
> $ hg checkout -r R-1.89.5
> $ hg archive /tmp/web2py-1.89.5.tar.gz
>
> I attached the resulting web2py-1.89.5.tar.gz (~5MB)
>

gmail didn't allow send the file.
I uploaded to google drive, you can download here:

https://drive.google.com/open?id=0B0DHm6u1f0KxWXIwVUdHWnc2aXc

Ricardo

-- 
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: Modification in version 2.14.6 not documented ?

2016-06-03 Thread Niphlod
is this on grid or smartgrid ?

On Friday, June 3, 2016 at 7:15:33 PM UTC+2, omicron wrote:
>
> I have just seen this modification for parameter 'exportclasses' in grids. 
> The manual say "If you pass a dict like 
> dict(xml=False, html=False)
>
> you will disable the xml and html export formats", but with the last 
> version you must change you code to pass a dict like this 
> dict(tablename = dict(xml=False, html=False))
>
>
> And it's the same for other dicts options like "maxtextlength" for example.
>
>
>

-- 
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: Is there a way to make scheduler tasks be picked by workers up even quicker?

2016-06-03 Thread Niphlod
an ajax request is just like a user hitting a page. 
They get queued until a thread from your web-workers is free (which is 
usually ALWAYS the case) and it gets executed right away.
It'll definitely be quicker than the IPC done by the scheduler if you want 
semi-realtime execution.  

On Friday, June 3, 2016 at 7:39:44 PM UTC+2, Mark Smith wrote:
>
> Thanks for the response :). I want to explain my situation a bit more if 
> that's alright with you Niphlod (I'm a newbie at web dev haha). You're 
> right, I think I can use a simple ajax request to do it instead, however I 
> think the task may run a bit slower/make the UI a bit unresponsive? From my 
> understanding every connection is handled by a single thread so it might be 
> the case where a 1-2 second task would take 3-4 seconds to run and in that 
> time the server wouldn't be able to handle any further tasks (like updating 
> other UI?). Not sure if the previous statements are true however. In my 
> case when the user clicks "submit" there's no other UI interaction until 
> the server returns back the results of the task so I don't think the UI 
> will be any slower (since it'll be an ajax request), but the task might 
> actually take longer for the server to run (though anything less than 6 
> seconds would be an improvement :) ).
>
> I'll try implementing it with just an ajax request (and no scheduler) and 
> get back with the results. Thanks again for the helpful response!
> On Friday, 3 June 2016 12:45:19 UTC-4, Niphlod wrote:
>>
>> long story short, no. 
>> You can get better "pick-up-times" (the time that elapses from when you 
>> queue the task to when it's started) with the redis version of the 
>> scheduler but in any case the worst possible scenario won't drop under 
>> "heartbeat" which is 3 seconds. 
>> Got it, would be wonderful if the scheduler was even snappier than it is 
>> but the current limitation just makes sense for small corner cases, 
>> which are:
>> - need to run the task on another server than the web-serving one
>> - need to run zillions of tasks in a hundred workers farm to offload 
>> something the webserver can't keep up
>>
>> That being said, there's another, which is "need to run tasks that go 
>> beyond the 60 seconds timeout which is enforced in most webservers"... but 
>> in that case waiting 6 seconds is not that much in comparison.
>>
>> The thing here is : 
>> a) you're using pythonanywhere, so you're out of "worker farms"
>> b) your tasks are super-duper-speedy (they complete well-below the usual 
>> timeout for webserver which is 60 seconds) 
>> c) you want sub-6 seconds "pick-up time" 
>>
>> why don't you just use a simple ajax request ?
>>
>>

-- 
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] web2py 1.89.5

2016-06-03 Thread Ricardo Pedroso
On 5/26/16, Roman Molotkovski  wrote:
>
> I've been looking for old versions of python and but I can't find anything
> older than 2.0.2 (on github).
> A previous thread in this group mentioned this link : h
> ttp://code.google.com/p/web2py/source/list
>  which was supposedly
> referring to older versions, but it just refers to the github repository.
>
> I'm specifically interested in version 1.89.5.
> Any ideas where can I get it?

I found a web2py mercurial clone repository on my laptop with releases
starting from 1.77.1 until 2.5.1.

I did the following:

$ hg checkout -r R-1.89.5
$ hg archive /tmp/web2py-1.89.5.tar.gz

I attached the resulting web2py-1.89.5.tar.gz (~5MB)

@Roman - see if it solves your problem

@all - Sorry it's a big email...

Ricardo

-- 
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: Is there a way to make scheduler tasks be picked by workers up even quicker?

2016-06-03 Thread Mark Smith
Thanks for the response :). I want to explain my situation a bit more if 
that's alright with you Niphlod (I'm a newbie at web dev haha). You're 
right, I think I can use a simple ajax request to do it instead, however I 
think the task may run a bit slower/make the UI a bit unresponsive? From my 
understanding every connection is handled by a single thread so it might be 
the case where a 1-2 second task would take 3-4 seconds to run and in that 
time the server wouldn't be able to handle any further tasks (like updating 
other UI?). Not sure if the previous statements are true however. In my 
case when the user clicks "submit" there's no other UI interaction until 
the server returns back the results of the task so I don't think the UI 
will be any slower (since it'll be an ajax request), but the task might 
actually take longer for the server to run (though anything less than 6 
seconds would be an improvement :) ).

I'll try implementing it with just an ajax request (and no scheduler) and 
get back with the results. Thanks again for the helpful response!
On Friday, 3 June 2016 12:45:19 UTC-4, Niphlod wrote:
>
> long story short, no. 
> You can get better "pick-up-times" (the time that elapses from when you 
> queue the task to when it's started) with the redis version of the 
> scheduler but in any case the worst possible scenario won't drop under 
> "heartbeat" which is 3 seconds. 
> Got it, would be wonderful if the scheduler was even snappier than it is 
> but the current limitation just makes sense for small corner cases, 
> which are:
> - need to run the task on another server than the web-serving one
> - need to run zillions of tasks in a hundred workers farm to offload 
> something the webserver can't keep up
>
> That being said, there's another, which is "need to run tasks that go 
> beyond the 60 seconds timeout which is enforced in most webservers"... but 
> in that case waiting 6 seconds is not that much in comparison.
>
> The thing here is : 
> a) you're using pythonanywhere, so you're out of "worker farms"
> b) your tasks are super-duper-speedy (they complete well-below the usual 
> timeout for webserver which is 60 seconds) 
> c) you want sub-6 seconds "pick-up time" 
>
> why don't you just use a simple ajax request ?
>
>

-- 
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: error starting scheduler: error retreiving status

2016-06-03 Thread Bart
Hi Niphlod,

Normally i just put a record in the scheduler_task table with appadmin. 
That works fine (no errors), but nothing happens because the scheduler 
worker is not running.

In db.py the database schema is set via db.executesql("set search_path to 
auth,scheduler, ... ;")

In case migrate is True, the search_path is set to scheduler, auth, ... 
just before the scheduler = Scheduler(db) statement.



Op vrijdag 3 juni 2016 18:35:07 UTC+2 schreef Niphlod:
>
> what happens when you try to queue a task from the app ? AFAIK I'd be 
> eager to know how can it work if there is no "public" schema, unless you 
> tinkered with scheduler's table definitions
>
> On Friday, June 3, 2016 at 4:57:23 PM UTC+2, Bart wrote:
>>
>> Addition:
>>
>> I am using several schema's in the postgres database.
>>
>> The scheduler tables are in schema 'scheduler'
>>
>> Schema 'public' does not exist.
>>
>> Can this cause the problem?
>>
>

-- 
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] Modification in version 2.14.6 not documented ?

2016-06-03 Thread omicron
I have just seen this modification for parameter 'exportclasses' in grids. 
The manual say "If you pass a dict like 
dict(xml=False, html=False)

you will disable the xml and html export formats", but with the last 
version you must change you code to pass a dict like this 
dict(tablename = dict(xml=False, html=False))


And it's the same for other dicts options like "maxtextlength" for example.


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

2016-06-03 Thread Richard Vézina
Damn it... It very old... I do have 1.88.2 and 1.91.something... But no
1.89.5

Sorry...

I can only think of Massimo's that could help you with that...

Richard

On Thu, Jun 2, 2016 at 4:04 PM, Roman Molotkovski 
wrote:

> Just checked the version file. It's says Version
> 2.14.6-stable+timestamp.2016.05.10.00.21.47. :(
>
>
> On Thursday, June 2, 2016 at 10:28:55 PM UTC+3, Frank Camp wrote:
>>
>> Using google I found this one.
>> http://www.imperiasoft.com/office-tools/pdf/web2py-1-89-5.html#
>>
>> Like everything downloaded from the internet, check before you use. You
>> never know what is inside an archive.
>>
>> Frank
>
> --
> 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: Is there a way to make scheduler tasks be picked by workers up even quicker?

2016-06-03 Thread Niphlod
long story short, no. 
You can get better "pick-up-times" (the time that elapses from when you 
queue the task to when it's started) with the redis version of the 
scheduler but in any case the worst possible scenario won't drop under 
"heartbeat" which is 3 seconds. 
Got it, would be wonderful if the scheduler was even snappier than it is 
but the current limitation just makes sense for small corner cases, 
which are:
- need to run the task on another server than the web-serving one
- need to run zillions of tasks in a hundred workers farm to offload 
something the webserver can't keep up

That being said, there's another, which is "need to run tasks that go 
beyond the 60 seconds timeout which is enforced in most webservers"... but 
in that case waiting 6 seconds is not that much in comparison.

The thing here is : 
a) you're using pythonanywhere, so you're out of "worker farms"
b) your tasks are super-duper-speedy (they complete well-below the usual 
timeout for webserver which is 60 seconds) 
c) you want sub-6 seconds "pick-up time" 

why don't you just use a simple ajax request ?

-- 
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: reading values from request.vars

2016-06-03 Thread ktesr123456
it is a single select, the values are populated from controller into a view 
dynamically in jquery

On Friday, June 3, 2016 at 6:32:34 AM UTC-6, Anthony wrote:
>
> Hard to say because it's not clear (a) what kind of data are in opt1, 
> opt2, etc. (are they multi-select widgets producing lists or just single 
> selects?) and (b) how the form inputs map to your database fields.
>
> Anthony
>
> On Thursday, June 2, 2016 at 11:55:13 PM UTC-4, ktesr...@gmail.com 
>  wrote:
>>
>> Anthony
>>
>> I wanted to iterate all the values from request.vars these values are 
>> passed using ajax function from View, in the View each row will have 3 drop 
>> downs and 1 textbox to take input from user
>> there can be minimum 1 row. I am passing all the control names thru ajax 
>> function
>>
>> View
>> ===
>> 
>> /* jquery that builds html form written here */
>>
>> ajax('{{=URL('insert_data')}}',['opt1','opt2','opt3','txtt1'],'target'); 
>> // opt1, opt2 and opt3 are dropdown control names and txt1 is the name if 
>> textbox control all are html controls dynamically crated using jquery
>>
>> 
>> 
>> 
>>
>> Controller
>> ==
>> def insert_timesheet():
>>  
>>  orglist = request.vars.getlist("opt1")
>>  response.flash = str(orgval)
>>
>>  ##db.Table.insert(field1=opt1[0],.)
>>  return locals()
>>
>>
>>
>> On Thursday, June 2, 2016 at 7:34:04 PM UTC-6, Anthony wrote:
>>
>>> Please show some code and explain exactly what you want to do. To get a 
>>> particular value from request.vars, just do request.vars.name_of_variable.
>>>
>>> Anthony
>>>
>>> On Thursday, June 2, 2016 at 8:07:13 PM UTC-4, ktesr...@gmail.com wrote:

 I am getting selected values from View to Controller using request.vars

 I can see the values are coming as key value pair but not able to 
 figure out how to read each value and insert them in DB




-- 
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: error starting scheduler: error retreiving status

2016-06-03 Thread Niphlod
what happens when you try to queue a task from the app ? AFAIK I'd be eager 
to know how can it work if there is no "public" schema, unless you tinkered 
with scheduler's table definitions

On Friday, June 3, 2016 at 4:57:23 PM UTC+2, Bart wrote:
>
> Addition:
>
> I am using several schema's in the postgres database.
>
> The scheduler tables are in schema 'scheduler'
>
> Schema 'public' does not exist.
>
> Can this cause the problem?
>

-- 
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 2.14.4 is OUT

2016-06-03 Thread PRACHI VAKHARIA






*Great! What are some of the major updates in 2.14.4 – that we users 
should note or be aware of?*

*On Tuesday, 12 April 2016 17:29:26 UTC-4, Massimo Di Pierro wrote:*

> *web2py 2.14.4 is out.*
>
> It fixes some a problem with CAS and some style issues with examples.
> It also includes (and passes) a lot of new tests. 
>
> Thanks to Richard Vezina, Simone and Leonel for doing most of the work in 
> this release.
>
> Massimo
>

-- 
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: error starting scheduler: error retreiving status

2016-06-03 Thread Bart
Addition:

I am using several schema's in the postgres database.

The scheduler tables are in schema 'scheduler'

Schema 'public' does not exist.

Can this cause the problem?

-- 
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] error starting scheduler: error retreiving status

2016-06-03 Thread Bart
I am trying to start web2py scheduler with 

python web2py.py -K myapp

on a Ubuntu 16.04 server with web2py 
2.14.6-stable+timestamp.2016.05.10.00.21.47
(running on nginx/1.10.0, Python 2.7.11+)
db connector is psycopg2

myapp is using a remote postgres database over ssl

In the app every is working fine, the database connection string is ok.

When starting the scheduler in debug mode, i get:

$ python web2py.py -K skarp -D 0

web2py Web Framework

Created by Massimo Di Pierro, Copyright 2007-2016

Version 2.14.6-stable+timestamp.2016.05.10.00.21.47

Database drivers available: sqlite3, psycopg2, pg8000, pymysql, imaplib

starting single-scheduler for "skarp"...

DEBUG:web2py.scheduler.web02#51073:defining tables (migrate=True)

DEBUG:web2py.scheduler.web02#51073:thread building own DAL object

DEBUG:web2py.scheduler.web02#51073:looping...

INFO:web2py.scheduler.web02#51073:nothing to do

DEBUG:web2py.scheduler.web02#51073:sleeping...

DEBUG:web2py.scheduler.web02#51073:defining tables (migrate=False)

ERROR:web2py.scheduler.web02#51073:Error retrieving status

DEBUG:web2py.scheduler.web02#51073:looping...

INFO:web2py.scheduler.web02#51073:nothing to do

DEBUG:web2py.scheduler.web02#51073:sleeping...

ERROR:web2py.scheduler.web02#51073:Error retrieving status

etc.etc.


setiing migrate to False or True makes no difference.

Has anyone a clue what is going wrong?

-- 
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: reading values from request.vars

2016-06-03 Thread Anthony
Hard to say because it's not clear (a) what kind of data are in opt1, opt2, 
etc. (are they multi-select widgets producing lists or just single 
selects?) and (b) how the form inputs map to your database fields.

Anthony

On Thursday, June 2, 2016 at 11:55:13 PM UTC-4, ktesr123...@gmail.com wrote:
>
> Anthony
>
> I wanted to iterate all the values from request.vars these values are 
> passed using ajax function from View, in the View each row will have 3 drop 
> downs and 1 textbox to take input from user
> there can be minimum 1 row. I am passing all the control names thru ajax 
> function
>
> View
> ===
> 
> /* jquery that builds html form written here */
>
> ajax('{{=URL('insert_data')}}',['opt1','opt2','opt3','txtt1'],'target'); 
> // opt1, opt2 and opt3 are dropdown control names and txt1 is the name if 
> textbox control all are html controls dynamically crated using jquery
>
> 
> 
> 
>
> Controller
> ==
> def insert_timesheet():
>  
>  orglist = request.vars.getlist("opt1")
>  response.flash = str(orgval)
>
>  ##db.Table.insert(field1=opt1[0],.)
>  return locals()
>
>
>
> On Thursday, June 2, 2016 at 7:34:04 PM UTC-6, Anthony wrote:
>
>> Please show some code and explain exactly what you want to do. To get a 
>> particular value from request.vars, just do request.vars.name_of_variable.
>>
>> Anthony
>>
>> On Thursday, June 2, 2016 at 8:07:13 PM UTC-4, ktesr...@gmail.com wrote:
>>>
>>> I am getting selected values from View to Controller using request.vars
>>>
>>> I can see the values are coming as key value pair but not able to figure 
>>> out how to read each value and insert them in DB
>>>
>>>
>>>

-- 
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: references in sqlite3

2016-06-03 Thread botasservice
I solved this by re-defining tables.

пятница, 3 июня 2016 г., 13:27:29 UTC+3 пользователь botass...@gmail.com 
написал:
>
> Hello.
>
> I have 3 tables, one of them default auth_user table, and other two are:
> db.define_table('table_A',
> Field('account_user', 'reference auth_user', readable=
> False),
> Field('username', 
> requires=IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> Field('password', requires=
> IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> Field('t_server', requires=
> IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> format='%(username)s_%(t_server)s'
> )
> db.define_table('table_B',
> Field('account_username', 'reference table_A'),
> Field('some_field', requires=
> IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> format='%(some_field)s'
> )
> when insertion in second table is alright, but i try to insert into third 
> table, i'm getting - no such column: table_A.id.
> code of insertion:
> db.table_B.insert(
> account_username=db.table_A.id,
> some_field='some_text'
> )
>
> in sql log there is generated 'id' field which is primary key, and my 
> field 'account_username' is created with reference to table_A (id)
>
> What I'm doing wrong?
>

-- 
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: references in sqlite3

2016-06-03 Thread Mirek Zvolský
I don't understand where is the problem? Can you describe it again or 
better?

Web2py adds id field into all tables as primary key,
field of type 'reference tablename' or db.tablename became foreign keys.
This is standard behaviour.

If you want/need to modify this behaviour, you should read about 'legacy 
tables' in chapter 6 of webpy.com/book.




Dne pátek 3. června 2016 12:27:29 UTC+2 botass...@gmail.com napsal(a):
>
> Hello.
>
> I have 3 tables, one of them default auth_user table, and other two are:
> db.define_table('table_A',
> Field('account_user', 'reference auth_user', readable=
> False),
> Field('username', 
> requires=IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> Field('password', requires=
> IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> Field('t_server', requires=
> IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> format='%(username)s_%(t_server)s'
> )
> db.define_table('table_B',
> Field('account_username', 'reference table_A'),
> Field('some_field', requires=
> IS_NOT_EMPTY(error_message=auth.message.is_empty)),
> format='%(some_field)s'
> )
> when insertion in second table is alright, but i try to insert into third 
> table, i'm getting - no such column: table_A.id.
> code of insertion:
> db.table_B.insert(
> account_username=db.table_A.id,
> some_field='some_text'
> )
>
> in sql log there is generated 'id' field which is primary key, and my 
> field 'account_username' is created with reference to table_A (id)
>
> What I'm doing wrong?
>

-- 
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] references in sqlite3

2016-06-03 Thread botasservice
Hello.

I have 3 tables, one of them default auth_user table, and other two are:
db.define_table('table_A',
Field('account_user', 'reference auth_user', readable=False
),
Field('username', 
requires=IS_NOT_EMPTY(error_message=auth.message.is_empty)),
Field('password', requires=
IS_NOT_EMPTY(error_message=auth.message.is_empty)),
Field('t_server', requires=
IS_NOT_EMPTY(error_message=auth.message.is_empty)),
format='%(username)s_%(t_server)s'
)
db.define_table('table_B',
Field('account_username', 'reference table_A'),
Field('some_field', requires=
IS_NOT_EMPTY(error_message=auth.message.is_empty)),
format='%(some_field)s'
)
when insertion in second table is alright, but i try to insert into third 
table, i'm getting - no such column: table_A.id.
code of insertion:
db.table_B.insert(
account_username=db.table_A.id,
some_field='some_text'
)

in sql log there is generated 'id' field which is primary key, and my field 
'account_username' is created with reference to table_A (id)

What I'm doing wrong?

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