[web2py] Re: markdown in views.

2014-06-27 Thread Massimo Di Pierro
very strange. it is there. Can you try this (which works for me): $ python web2py.py -S welcome ... >>> from gluon.contrib.markdown.markdown2 import markdown On Saturday, 28 June 2014 00:31:56 UTC-5, Arnold bin Laden wrote: > > Please I will like to display a sting in my view using the markdown

[web2py] Re: sqlform doesn't update a database

2014-06-27 Thread Massimo Di Pierro
You cannot call both process() and accepts. You do not need to call insert. it is automatic for SQLFORMS. you want this: form = SQLFORM(test.new_form).process() if form.accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' Th

[web2py] markdown in views.

2014-06-27 Thread Arnold bin Laden
Please I will like to display a sting in my view using the markdown syntax. I have the following code {{from gluon.contrib.markdown.markdown2 import markdown}} {{=markdown(file.description)}} But I get an error saying No module named markdown2 Thanks in advnce -- R

[web2py] variable column widths - per column, in custom forms

2014-06-27 Thread Martin Bothma
Hello all I've dome a lot of searching and trying to no avail. I have used the welcome template - hence layout settings follow. Custom forms works fine. Currently 3 rows, with 3 columns. Each column: 1st is label, second in a variable (IS_IN_SET works fine) related to than label, 3rd is another va

[web2py] sqlform doesn't update a database

2014-06-27 Thread Maria Levchenko
Could you please help me? I have a table in database (new_form) and a form for it with selector. After submit an answer database doesn't change. What am i doing wrong? in database: test.define_table('new_form', Field('omonim', 'list:string')) In controller: form = SQLFORM(te

Re: [web2py] Create a database table on submission of a form

2014-06-27 Thread Massimo Di Pierro
Cool. I did not know about it. On Friday, 27 June 2014 16:32:19 UTC-5, Manuele wrote: > > Il 27/06/14 11:25, Shubham Jain ha scritto: > > I want to create a database table every time a form is submitted. The > > table name would be a data from a the field of form submitted. > > I tried to creat

[web2py] Re: Radio widget not working as a Boolean

2014-06-27 Thread Carlos Zenteno
OK, my IS_IN_SET should be: IS_IN_SET([(True, T('Yes')),(False, T('No'))]) and now the selection shows in the form. Still: - it does not enforce default=False - no matter if I choose Yes or No (True or False), it puts True in db Having a feeling that this does not work with boolean ( a shame) I

[web2py] Need help to achieve url rewrite

2014-06-27 Thread Lisandro
I have an application called init, the app has a controller called default.py and inside it I have three functions: 1) /init/default/index --> The home of the website. 2) /init/default/contact --> The contact page. 3) /init/default/store This function receives an argument: the slug of the n

[web2py] Radio widget not working as a Boolean

2014-06-27 Thread Carlos Zenteno
I have the following code in my model augmenting auth_user. auth.settings.extra_fields['auth_user'] = [ Field('is_club_member', 'boolean' , default=False, writable=True, readable=True, label=T('Are you a Club Member?'), requires=[IS_IN_SET([T('Yes'),T('N

Re: [web2py] Create a database table on submission of a form

2014-06-27 Thread Manuele Pesenti
Il 27/06/14 11:25, Shubham Jain ha scritto: > I want to create a database table every time a form is submitted. The > table name would be a data from a the field of form submitted. > I tried to create the table by writing the db.define_table() code > in the function in which the form is created

[web2py] Re: Create a database table on submission of a form

2014-06-27 Thread Massimo Di Pierro
The problem is not so much creating them but keeping track of them. Here is a possible solution: # a table of tables db.define_table('meta_table',Field('name'),Field('fields','json')) # for each table in meta_table define or create the table: for table db(db.meta_table).select(): db.define_t

[web2py] Re: SQLFORM cannot save to database

2014-06-27 Thread Massimo Di Pierro
Just simpler. I always use: form.process() On Friday, 27 June 2014 04:52:03 UTC-5, 黄祥 wrote: > > On Friday, June 27, 2014 1:04:13 PM UTC+7, Massimo Di Pierro wrote: >> >> this: >> >>FORM.accepts(form, request.vars): >> >> should be >> >>SQLFORM.accepts(form,request.post_vars, session) >>

[web2py] Re: list:strings not working as described or am I missing something?

2014-06-27 Thread Cliff Kachinske
Anthony, Thanks for the shove in the right direction. An ajax callback processes that field and I had forgotten to run it through the validator. So the db was inserting the entire string instead of list members. On Friday, June 27, 2014 1:07:33 PM UTC-4, Anthony wrote: > > Hard to say without

[web2py] Re: web2py flash using bootstrap3 alerts and flash status is way to bothersome to implement

2014-06-27 Thread Niphlod
unfortunately, the main point is that web2py doesn't provide "out-of-the-box" something that clarifies what a "flash status" is . passing a status as a new header uses the same "tech" web2py provides for other things, but since it's not in the core code, your shortcomings are exactly what is ne

[web2py] Re: list:strings not working as described or am I missing something?

2014-06-27 Thread Anthony
Hard to say without seeing any code, but clearly the database insert is not getting a list. On Friday, June 27, 2014 12:12:00 PM UTC-4, Cliff Kachinske wrote: > > >

[web2py] Beautiful explanation of Blocks in views!

2014-06-27 Thread JoeCodeswell
Dear web2py-users, Kudos to the person that wrote the book section "Blocks in views". The use of an illustrative, simple example, oriented toward the web developer was easy to understand and customize in a short amount of time. Thanks very much. Love and peace, Joe -- Resources: - http://we

[web2py] list:strings not working as described or am I missing something?

2014-06-27 Thread Cliff Kachinske
Web2py 2.8.2, if that matters. The manual at web2py.com says, "On relational databases they [list:string fields] are mapped into text fields which contain the

[web2py] Re: Create a database table on submission of a form

2014-06-27 Thread Leonel Câmara
Why would you want to do this? -- 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] Re: "NOT IN" in web2py DAL

2014-06-27 Thread Fernando Vieira
Solution ramal_virtual = db(db.f_ramal_virtual)._select(db.f_ramal_virtual.ramal_fisico) db(~db.fisico_sip_iax.usuario.belongs(ramal_virtual)).select(orderby=db.fisico_sip_iax.usuario) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] web2py flash using bootstrap3 alerts and flash status is way to bothersome to implement

2014-06-27 Thread Leonel Câmara
Hey, I wanted to change web2py response.flash to use bootstrap3 alerts. I started by creating an alert-default in my css since bootstrap3 doesn't have one and I wanted it, then I placed this in my layout.html {{if response.flash:}} {{=response.flash}} ×Close

[web2py] Re: Hypermedia API and Collection+JSON in web2py

2014-06-27 Thread Falko Webpgr
So I created a REST API doc plugin for web2py quite a while ago. Here is what it looks like on the user side http://semanticsbml.org/semanticSBML/plugin_restapidoc/index# http://rumo.biologie.hu-berlin.de/pyMantis/plugin_restapidoc/index I also posted the plugin for this on here, a while ago. One

[web2py] "NOT IN" in web2py DAL

2014-06-27 Thread Fernando Vieira
Hi, how to use "NOT IN" in web2py DAL example: select usuario from fisico_sip_iax where tecnologia = 'SIP' and usuario NOT IN(select ramal_fisico from f_ramal_virtual); thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Create a database table on submission of a form

2014-06-27 Thread Shubham Jain
I want to create a database table every time a form is submitted. The table name would be a data from a the field of form submitted. I tried to create the table by writing the db.define_table() code in the function in which the form is created (by SQLFORM), under the condition if form.proces

[web2py] Re: SQLFORM.grid woes

2014-06-27 Thread hvjunk
On Thursday, June 26, 2014 12:16:01 PM UTC+2, hvjunk wrote: > > > This morning somethings broke... and yes, it *was* me, but I don't know > where/what ;( (had too many customers telling me "I/we didn't do do > nothing" and then I showed them what and then they remember something > totally dif

[web2py] Re: SQLFORM cannot save to database

2014-06-27 Thread 黄祥
On Friday, June 27, 2014 1:04:13 PM UTC+7, Massimo Di Pierro wrote: > > this: > >FORM.accepts(form, request.vars): > > should be > >SQLFORM.accepts(form,request.post_vars, session) > > or better > >form.accepts(request.post_vars, session) > > or eve better > >form.process() > @mass

[web2py] Re: web2py scheduler period and repeats result not expected

2014-06-27 Thread 黄祥
a, i understood, the puzzle completed now. thank you so much, simone, for detail explaination about web2py scheduler. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

[web2py] Re: Error : unable to open database file

2014-06-27 Thread Massimo Di Pierro
Do you have a background process? Do you have multiple web2py's running in the same instance? sqlite is not client server and each instance locks the database. If the database is locked for too long and another process/thread/request tries to access, it may timeout. On Thursday, 26 June 2014 16

[web2py] Re: Database query using exclude or "Does not contain"

2014-06-27 Thread Massimo Di Pierro
~cd.value.contains(filter_value_inc, all=False) ~ = NOT On Thursday, 26 June 2014 09:52:02 UTC-5, Douglas Campbell wrote: > > Hello, > > I am trying to filter out specific values in an SQLFORM.grid but I can not > figure out how to do this in the Query. Right now I have something like: > >