[web2py] Re: Minor optimize: skip superfish when possible

2011-12-28 Thread Ray (a.k.a. Iceberg)
Hi Massimo, I just noticed that my second patch is derived from an old revision of web2py skeleton app. It might not be directly patched the latest trunk. Anyway, this is what it tries to solve, and you can digest it and do it again in the latest trunk. 1. Wrap all those {{=MENU(...)}} script

[web2py] SQLFORM.grid ignore_rw option

2011-12-28 Thread Dariel Dato-on
Hello! When I pass the 'ignore_rw=True' to SQLFORM.grid(), not all the fields are displayed in the grid. The fields that are set to 'readable=False' are not displayed in the grid. Is this the correct behavior? If so, how can I modify it? Thanks!

Re: [web2py] Strikethrough with MARKMIN

2011-12-28 Thread Manuele Pesenti
Il 28/12/2011 07:08, lyn2py ha scritto: How do I strikethrough some text using MARKMIN? It's not available in the book, but I noticed that MARKMIN has a strikethrough attribute. use the source... young Skywalker! :) M. Thanks!

[web2py] auth.settings.login_onaccept NOT working as expected

2011-12-28 Thread david.waldrop
I have the following auth.settings : # log system events auth.settings.login_onaccept = lambda form:logactivity('Login','none') auth.settings.profile_onaccept = lambda form:logactivity('Update Profile','none') auth.settings.register_onaccept = lambda form:logactivity('Register','none') which

[web2py] Re: SQLFORM.grid ignore_rw option

2011-12-28 Thread Anthony
I believe the 'ignore_rw' argument to .grid() applies only to the create/view/edit forms (as with SQLFORM), not the grid. To get a field to appear in the grid, you probably have to explicitly set its 'readable' attribute to True. Anthony On Wednesday, December 28, 2011 2:53:57 AM UTC-5,

[web2py] Re: auth.settings.login_onaccept NOT working as expected

2011-12-28 Thread Anthony
On Wednesday, December 28, 2011 9:18:07 AM UTC-5, david.waldrop wrote: I have the following auth.settings : # log system events auth.settings.login_onaccept = lambda form:logactivity('Login','none') auth.settings.profile_onaccept = lambda form:logactivity('Update Profile','none')

[web2py] Re: auth.settings.login_onaccept NOT working as expected

2011-12-28 Thread david.waldrop
Anthony, Thanks for the response. I was NOT aware of the auth_event table. In my case I still think I need my own log table as I am logging certain events in order to generate site specific activity metrics and think it would be convenient to collect all the activity in a single place. Do

[web2py] Re: auth.settings.login_onaccept NOT working as expected

2011-12-28 Thread Anthony
Ins't it weird that after the onaccept callback the user is still not logged in? what is the difference between onaccept and onvalidate then? No, your problem is not that the user isn't logged in after onaccept -- it's that you test whether the user is logged in in your model file, and

[web2py] Re: Strikethrough with MARKMIN

2011-12-28 Thread lyn2py
Appreciate answers / urls instead. I found the strikethrough attribute through google. I've searched through the book. MARKMIN doesn't say anything about strikethroughs. Is MARKMIN documentation complete? Or is strikethrough not recommended to use yet? If I understood the source I wouldn't be

Re: [web2py] Re: Strikethrough with MARKMIN

2011-12-28 Thread Martín Mulone
I think is not there, perhaps you can propose or pass extra argument. Warning: I didn't test it. extra = {'strike':lambda text: SPAN(text, style='color:red;text-decoration:line-through').xml()} MARKMIN(text, extra) 2011/12/28 lyn2py lyn...@gmail.com Appreciate answers / urls instead. I

Re: [web2py] Re: Strikethrough with MARKMIN

2011-12-28 Thread Martín Mulone
I forget how to use it in content :P `my text`:strike 2011/12/28 Martín Mulone mulone.mar...@gmail.com I think is not there, perhaps you can propose or pass extra argument. Warning: I didn't test it. extra = {'strike':lambda text: SPAN(text,

[web2py] Re: Strikethrough with MARKMIN

2011-12-28 Thread Massimo Di Pierro
even without the extra you should be able to do style.strike {color:red;text-decoration:line-through}/style {{=MARKMIN('.``text``:strike ')}} unkown tags are mapped into classes. On Dec 28, 10:29 am, Martín Mulone mulone.mar...@gmail.com wrote: I forget how to use it in content :P

[web2py] Re: Bug in widget.py: lack type='int' in new added --socket-timeout param

2011-12-28 Thread Carlos
Hi, Not sure if this is the actual cause of my problem, but after loading this changeset (9619eb054669 / Socket timeout is now int an defaults to 60secs), multiple semi-concurrent requests from different browsers (IE / firefox / chrome / opera / safari) to the same page (web2py function) take

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread thstart
*As I see I need this:* * stream = cStringIO.StringIO() * * return stream.getvalue() * * * *I have a ready to go content as a string in a variable:* *content = * '.'* * So how to put this string in a stream? *My code is:* * * *def download(): response.headers['Content-Type']

[web2py] Re: (Another) Blog Engine in web2py

2011-12-28 Thread Joseph Jude
Power of web2py is in running the same code base both in GAE webfaction. Here is the blog engine (with imported wordpress entries) in webfaction: http://www.jjude.biz I wrote about it here: http://goo.gl/zidxe Let 2012 be a great year. Joseph

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread Anthony
On Wednesday, December 28, 2011 1:05:43 PM UTC-5, thstart wrote: *As I see I need this:* * stream = cStringIO.StringIO() * * return stream.getvalue()* Actually, that will do the same thing you've already tried (stream.getvalue() is just a string, so you'll be returning a string, just like

[web2py] write view into an html file

2011-12-28 Thread Adi
I have a nicely formatted HTML displayed in a view, but now need to save it as PDF. Is there any approach where it wouldn't be necessary to reformat the document again, instead just save HTML as PDF? Tried using generic.pdf, but got the error that PIL is missing, and also when I tried to

[web2py] Re: write view into an html file

2011-12-28 Thread Paolo Caruccio
try the solution in this discussion https://groups.google.com/d/topic/web2py/GyQ8_szQFoI/discussion Happy Holidays.

[web2py] Re: Many-to-many admin form

2011-12-28 Thread Christopher Steel
OK, Here are some resources you will want to check out if you have not found them on your own already. # Web2py Plugins ## http://web2py.com/plugins/default ### looks good http://web2py.com/plugins/default/tagging ### interesting http://web2py.com/plugins/default/multiselect

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread thstart
file is composed dynamically - I get it from request - it is send like ?file=name and I get it from there. can you post the code you just tried?

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread Anthony
I literally just copied and pasted your code into a basic 'welcome' app, except I hard-coded a filename (data.csv): def download(): response.headers['Content-Type'] = 'text/csv' attachment = 'attachment;filename=data.csv' response.headers['Content-Disposition'] =

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread thstart
You mean my original code is working? With IE it is not. What browser you are using? In IE nothing comes for download.

Re: [web2py] Re: Many-to-many admin form

2011-12-28 Thread Bruce Wade
OK thanks, I will take a look through the resources you have provided. -- Regards, Bruce On Wed, Dec 28, 2011 at 12:35 PM, Christopher Steel chris.st...@gmail.comwrote: OK, Here are some resources you will want to check out if you have not found them on your own already. # Web2py Plugins

[web2py] compute on update

2011-12-28 Thread Richard Vézina
Hello, I would like to compute a field on update, but I think all the request.vars needed to my lambda compute function are not passed to form.vars... What I should do to make sure all the needed vars are available to the lambda compute function? form.vars.varname = request.vars.varname ??

[web2py] How to set custom CSS classes for SQLFORM widget input in web2py

2011-12-28 Thread Kenny Meyer
http://stackoverflow.com/questions/8661166/custom-css-classes-for-sqlform-widget-input-in-web2py

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread Anthony
I literally copied your exact code (just had to hard-code the filename): def download(): response.headers['Content-Type'] = 'text/csv' attachment = 'attachment;filename=data.csv' response.headers['Content-Disposition'] = attachment content = ',,'

Re: [web2py] Re: new appliances - Happy Holidays

2011-12-28 Thread Khalil KHAMLICHI
Good work.

[web2py] Re: How to set custom CSS classes for SQLFORM widget input in web2py

2011-12-28 Thread Alan Etkin
It is possible to iterate trough any input element within the form object with this command for f in form.elements(input):... Sequences of objects can be retrieved with the css like syntax: element sub-element element.class element[type=submit] Where form is a SQLFORM instance And class input

[web2py] Re: How to set custom CSS classes for SQLFORM widget input in web2py

2011-12-28 Thread Anthony
Answer: http://stackoverflow.com/a/8661906/440323 On Wednesday, December 28, 2011 3:52:04 PM UTC-5, Kenny Meyer wrote: http://stackoverflow.com/questions/8661166/custom-css-classes-for-sqlform-widget-input-in-web2py

[web2py] Re: How to set custom CSS classes for SQLFORM widget input in web2py

2011-12-28 Thread Alan Etkin
And you might consider defining the class attribute with a custom widget for the css to be available to all app forms. Custom widgets are covered in the web2py book (7.7) On 28 dic, 19:42, Alan Etkin spame...@gmail.com wrote: It is possible to iterate trough any input element within the form

[web2py] Re: How to make a function to download a file?

2011-12-28 Thread Anthony
On Wednesday, December 28, 2011 4:10:55 PM UTC-5, thstart wrote: You mean my original code is working? With IE it is not. What browser you are using? In IE nothing comes for download. Works in IE7 and IE9 for me. Are you clicking a link or going directly to /appname/controller/download in

Re: [web2py] Re: How to make a function to download a file?

2011-12-28 Thread Constantine Vasil
I fired the debugger, when I click on the link, the debugger stops at the function (the name is export), it comes down to raise HTTP but does not downloads the file. On Wed, Dec 28, 2011 at 2:56 PM, Anthony abasta...@gmail.com wrote: On Wednesday, December 28, 2011 4:10:55 PM UTC-5, thstart

Re: [web2py] Re: Record Versioning

2011-12-28 Thread Khalil KHAMLICHI
If you are using mysql db, you can try to use triggers instead of all of this.

[web2py] Re: How to set custom CSS classes for SQLFORM widget input in web2py

2011-12-28 Thread Anthony
On Wednesday, December 28, 2011 5:50:53 PM UTC-5, Alan Etkin wrote: And you might consider defining the class attribute with a custom widget for the css to be available to all app forms. Good suggestion. Note, you don't necessarily need to create a custom widget -- you can pass HTML

Re: [web2py] Re: How to make a function to download a file?

2011-12-28 Thread Anthony
Not sure what the problem is. What version of web2py? Can you attach a minimal app that reproduces the problem? On Wednesday, December 28, 2011 5:58:03 PM UTC-5, thstart wrote: I fired the debugger, when I click on the link, the debugger stops at the function (the name is export), it comes

[web2py] Re: Strikethrough with MARKMIN

2011-12-28 Thread lyn2py
Thanks Massimo and Martin! Didn't realize that MARKMIN has this feature On Dec 29, 12:38 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: even without the extra you should be able to do style.strike {color:red;text-decoration:line-through}/style {{=MARKMIN('.``text``:strike

[web2py] AttributeError: 'thread._local' object has no attribute '_scheduled'

2011-12-28 Thread Brian M
This is simply a note for anybody else who may come across this error when trying to run web2py's scheduler - it works just fine, provided you actually set it up in your code. (As great as web2py is, it is not psychic) python web2py.py -K myapp ... AttributeError: 'thread._local' object has no

[web2py] Re: write view into an html file

2011-12-28 Thread Adi
Thanks Paolo for your advice. What do you have to install to get the plugin working? If I understood properly, appreport plugin depends on xhtml2pdf, and that one depends on two-three other libraires: Reportlab Toolkit 2.2+ html5lib 0.11.1+ pyPdf 1.11+ (optional) Is this the only way how to

[web2py] Re: write view into an html file

2011-12-28 Thread Adi
got the html export into file working with code bellow: # write view html into file conf, po, skus = get_data(65)# test data view_template = os.path.join(request.folder, 'views/default', 'print_proforma_invoice.html') html = response.render(view_template, dict(conf=conf,

[web2py] Suggestion: db stats in response.toolbar format

2011-12-28 Thread lyn2py
Hi Massimo, 1.99.4 stable The db stats in response.toolbar is one long single line, which is less readable than 1.99.2 (a lot of scrolling). Perhaps the readability can be improved for future versions (use the format in 1.99.2?). Thanks!

[web2py] How to use SELECT Tag (HTML HELP) to print out a list

2011-12-28 Thread Dan
Hi everyone, Happy holidays first. How do I use the the Web2Python HTML Helper =SELECT Tag to print out a select with all contents in a list. like following one select {{for i in ['a','b','c']:}} option{{=i}} /option {{pass}} /select Many thanks.

[web2py] Field vs id

2011-12-28 Thread JF
I think this information was actually somewhere in previous Books, but I just can't find it anymore in the 4th version. I would like to be able to get to a record, let's say from a function called edit. But using a Field from the table, not the id of the table. Example: This is accessed

Re: [web2py] How to use SELECT Tag (HTML HELP) to print out a list

2011-12-28 Thread Bruno Rocha
*SELECT(*[OPTION(i) for i in ['a', 'b', 'c']])* On Thu, Dec 29, 2011 at 4:52 AM, Dan ideall...@googlemail.com wrote: select {{for i in ['a','b','c']:}} option{{=i}} /option {{pass}} /select -- Bruno Rocha [http://rochacbruno.com.br]

[web2py] Re: How to use SELECT Tag (HTML HELP) to print out a list

2011-12-28 Thread Dan
Gotcha, thanks a lot. On Dec 29, 2:55 pm, Bruno Rocha rochacbr...@gmail.com wrote: *SELECT(*[OPTION(i) for i in ['a', 'b', 'c']])* On Thu, Dec 29, 2011 at 4:52 AM, Dan ideall...@googlemail.com wrote: select {{for i in ['a','b','c']:}} option{{=i}} /option {{pass}} /select --