[web2py] Re: scheduler help

2013-09-24 Thread Antonis Konstantinos Tzorvas
updateMap instead of updateMaps in queue_task... maybe I need to go to bed.. :P thanks a lot and sorry for the inconvenience On Wednesday, September 25, 2013 2:59:02 AM UTC+3, Antonis Konstantinos Tzorvas wrote: > > ok, it was some missing imports, so now i can run my function fr

[web2py] Re: scheduler help

2013-09-24 Thread Antonis Konstantinos Tzorvas
ok, it was some missing imports, so now i can run my function from the appadmin, but trying to run it with scheduler.queue_task and nothing happens scheduler = Scheduler(db, dict(updateCharts=updateCharts, updateMaps=updateMap)) #in models/scheduler.py scheduler.queue_task(updateMap) #inside a

[web2py] scheduler help

2013-09-22 Thread Antonis Konstantinos Tzorvas
tried to schedule a task that takes a about 1-2 minutes, but it's always failing in about 20 seconds.. its a module that i am calling from inside a function, which function is "available" to scheduler. i am creating the task, with appadmin, and from "run output" i can see that it hangs somewher

[web2py] Re: primarykey vs is_not_in_db

2013-08-19 Thread Antonis Konstantinos Tzorvas
http://ondras.zarovi.cz/sql/demo/ (load from server: name "myfirstproject2") On Monday, August 19, 2013 4:58:06 AM UTC+3, Massimo Di Pierro wrote: > > Please open a ticket about this. > > On Sunday, 18 August 2013 15:11:45 UTC-5, Antonis Konstantinos Tzorvas > wrote: >> >&g

[web2py] primarykey vs is_not_in_db

2013-08-18 Thread Antonis Konstantinos Tzorvas
http://paste.kde.org/p6938ac83/55437137/ trying to use primarykey=['station_id', 'source'] in db.stations_sources i was always getting the 'no _id error' when trying to apply a "proper" db.data.source.requires=IS_IN_DB(db, 'stations_soruces.station_id', 'stations_sources.source') is there any

[web2py] online book : jQuery.attr to jQuery.prop

2013-08-08 Thread Antonis Konstantinos Tzorvas
v5 - p. 504 - if(jQuery('#taxpayer_married').attr('checked')) attr is not being used anymore and this has to change in: + if(jQuery('#taxpayer_married').prop('checked')) in other way it worked with attr adding this line inside the if scope (4fun) jQuery(this).attr('checked', !jQuery(this).attr('

[web2py] Re: onbeforeunload & SQLFORM(db.table) submit

2013-08-06 Thread Antonis Konstantinos Tzorvas
n-clicking-submit-button > > > On Tuesday, August 6, 2013 8:54:15 PM UTC+2, Antonis Konstantinos Tzorvas > wrote: >> >> def add(): >> form = SQLFORM.factory(Field('url', 'string')) >> >> if form.process().accepted: >>

[web2py] onbeforeunload & SQLFORM(db.table) submit

2013-08-06 Thread Antonis Konstantinos Tzorvas
def add(): form = SQLFORM.factory(Field('url', 'string')) if form.process().accepted: mystation = info.station(form.vars.url) session.tmpstation = mystation redirect(URL('confirm')) return dict(form=form) def confirm(): ... prepopulating form with vars fro

Re: [web2py] is_in_db with union select

2013-08-01 Thread Antonis Konstantinos Tzorvas
y hope that this gets cached somewhere in your app, because if > instead they are in models, you're doing 2 selects for every request > > On Thursday, August 1, 2013 2:21:07 PM UTC+2, Antonis Konstantinos Tzorvas > wrote: >> >> yes you are right, i was looking als

Re: [web2py] is_in_db with union select

2013-08-01 Thread Antonis Konstantinos Tzorvas
Thu, Aug 1, 2013 at 8:33 AM, Antonis Konstantinos Tzorvas > > wrote: > >> --- https://groups.google.com/d/msg/web2py/o3GebSeC7j4/Sct76ynB3fsJ > >> > >> db=DAL()db.define_table('a',Field('name')) > >> db.define_table('b'

[web2py] is_in_db with union select

2013-08-01 Thread Antonis Konstantinos Tzorvas
> > --- https://groups.google.com/d/msg/web2py/o3GebSeC7j4/Sct76ynB3fsJ > db=DAL()db.define_table('a',Field('name')) > db.define_table('b',Field('name')) > db.a.insert(name='Alex') > db.a.insert(name='Max') > db.a.insert(name='Tim') > db.b.insert(name='John') > db.b.insert(name='Jack') > def

[web2py] Re: list of dicts in request.args, dicts treated as strings

2013-07-31 Thread Antonis Konstantinos Tzorvas
t from the function instead (or something like that) comments/suggestions much appreciated! On Wednesday, July 31, 2013 1:01:23 PM UTC+3, Antonis Konstantinos Tzorvas wrote: > > I have created a function which returns from a given url some info parsed > from the file in the url > &

[web2py] list of dicts in request.args, dicts treated as strings

2013-07-31 Thread Antonis Konstantinos Tzorvas
I have created a function which returns from a given url some info parsed from the file in the url http://url/file.txt and it returns something like this parser.py output: _name: Test1 _data: [{"year": 2013, "jan": 50, "feb": 60}, {"year": 2012, "jan": 40, "feb": 30}] def add(): .. item =

[web2py] crud.create, field.writable=False custom alert on myValidation

2013-07-25 Thread Antonis Konstantinos Tzorvas
hi, i'm having this model: table('stations', Field('name')) db.stations.name.requires = IS_NOT_IN_DB(db, 'stations.name') and i am creating a crud.create with this: if request.vars: db.stations.name.default = request.get_vars['_name'] db.stations.name.writable = False form = crud.creat

[web2py] sqlform.factory multiple requires problem

2013-07-24 Thread Antonis Konstantinos Tzorvas
form = SQLFORM.factory(Field('station', requires=IS_IN_DB(db, 'station.name'), default=request.args(0)), Field('start', requires=[IS_NOT_EMPTY(), IS_IN_DB(db, 'data.year')], default=start), Field('end', requires=IS_NOT_EMPTY(), default=end))

[web2py] predefined auth groups auth.add_group

2013-07-23 Thread Antonis Konstantinos Tzorvas
so, first of all i kept auth.settings.create_user_groups = True as suggested, and from the manual there is auth.add_group('role', 'description') this should be in a model.py file or in a module such as first_init.py which will initialize the whole application with predefined groups/etc? adding

[web2py] Re: dynamic url/functions in controller

2013-07-22 Thread Antonis Konstantinos Tzorvas
', '/app/nodes/edit/$node'], > ['/app/nodes/$name/graph', '/app/nodes/graph/$node'], > ] > routes_out = [(y,x) for (x,y) in routes_in] > > > On Monday, 22 July 2013 13:37:57 UTC-5, Antonis Konstantinos Tzorvas wrote: >> >> is there any way t

[web2py] dynamic url/functions in controller

2013-07-22 Thread Antonis Konstantinos Tzorvas
is there any way to get dynamic urls? for example i have ip.com/app/nodes/list (smartgrid) ip.com/app/nodes/edit/[db.node.name] ip.com/app/nodes/show/[db.node.name] (details about each node) ip.com/app/nodes/graph/[db.node.name] and i am thinking on changing the url-scheme into something like th