[web2py] I don't want 'Login Successful' or 'Success' popping up on the screen in my app.

2013-12-30 Thread Keith Planer
How do I keep session.flash and response.flash from doing their things when I don't want to? Specifically I don't want the messages popping up after a user logs in or when they make a new entry to the DB. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: REF: Problem with Dates from db query

2013-12-30 Thread Niphlod
you can't mix python formatting directly in the select fetch the values first and transform them later using strptime and strftime. BTW: if startdate is a 'datetime' field you just need to strftime it later. On Monday, December 30, 2013 6:04:39 AM UTC+1, software.ted wrote: I have a

[web2py] Re: gevent and admin app

2013-12-30 Thread Niphlod
as you do with the normal one. either you use ssh forwarding or you enable ssl On Sunday, December 29, 2013 10:02:52 PM UTC+1, Arnon Marcus wrote: How can I access the admin app in remote (non localhost) server, when hosting via gevent? -- Resources: - http://web2py.com -

Re: [web2py] Re: links in texts stoded in a database

2013-12-30 Thread Jonas Fredriksson
the XML function solved the problem: {{for i, row in enumerate(rows):}} {{=DIV(XML(T(row.table_field), sanitize = True) ) }} {{pass}} thanks. On Mon, Dec 30, 2013 at 3:29 AM, 黄祥 steve.van.chris...@gmail.com wrote: another way around is define it on the represent for your table text field.

[web2py] Calendar widget in a custom form?

2013-12-30 Thread Keith Planer
After adding some input validation I've realized that the calendar widget is not popping up. Is there anything I need to add to the controller or elsewhere? form=FORM(TABLE(...TR(Admission Date: ,INPUT(_name='adm_date',widget= SQLFORM.widgets.date.widget,requires=IS_DATE()))... -- Resources:

[web2py] Re: How to upload a file without using SQLFORM ??

2013-12-30 Thread Rogere Questre
In my Case it says 'str' object has no attribute 'filename' -- 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

[web2py] Re: Calendar widget in a custom form?

2013-12-30 Thread Alan Etkin
After adding some input validation I've realized that the calendar widget is not popping up. Is there anything I need to add to the controller or elsewhere? I suspect there's no widget option for the INPUT objects, unless it was added and was not updated in examples:

[web2py] Re: I don't want 'Login Successful' or 'Success' popping up on the screen in my app.

2013-12-30 Thread Alan Etkin
How do I keep session.flash and response.flash from doing their things when I don't want to? Specifically I don't want the messages popping up after a user logs in or when they make a new entry to the DB. For processing forms, you can disable the message_something option in .process()

[web2py] Re: unpickling stack underflow

2013-12-30 Thread Alan Etkin
HELP PLEASE! Could you post the relevant part of code that throws the error? What version of web2py are you running? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Firefox 26.0 and redirect after login

2013-12-30 Thread Alan Etkin
I tested these functions in Safari, in Safari everything works as before. Does anyone have an idea what changed in Firefox and how to solve this issue? Does it actually redirect (does it open the new location)? You can check the response output with the firefox console (Ctrl+Shift+K) --

[web2py] MongoDb

2013-12-30 Thread Tushar Tuteja
I have an app running on MySQL , I want to use mongoDB instead. I want to help on migration from mysql to mongoDB. Thanks, regards, Tushar Tuteja -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: MongoDb

2013-12-30 Thread Alan Etkin
I have an app running on MySQL , I want to use mongoDB instead. I want to help on migration from mysql to mongoDB. Thanks, Beware that mongodb adapter is in an experimental stage of development, so you should know what you are doing before migrating. I suppose there are lots of howtos

[web2py] Re: gevent and admin app

2013-12-30 Thread Arnon Marcus
How do I do that? I tried the anyserver -h flag, but there was nothing there about 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

Re: [web2py] Re: MongoDb

2013-12-30 Thread Tushar Tuteja
Hey, Thanks for the answer. Luckily there are no joins, but I need to see what web2py features of DAL won't work. Thanks, Regards, Tushar Tuteja On 30 December 2013 16:44, Alan Etkin spame...@gmail.com wrote: I have an app running on MySQL , I want to use mongoDB instead. I want to help on

[web2py] OFF TOPIC - Text to SVG !

2013-12-30 Thread António Ramos
Fantastic http://bramp.github.io/js-sequence-diagrams/ -- 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

Re: [web2py] Re: MongoDb

2013-12-30 Thread Alan Etkin
Thanks for the answer. Luckily there are no joins, but I need to see what web2py features of DAL won't work. To my knowledge, you cannot use the scheduler or Auth.accessible_query, everything else not requiring join queries should work. -- Resources: - http://web2py.com -

[web2py] Re: gevent and admin app

2013-12-30 Thread Niphlod
how do you connect to the admin app when it's served by rocket ? the same way goes for the gevented webserver (or anyserver.py). ssh forwarding ssh -L localport:host:hostport user@ssh_server On Monday, December 30, 2013 1:06:35 PM UTC+1, Arnon Marcus wrote: How do I do that? I tried the

Re: [web2py] Re: create doc files

2013-12-30 Thread Diego Tostes
thanks anthony, but did not works... the result was a file with no name with None printed at the first page 2013/12/29 Anthony abasta...@gmail.com You are attempting to return a pyrtf.Document object, but instead you must stream a file or file-like object. You have to render the document

Re: [web2py] Re: create doc files

2013-12-30 Thread Cliff Kachinske
What happens if you move doc.Sections.append ( section ) after the line that says section.append( p ) ? On Monday, December 30, 2013 7:52:07 AM UTC-5, Diego Tostes wrote: thanks anthony, but did not works... the result was a file with no name with None printed at the first page

[web2py] Re: wrong version of web2py book on dropbox

2013-12-30 Thread LightDot
My understanding is that: - github repo for the book app has the latest content - the online book app is somewhat regularly updated from the github repo - the pdf is generated only when the actual book gets published. So once the 6th edition gets out, the pdf will reflect this, not before.

[web2py] Re: Calendar widget in a custom form?

2013-12-30 Thread Paolo Caruccio
Please try to add to the INPUT the class date: form=FORM(TABLE(...TR(Admission Date: ,INPUT(_class='date',_name= 'adm_date',widget=SQLFORM.widgets.date.widget,requires=IS_DATE()))... Il giorno lunedì 30 dicembre 2013 09:48:06 UTC+1, Keith Planer ha scritto: After adding some input validation

[web2py] Re: gevent and admin app

2013-12-30 Thread Arnon Marcus
I have no idea what ssh forwarding is, or whatever it is you wrote here-I can look it up. I am not a linux wiz by any means, nor an operations guy - just learning things as I go as I need them. I understand that the admin app, by default, requires a secure channel, for ano non localhost usage.

Re: [web2py] Re: Calendar widget in a custom form?

2013-12-30 Thread Keith Planer
That fixed it, Paolo, thanks! On Mon, Dec 30, 2013 at 8:33 AM, Paolo Caruccio paolo.carucci...@gmail.comwrote: Please try to add to the INPUT the class date: form=FORM(TABLE(...TR(Admission Date: ,INPUT(_class='date',_name=

[web2py] with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
Hi, I have this on the view: div input name=name onkeyup=ajax('org_form_load.load', ['name'], 'org_form_target') / /div div id = org_form_target/div and something like this on the controller: def org_form_load(): org_code = request.vars.name org_code_name =

Re: [web2py] Re: create doc files

2013-12-30 Thread Anthony
Sorry, a couple mistakes in the code. This should do it: def generate_doc(): from gluon.contrib.pyrtf import * import cStringIO doc = Document() ss = doc.StyleSheet section = Section() doc.Sections.append( section ) p = Paragraph(

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Anthony
The form is not accepted when it is first created, so you will always get that error message. Instead, you want: elif form.errors: response.flash = 'There was an error..' Anthony On Monday, December 30, 2013 10:21:58 AM UTC-5, Avi A wrote: Hi, I have this on the view: div

[web2py] db modul creating question types

2013-12-30 Thread Timo Bahner
Hi. How do I define question_types (ie text, radio, checkbox) in a table? db.define_table('question', Field('title'), Field('question_type', ??? )) Do I list them somewhere or do I create a field for all three options? I want to be able to choose the question type while creating a

[web2py] Re: gevent and admin app

2013-12-30 Thread Niphlod
nope. anyserver does not provide ssl capable webserver, 'cause most of the engines leave SSL out of the picture (i.e. since usually you'd want them behind a real webserver that acts as a proxy, like apache or nginx, SSL is managed there and not by the python engine). That being said, I think

Re: [web2py] Re: create doc files

2013-12-30 Thread Jonathan Lundell
On 30 Dec 2013, at 7:31 AM, Anthony abasta...@gmail.com wrote: Sorry, a couple mistakes in the code. This should do it: There's a pyrtf example in the book http://web2py.com/books/default/chapter/29/10/services?search=pyrtf#PyRTF that uses a helper (dumps) and apparently returns a string. I

[web2py] Re: db modul creating question types

2013-12-30 Thread Paolo Caruccio
# radio Field('question_type', widget=SQLFORM.widgets.radio.widget, requires= IS_IN_SET(['option A','option B']) #checkboxes Field('question_type', widget=SQLFORM.widgets.checkboxes.widget, requires= IS_IN_SET(['option A','option B','option C']) #textarea Field('question_type', 'text') #text

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
Thanks, It solved the error getting after the form is loaded into the page, but still nothing happen if I submit the form. This is what I do: if form.process().accepted: response.flash = 'Success!' elif form.errors: response.flash = 'response errors' On Monday, December

[web2py] Re: Calendar widget in a custom form?

2013-12-30 Thread Keith Planer
One other small problem, the field doesn't allow for nothing to be entered now. How do I make it optional? On Monday, December 30, 2013 8:33:34 AM UTC-6, Paolo Caruccio wrote: Please try to add to the INPUT the class date: form=FORM(TABLE(...TR(Admission Date: ,INPUT(_class='date',_name=

[web2py] Re: Calendar widget in a custom form?

2013-12-30 Thread Keith Planer
Nevermind, found it. requires=IS_EMPTY_OR(IS_DATE()) On Monday, December 30, 2013 11:31:36 AM UTC-6, Keith Planer wrote: One other small problem, the field doesn't allow for nothing to be entered now. How do I make it optional? On Monday, December 30, 2013 8:33:34 AM UTC-6, Paolo Caruccio

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Anthony
The form won't get submitted to the org_form_load action, but instead will get submitted to the action of the parent page. You have to trap the form submission and submit back to the org_form_load action. Rather than using the ajax() function to load a form, you're better off loading the form

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
Thanks. I will look into it. Happy new year! and thanks for all the awesome support! On Monday, December 30, 2013 7:47:48 PM UTC+2, Anthony wrote: The form won't get submitted to the org_form_load action, but instead will get submitted to the action of the parent page. You have to trap the

Re: [web2py] Re: create doc files

2013-12-30 Thread Diego Tostes
thanks anthony!! works! but one more thing, is it possible create a rtf template and send parameters to the template? rgsd, Diego 2013/12/30 Anthony abasta...@gmail.com Sorry, a couple mistakes in the code. This should do it: def generate_doc(): from gluon.contrib.pyrtf import *

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
How is the name (input value) is passed in this component template/case? (i click the code and the form won't load into the page.). On Monday, December 30, 2013 7:49:32 PM UTC+2, Avi A wrote: Thanks. I will look into it. Happy new year! and thanks for all the awesome support! On Monday,

[web2py] Re: OFF TOPIC - Text to SVG !

2013-12-30 Thread Massimo Di Pierro
Fantastic indeed. On Monday, 30 December 2013 06:14:29 UTC-6, Ramos wrote: Fantastic http://bramp.github.io/js-sequence-diagrams/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: db modul creating question types

2013-12-30 Thread Paolo Caruccio
If you want more questions with different types in the same form you could be interested to read this discussion https://groups.google.com/forum/#!topic/web2py/FAvjWNUiC3Y Il giorno lunedì 30 dicembre 2013 18:01:04 UTC+1, Paolo Caruccio ha scritto: # radio Field('question_type',

[web2py] Re: Trouble setting up database that chooses predefined options.

2013-12-30 Thread Dave S
On Saturday, December 28, 2013 7:18:27 AM UTC-8, Cliff wrote: Dave Just wanted to give you an update. I have it working for now and will play with some other features in the future. I tried uploading it to GAE but it was being a pain so I threw it on a old web page of mine.

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Anthony
Oops, sorry. You'll need to do something more sophisticated. Create an onkeyup handler that retrieves the value in the input and appends it to the URL of the form action (i.e., /default/org_form_load.load/some_name). Then call $.web2py.component() with that URL, and in the org_form_load action,

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
ok thanks. On Monday, December 30, 2013 8:24:04 PM UTC+2, Anthony wrote: Oops, sorry. You'll need to do something more sophisticated. Create an onkeyup handler that retrieves the value in the input and appends it to the URL of the form action (i.e., /default/org_form_load.load/some_name).

[web2py] Re: Integration with source control system

2013-12-30 Thread Dave S
On Saturday, December 28, 2013 9:13:33 PM UTC-8, Massimo Di Pierro wrote: Your application will be in a folder web2py/applications/yourapp. You can use any version control system you like for the content of that folder. this is orthogonal to web2py. I do like the integration in the admin

[web2py] Re: I don't want 'Login Successful' or 'Success' popping up on the screen in my app.

2013-12-30 Thread Anthony
If you generally don't want flash messages, you can remove the response.flash code from layout.html. If you want to prevent specific messages, you can do so via the arguments to SQLFORM. For Auth messages, you can do things like: auth.messages.logged_in = None SQLFORM and Auth set the

[web2py] Re: gevent and admin app

2013-12-30 Thread Arnon Marcus
Cool, thanks. I have been using putty and winSCP pretty extensively for about a year now - but I won't even need that to access the web2py app files, because I managed to get a samba server up and running... What I meant by 'accessing the admin app', was that when we have a server-error, we

[web2py] REF: Date format

2013-12-30 Thread Teddy Nyambe
I have noted that mysql stores its dates as %Y-%m-%d, i would like to know if the Field() or any DAL method is available to change the date to %d/%m/%Y when doing a select? -- ... Teddy Lubasi Nyambe Opensource

[web2py] Re: ValueError: invalid literal for int() with base 10: ''

2013-12-30 Thread Keith Planer
I'm having the same problem, but I'm struggling with saving the database. The corrupted field is a 'date' type. On Wednesday, May 27, 2009 1:15:36 AM UTC-5, ニコノコ wrote: I found the source of my problem. I have records with null values. And since sqlite don't enforce data typing, I assume

[web2py] Re: REF: Date format

2013-12-30 Thread Niphlod
stop right there, I see a lot of confusion going around :-P unless in sqlite, where dates are stored as strings and parsed back, datetimes in other engines are stored as datetimes (meaning, not strings). the %Y-%m-%d notation is the ISO format (i.e. a default way to represent a date as a

[web2py] Re: gevent and admin app

2013-12-30 Thread Niphlod
if you're using putty then why don't you use port forwarding ? that's definitely the easier (and secure) way to go. summary: using putty, go to connections--ssh--tunnels, put *8000* (or whatever port gevent is listening to) into source port, put *localhost:8000*into destination and voilà.

Re: [web2py] Re: gevent and admin app

2013-12-30 Thread Arnon Marcus
That sounds totally cool! Didn't know this can be done... On Mon, Dec 30, 2013 at 10:14 PM, Niphlod niph...@gmail.com wrote: if you're using putty then why don't you use port forwarding ? that's definitely the easier (and secure) way to go. summary: using putty, go to

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
It works only till the alert... script function insert_component(org_code) { alert(org_code); $.web2py.component('%s', 'org_form_target'); % URL('default', 'org_form_load.load/org_code'); } /script On Monday, December 30, 2013 8:27:00 PM UTC+2, Avi A wrote: ok thanks. On Monday, December

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Anthony
$.web2py.component('%s', 'org_form_target'); % URL('default', 'org_form_load.load/org_code'); is actually Python code that generates Javascript, so you cannot use it as you are using it. Instead, I would create the url variable separately: function insert_component(org_code) { alert(org_code);

[web2py] Re: with ajax load, getting form failure alert before form was submitted

2013-12-30 Thread Avi A
I was in the direction in one of the tries... Thanks. On Monday, December 30, 2013 11:17:44 PM UTC+2, Anthony wrote: $.web2py.component('%s', 'org_form_target'); % URL('default', 'org_form_load.load/org_code'); is actually Python code that generates Javascript, so you cannot use it as you

[web2py] What is the purpose of data-w2p_disable_with?

2013-12-30 Thread User
Links I build with the anchor A html helper look like: a href=/myapp/mycontroller/view/5 data-w2p_disable_with=defaultAnchor Text/a What is the purpose of the data-w2p_disable_with = default attribute and how can I remove it? -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: What is the purpose of data-w2p_disable_with?

2013-12-30 Thread Anthony
That's so the link can be temporarily disabled (the text will be replaced with Working...) when it is used to trigger an Ajax request. However, I don't know why it's included in the anchor tag in all cases -- seems like it would only be needed when the cid, component, or callback arguments are

Re: [web2py] Re: REF: Date format

2013-12-30 Thread Teddy Nyambe
Hi Niphlod, Am building a one page Ajax app using dhtmlx and web2py as the backend engine so for it's working excellent can share the code when done. So most of the dhtmlx UI elements like talking in json. So I hv represented my dates as %d/%m/%Y so the UI expects me to give back a date in that

[web2py] always get This webpage has a redirect loop if use google oauth2

2013-12-30 Thread Wei Li
I am trying to make a tiny example to login my app via google oauth2. However, I always got This webpage has a redirect loop error from the browser if I use @auth.requires_login() pragma. Model Code: from gluon.contrib.login_methods.oauth20_account import OAuthAccount