[web2py] Adding cancel button - form submission

2012-07-17 Thread Mathias
se: response.flash = 'Create new guest' return dict(form=form) If I click the cancel button now, nothing happens anymore. Any help is welcome. Thanks Mathias --

[web2py] after login redirect

2012-07-21 Thread Mathias
s piece of code. I am looking for a solution whereby anyone, with role 'Straathoekwerkers', will be redirected to this URL. How can I do this ? If I don't pass a user id, it doesn't work. Thanks Mathias --

[web2py] Lifetime of a controller object and db object.

2012-08-02 Thread Mathias
qlite') >> db.py is read every time again, so I guess "db" object is instanciated every time db.py is read ? Thanks for the info. Mathias --

[web2py] Retreive value (option) from a select list

2012-08-08 Thread Mathias
Hello, How can I retreive the selected value (option), from an HTML select ? I want to use this in an ajax function, but I don't know how to get the value. Thanks Mathias --

[web2py] Ajax cascading selects/drop down lists - passing javascript variabeles

2012-08-15 Thread Mathias
/default/ajax ? Any help would be gratefully appreciated ! Thanks Mathias --

[web2py] Catch rows in Javascript

2012-08-17 Thread Mathias
Hi, How can I catch rows in Javascript code ? Thanks Mathias --

[web2py] query referenced table in grid/smartgrid

2012-05-06 Thread Mathias
Is there an easy way to query a referenced table in a grid/smartgrid ? Is the only way, to achieve this goal, writing a search_widget ? Does anyone already has written some code to achieve this goal ? Thanks Mathias

Re: [web2py] Adding cancel button - form submission

2012-07-17 Thread Mathias Van Daele
Thanks for your solution Richard ! I am still looking for a solution with a button component... Mathias 2012/7/17 Richard Vézina : > Maybe this could be enough?? > > {{=A(T('cancel'),_href="javascript:void(history.go(-1))")}} > > It will bring you back to th

Re: [web2py] Adding cancel button - form submission

2012-07-17 Thread Mathias Van Daele
I found a good solution for me : form[0][-1][1].append(TAG.INPUT(_value='Cancel',_type="button",_onclick="window.location='%s';"%URL(r=request,f='new_contact'))) Mathias 2012/7/17 Mathias Van Daele : > Thanks for your solution Richard

Re: [web2py] Re: after login redirect

2012-07-21 Thread Mathias Van Daele
elif auth.has_membership(user_id=auth.user.id,role='Managers'): redirect(URL(r=request,c='management',f='user')) else:redirect(URL(r=request,c='management',f='value')) auth.settings.login_onaccept.append(redirect_after

Re: [web2py] Lifetime of a controller object and db object.

2012-08-02 Thread Mathias Van Daele
Hello, For each HTTP request, the model (db.py) is read, and the controller executed. So, for each HTTP request, first the model is read (db.py) , and then the controller executed (instanciated ?) ? Thanks Mathias 2012/8/2 Mathias : > Hello, > > I am trying to make a UML sequenc

Re: [web2py] Lifetime of a controller object and db object.

2012-08-02 Thread Mathias Van Daele
If I call a certain controller function, where does this request come from ? (Main, Model,...) ? Thanks Mathias 2012/8/2 Mathias Van Daele : > Hello, > > For each HTTP request, the model (db.py) is read, and the controller executed. > > So, for each HTTP request, first the model

Re: [web2py] Lifetime of a controller object and db object.

2012-08-02 Thread Mathias Van Daele
OK, I found the answer to my questions : All is done by Main module : serve_controller(request, response, session) source code this function is used to generate a dynamic page. It first runs all models, then runs the function in the controller, and then tries to render the output using a view/te

Re: [web2py] Retreive value (option) from a select list

2012-08-08 Thread Mathias Van Daele
Thanks for your reply Richard ! I was hoping I could find a solution without extra Jquery, but I will try it with Jquery . Mathias 2012/8/8 Richard Vézina : > With .val() > http://api.jquery.com/val/ > > With :selected > http://api.jquery.com/selected-selector/ > > This co

Re: [web2py] Retreive value (option) from a select list

2012-08-08 Thread Mathias Van Daele
Thanks !! 2012/8/8 Richard Vézina : > It's just a matter of selecting the proper html select and get the selected > value. > > Richard > > On Wed, Aug 8, 2012 at 1:33 PM, Mathias Van Daele > wrote: >> >> Thanks for your reply Richard ! >> >>

Re: [web2py] Ajax cascading selects/drop down lists - passing javascript variabeles

2012-08-15 Thread Mathias Van Daele
... This seems to be more complex then I was expecting... Can someone give me some advice on this issue ? Thanks Mathias 2012/8/15 Mathias : > {{extend 'layout.html'}} > > option 1 > option 2 > > > > ... > > >

Re: [web2py] Ajax cascading selects/drop down lists - passing javascript variabeles

2012-08-15 Thread Mathias Van Daele
Thanks for your reply Derek ! This could be interesting for me. I will try to implement it like that. Mathias 2012/8/16 Derek : > Couldn't you precalculate and put them in your javascript in the page > itself? > > > > var nissancars = {{=XML(nissancars)}} > var toyo

Re: [web2py] Re: Catch rows in Javascript

2012-08-19 Thread Mathias Van Daele
;reaction_value"); select.options.length = 0; // clear out existing items for(var i=0; i < locations.length; i++) { var d = locations[i]; select.options.add(new Option(d.val,d.id)); } }); Best regards, Mathias 2012

[web2py] Internationalization for DB table field names and DB table content

2011-12-26 Thread Mathias Van Daele
n 2 : Suppose table "size" contains some values like "big","small"... I am looking for a function to get these values translated too. Thanks in advance Mathias

Re: [web2py] Re: Internationalization for DB table field names and DB table content

2011-12-26 Thread Mathias Van Daele
Hey Anthony, thanks for your answer ! Your solution for question 1 working fine ! (with label) For questions 2 I am still trying... Mathias Op 26 december 2011 19:06 schreef Anthony het volgende: > Concerning question 1 : How can I translate >> "name_father","name

Re: [web2py] Re: Internationalization for DB table field names and DB table content

2011-12-26 Thread Mathias Van Daele
it > > content = T(row.contentfield) > > and it will appear at translation files to translate. > > Since u apply it just to a few fields/rows/tables, it can work fine. > > But for large contents, you will need a tool/api to automate translation, > and use a function to call it

[web2py] Represent - redirect

2012-01-15 Thread Mathias Van Daele
My code : table=db.contact_part db.contact_part.id.represent = lambda id, row: A('edit',_href=URL()) query = (db.contact_part.contact==session.contactID) form3 = crud.select(table,query,fields=['contact_part.subject','contact_part.tags','contact_part.id']) Thanks Mathias

Re: [web2py] Represent - redirect

2012-01-16 Thread Mathias Van Daele
Thanks for answer Johann. But how can I catch the value of args in the concerned function ? Thanks Op 16 januari 2012 13:15 schreef Johann Spies het volgende: > On 15 January 2012 22:49, Mathias Van Daele wrote: > >> Hello, >> >> I have a select crud, with a URL in t

Re: [web2py] Represent - redirect

2012-01-17 Thread Mathias Van Daele
Thanks !! Op 17 januari 2012 00:44 schreef Anthony het volgende: > On Monday, January 16, 2012 4:47:01 PM UTC-5, Mathias Van Daele wrote: >> >> Thanks for answer Johann. >> >> But how can I catch the value of args in the concerned function ? >> > > args