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
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!
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!
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
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,
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')
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
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
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
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
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,
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
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
*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']
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
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
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
try the solution in this discussion
https://groups.google.com/d/topic/web2py/GyQ8_szQFoI/discussion
Happy Holidays.
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
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?
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'] =
You mean my original code is working? With IE it is not.
What browser you are using? In IE nothing comes
for download.
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
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 ??
http://stackoverflow.com/questions/8661166/custom-css-classes-for-sqlform-widget-input-in-web2py
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 = ',,'
Good work.
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
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
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
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
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
If you are using mysql db, you can try to use triggers instead of all of
this.
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
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
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
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
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
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,
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!
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.
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
*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]
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
--
44 matches
Mail list logo