[web2py] second page to be accessed only from first page

2014-11-15 Thread T.R.Rajkumar
In book chapter 3 overview the following is given to restrict access to second page. if not request.function=='first' and not session.visitor_name: redirect(URL('first')) But if I print request.function it says 'second'. How to restrict access to second page only from first page? -- Reso

[web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Gael Princivalle
Hello all. Do we have some news about the web2py Bootstrap 3 support ? I would like to purchase this template: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469 But like a lot f fantastic templates they support only Bootstrap 3, and I'm scared about problems that c

[web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Leonel Câmara
Gael I'm using bootstrap 3 in several projects without any problem. The support for bootstrap 3 isn't stable (it might change) but it's really good enough already. The only concern with it is for SQLFORMs anyway and they already have the bootstrap3_stacked and bootstrap3_inline formstyles. I wo

[web2py] Re: Convert MongoDB / dict into a DAL Row

2014-11-15 Thread Alan Etkin
> > Row.__str__ is called which in turn calls Row.as_dict, well Row.as_dict > does not know how to serialize ObjectId so it just ignores it. > I don't recall exactly (perhaps I should check the source), but I think the mongodb adapter doesn't support dealing with pure objectid objects for data

Re: [web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Gael Princivalle
Thanks Leonel. I'm still using web2py 2.8.2. Do you think I must update to 2.9.11 version for a better Bootstrap support ? -- Gael Princivalle 2014-11-15 13:33 GMT+01:00 Leonel Câmara : > Gael I'm using bootstrap 3 in several projects without any problem. The > support for bo

Re: [web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Gael Princivalle
If I use SQLFORMs with form.custom do I will avoid Bootstrap problems ? -- Gael Princivalle 2014-11-15 14:12 GMT+01:00 Gael Princivalle : > Thanks Leonel. I'm still using web2py 2.8.2. Do you think I must update to > 2.9.11 version for a better Bootstrap support ? > > ---

[web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Leonel Câmara
Yes you should update as the way bootstrap3 is supported changed. Custom forms do avoid some problems but they are generally not needed. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/i

[web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Anthony
As already mentioned in this thread, you can use web2py with any CSS framework without modifying any web2py internal code. web2py includes some built-in formstyles and grid UI styles for Bootstrap 2 and Bootstrap 3, but you can create your own formstyles and grid UI styles without any internal

[web2py] Simple query with variable table

2014-11-15 Thread Gael Princivalle
Hello all. I would like to make a query with a table name that will come from request.vars. Something like that: query = db.request.vars['table_name'] or like that: db_and_table = 'db.'+ request.vars['table_name'] query = db_and_table Is there a solution ? Thank's ! -- Resources: - http://we

[web2py] Re: Simple query with variable table

2014-11-15 Thread Leonel Câmara
Yeah, here's an example: if request.vars.table_name in db.tables: db(db[request.vars.table_name].id > 0).select() -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

Re: [web2py] Re: Bootstrap is really killing web2py

2014-11-15 Thread Gael Princivalle
Ok thank's a lot. -- Gael Princivalle 2014-11-15 16:46 GMT+01:00 Anthony : > As already mentioned in this thread, you can use web2py with any CSS > framework without modifying any web2py internal code. web2py includes some > built-in formstyles and grid UI styles for Bootstra

Re: [web2py] Re: Simple query with variable table

2014-11-15 Thread Gael Princivalle
Ok but for a query to give to a grid ? This: query = db[request.vars.table_name].id > 0 don't work. -- Gael Princivalle 2014-11-15 16:59 GMT+01:00 Leonel Câmara : > Yeah, here's an example: > > if request.vars.table_name in db.tables: > db(db[request.vars.table_name].id

[web2py] Re: Simple query with variable table

2014-11-15 Thread Leonel Câmara
Well it should work, in fact just passing db[request.vars.table_name] to the grid should work, have you checked what's in request.vars.table_name? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com

Re: [web2py] Re: Simple query with variable table

2014-11-15 Thread Gael Princivalle
Yes with db[request.vars.table_name] directly in the grid it works, thanks a lot. -- Gael Princivalle 2014-11-15 17:35 GMT+01:00 Leonel Câmara : > Well it should work, in fact just passing db[request.vars.table_name] to > the grid should work, have you checked what's in requ

[web2py] What is syntax for child controller remembering what records parent controller was looking at?

2014-11-15 Thread Alex Glaros
When users are accessing a table, grandfather controller passes args to parent controller. Parent controller then passes args to child controller so user can edit child table records. Now after editing child record, user wants to return from child record to parent record and parent controlle

[web2py] Re: What is syntax for child controller remembering what records parent controller was looking at?

2014-11-15 Thread Alex Glaros
okay...this worked. Would appreciate any improvement tips def edit_object_comment(): db.SuperObjectComment.superObjectID.readable = True db.SuperObjectComment.superObjectID.writable = False comment_id = request.args(0) or redirect(URL('view_suggestions')) specificObjectRecord = d