The class isn't really named Foo, of course, but it makes for a more
readable subject line.
Here's the actual ticket:
Traceback (most recent call last):
File "/Users/mellis/web2py/gluon/main.py", line 504, in wsgibase
session._try_store_on_disk(request, response)
File "/Users/mellis/web2p
rror
is not related to anything in PTProblem class.
"""
def __init__(self,description,ownerid=0):
self.uuid = uuid.uuid1()
and alter the local_import statement in my previous post to look like:
PTProblemClass = local_import('dummyclass',reload=True)
Th
problems under WSGI, but they seemed to be GAE related
and the explanations weren't very clear (or at least not easy to
understand :-)
Any help much appreciated,
Mike
On May 6, 2:34 pm, MikeEllis wrote:
> More info:
>
> I've confirmed that any class defined in the modules director
session is retrieved before
> your code is executed and therefore before the module in question is
> imported.
>
> On May 6, 3:03 pm, MikeEllis wrote:
>
> > Oops forgot to include "import os" in my example code. It was imported
> > elsewhere in my app. With that co
try:
return f()
finally:
for n in objnames:
setattr(session,n,cPickle.dumps(getattr(session,n)))
return new_f
## -
On May 6, 5:59 pm, mdipierro wrote:
> yes.
>
> On May 6,
Massimo,
Could you please elaborate a bit further? Is this restriction
something peculiar to auth.requires_login? or service.jsonrpc? or
both? Or is it something that applies to any use of multiple
decorators in web2py?
Thanks,
Mike
On May 7, 10:32 am, mdipierro wrote:
> You cannot do this:
>
Hi,
I'm trying to create an application that displays live sparklines
(small inline graphs). A typical page might have a dozen or so of
these updating every few seconds, so it seems like either jsonrpc or
xlmrpc is the right thing to use.
As a test, I've currently got sparklines updating on the c
pc ## or is xmlrpc easier?
> def datapoints(j):
> return [n%j for n in [10,9,8,7,6,5,4]]
>
> WITH
>
> @service.json
> def datapoints(j):
> return dict(a=[10,9,8,7,6,5,4])
>
> On May 14, 3:32 pm, MikeEllis wrote:
>
> > Hi,
> > I'm trying
After spending some time with Firebug to find and fix a couple of
typos, I've got it working now. There seems to be no way around
explicitly referring to the SPAN element (see below), but I can live
with that.
Now I need to tackle the next level, which is to expand the server-
side JSON function
After spending some time with Firebug to find and fix a couple of
typos, I've got it working now. There seems to be no way around
explicitly referring to the SPAN element (see below), but I can live
with that.
Now I need to tackle the next level, which is to expand the server-
side JSON function
ar data series. Here's
a link to a chapter in Edward Tufte's "Beautiful Evidence" with more
info
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR
The JQuery Sparklines plug-in page is also useful.
http://omnipotent.net/jquery.sparkline/
Cheers,
Mike
On May 15,
Done. See http://www.web2pyslices.com/main/slices/take_slice/79
On May 15, 8:44 pm, Thadeus Burgess wrote:
> Would you make a web2pyslice of this with some screenshots? Looks like
> great work.
>
> --
> Thadeus
>
> On Sat, May 15, 2010 at 5:09 PM, MikeEllis wrote:
> >
Haven't been able to reach it all morning.
ping web2pyslices.com
PING web2pyslices.com (76.73.68.69): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_se
Is there a recommended way to control the location of the submit
button? I've got an app that dynamically generates lengthy forms with
SQLFORM.factory(). To make things easier for the user, I've arranged
it so that in many cases the user will only need to fill in one or two
items at the top of t
.1)
>
> {{=form.custom.begin}}
> {{=form.custom.submit}}
> {{=form.element('form')}} # use jquery syntax to select element
> {{=form.custom.end}}
>
> Not sure what form[1] is since it should not exist unless you appended
> something to the form.
>
> On Jun 5, 4:32 pm, MikeEllis wr
I've been using SQLFORM.factory() for cases where what's in the db
needs to be presented to the user in a different format. The online
book has some good examples. For your case, my first thought would be
to define a function in the model that generates the form, e.g.
def fooform():
fields =
Mike
On Jun 5, 7:08 pm, MikeEllis wrote:
> I've been using SQLFORM.factory() for cases where what's in the db
> needs to be presented to the user in a different format. The online
> book has some good examples. For your case, my first thought would be
> to define a
Yes! I see similar issues all the time on my Mac in Firefox. Most
often, things get confused when I break a line with a carriage
return. Seems to happen less when working in Chrome.
Mike
On Jun 4, 11:45 am, Jean Guy wrote:
> Hi,
>
> I would like to know there is other web2py user that are exper
Massimo,
Many, many thanks for adding formstyle functions in 179.1. You've
provided a solution for the one aspect of SQLFORM that has given me
the most headaches in trying to customize the presentation of form
items, namely that the composition of the items in the field rows are
determined in SQL
This one still has me stumped so I'm taking the liberty of adding some
more info to make it current in the discussions. As I noted in the
earlier post, the problem has to to do with CKEditor's image
insertion dialog somehow triggering a form submission. This is really
puzzling, because the link
Apologies for new post with same title but adding new info to the old
thread doesn't seem to be making it current in the discussions and I'm
really stuck trying to understand the problem. Anyway the original
post plus some new info I added just is at
http://groups.google.com/group/web2py/browse_t
It relies on knowledge of web2py's internal form naming
conventions.
2. It only works if the unwanted submit has an empty request.vars
3. I suspect I may be defeating the purpose of the formkey and
possibly creating a security hole.
Is there a better way?
thanks,
Mike
On Jun 29, 6:10 pm, MikeElli
I'm developing an app that needs to allow users to create and view
content that includes links, images, and embedded video, e.g. from
YouTube. The following wrapper for the XML function seems the minimum
set that will do the job, but I'm concerned about XSS attacks.
def myXML(text):
return XM
Thanks for responding!
The XML() helper is described in the online web2py book in section
5.2.
Basically, it prevents characters that are special to HTML from being
escaped in the output of other web2py helpers. The sanitize argument
tells XML() to escape all but a permitted set of tags and all
I'm trying to get started with GAE. Just downloaded GAE SDK 1.3.5 and
installed on OS X 10.6.4.
Seems to be working for a trivial hello world example that doesn't use
web2py but I can't get any of my web2py apps to run, even a brand new
one created with the admin interface. Dies importing from g
e
On Jul 10, 11:52 pm, MikeEllis wrote:
> I'm trying to get started with GAE. Just downloaded GAE SDK 1.3.5 and
> installed on OS X 10.6.4.
>
> Seems to be working for a trivial hello world example that doesn't use
> web2py but I can't get any of my web2py apps to
X.
On Jul 11, 2:53 am, mdipierro wrote:
> I do not understand why don't they check the Python version and report
> a wrong version as an error?
>
> On 10 Lug, 23:32, MikeEllis wrote:
>
>
>
> > Solved. GAE doesn't like 2.6 on OS X. Changing to 2.5 via the
&
I just modified my tools.py as follows:
elif self.settings.server == 'gae':
logging.warn("using gae mail server")
from google.appengine.api import mail
attachments = attachments and
[(a.my_filename,a.my_payload) for a in attachments]
track:
http://blog.docuverse.com/2009/01/30/google-app-engine-launcher-options/
Cheers,
Mike
On Jul 11, 12:20 pm, MikeEllis wrote:
> I just modified my tools.py as follows:
>
> elif self.settings.server == 'gae':
> logging.warn("using gae mail
estart the app
Here's the blog post that put me on the right track:
http://blog.docuverse.com/2009/01/30/google-app-engine-launcher-options/
Cheers,
Mike
On Jul 11, 12:20 pm, MikeEllis wrote:
> I just modified my tools.py as follows:
>
> elif self
FWIW, openwysiwyg doesn't work in Chrome.
Mike
On Jul 13, 1:19 pm, Jean-Guy wrote:
> Never used it!
>
> Jonhy
>
> On 2010-07-13 13:02, mdipierro wrote:
>
>
>
> > on a view [htmledit]. Do you use it?
Interesting idea! Of more immediate interest, to me at least, is the
underlying python-to-js translator (pycow 0.1) that emits very
readable and nicely indented Javascript. See
http://code.google.com/p/pygowave-server/wiki/PythonToJavaScriptTranslator
for the full scoop.
I installed pycow and ra
All in default.py is quick and easy during the early stages of
development but I find it gets messy later on. It's not too bad
moving controllers from default.py into their own modules. You just
have to remember to move your view files and change your redirect()
calls as needed to accommodate the
I've got a controller that presents the user with a ckeditor field
that lets them use a limited set of html markup. The editor returns
an empty paragraph if they press Submit without typing anything, ie,
'' , and my app needs to reject that. So I wrote a custom
validator as follows:
_striptags
.freeze" wrote:
> Do you get the same behavior when removing the ckeditor widget from
> the field? Your validator worked for me and the __call__ method was
> hit.
>
> On Jul 16, 5:07 pm, MikeEllis wrote:
>
>
>
> > I've got a controller that presents the u
.replace('{{=textarea_id}}', {
toolbar : 'Basic',
});
which is slightly more verbose but feels more satisfying since it only
requires me to know that I named my field 'edited' when I created the
form.
On Jul 16, 10:50 pm, MikeEllis wrote:
>
(Note: I've cross-posted this on the winpdb group, but that group
doesn't seem to have a lot of activity so I'm putting it here in case
someone has already worked this out.)
I recently started using winpdb to debug web2py applications. Great
product! In the past I've tended break out a debugger
I was just about to create new topic, but thought I'd start by
reporting here since it could be related.
The short description is:
1. Serve web2py (rocket.py, sqlite3, etc) over a lan connection from a
laptop
2. Open a page from my app on another laptop.
3. Also open the same page on the server l
Massimo, I'm impressed!!! I've followed the discussions about the
markmin syntax but didn't quite understand how it was meant to fit in
the overall scheme of web2py development. It looks like you've taken
web2py up to whole new level. Congrats!
Now I need to watch the video again, download the
Javascript namespace collision? Just a thought ...
On Jul 19, 5:31 pm, mdipierro wrote:
> I do not understand this either. They are different cookies.
>
> On Jul 19, 3:14 pm, weheh wrote:
>
>
>
> > Aha! Found it! I'm using jQuery tabs and wanted to test out the
> > persistent tabs feature. That
Massimo,
It's either in your environment (eg RF from fluorescent lights or
perhaps a wireless phone on the table) or in your audio circuitry.
Assuming you're using your MacBook's built-in video cam and mic, what
happens if you make a recording in a different room or building?
On Jul 21, 12:20 a
I tried changing to cron=False in web2py.py. No impact on problem.
Same two-laptop setup as described previous. Happens even on pages
that contain very little. Chrome DevTools shows same problem as
before: One or more the .js/.css/.png files are delayed by 20 to 25
seconds latency.
The proble
One more detail. As you would hope, it's generally not the case that
both browsers stall at the same time. While stalled on either laptop
I can keep reloading on the other.
On Jul 21, 3:03 pm, MikeEllis wrote:
> I tried changing to cron=False in web2py.py. No impact on problem.
&g
I see the list of packages includes urllib, so this might be a useful
and easy way to massively stress test a web app, e.g. deploy a few
thousand function instances that request a page after a random delay,
time the response, and return the delta-t. Assuming of course they
let you make requests o
ittle more complicated. Sets up logging, auth,
local_imports a module, and defines a couple of tables.
Hope this is useful,
Mike
On Jul 21, 5:03 pm, mdipierro wrote:
> The fact that you are having the problem with static files is giving
> me an idea for a test.
> Can you please try t
in trunk?
>
> That seems like a nice optimization, but (assuming it fixes the symptom) does
> it explain the 20-25-second stalls?
>
>
>
>
>
> > Massimo
>
> > On Jul 21, 2:08 pm, MikeEllis wrote:
> >> One more detail. As you would hope, it's gen
Typo: 2 sentence in prior message should read
" ... after XML() supplies the unescaped string."
On Jul 23, 3:28 pm, Michael Ellis wrote:
> Urgh! FWIW, putting XML() around the strings doesn't seem to work. Looks
> like the escaping is applied after XML() supplies the unquoted string.
>
> I tr
Update: (Summarizes a couple of emails exchanged with Massimo)
Yesterday I found that my instance of web2py appeared be "leaking"
processes at about 1 per hour. Massimo suggested running with -N to
disable cron. I started two instances this way -- one under winpdb
and another directly. They've
Same approach also works with the built-in Chrome DevTools if you're
using that browser.
On Jul 28, 6:11 pm, Thadeus Burgess wrote:
> use firebug, set a breakpoint in the javascript and look at the
> current stack at that point using firebug.
>
> --
> Thadeus
>
>
>
> On Wed, Jul 28, 2010 at 4:41
Very nice! It does bring up a question I've been meaning to ask:
What's the recommended practice for apps to check the web2py version
and announce "I need web2py X.XX or greater!"
On Jul 29, 10:23 am, VP wrote:
> Wow. Excellent work. And thank you.
FWIW, the following approach is working for us with a small team of
developers. We use SVN instead of mercurial, but I don't see why this
wouldn't work for mercurial.
1. All the python, html, and static files (and _nothing_ else) in our
app's directory tree are under version control in a separate
This looks really useful. Thanks for writing it. I'm trying to import
some existing python modules that have logging calls into a web2py
app. Just putting log.py into my models directory helps some, but I'm
not seeing any messages from my existing modules with level lower than
logging.ERROR. I am
I just ran into what may be the same problem. I created a python
module in my apps modules directory and it showed up in the admin page
listings, could be edited, etc, but trying to import in a controller
kept failing. After I restarted web2py, the import succeeded. Is
there some documentation
generic.rss layout.original.html
default generic.xml web2py_ajax.html
generic.htmllayout.html
python/web2py/applications/pda/views/default:
askuser.htmlindex.html
askuser.html.bakuser.html
Any help appreciated.
Thanks,
Mik
Thanks! That works (but wouldn't it make more sense for web2py to
include the application's modules directory in sys.path?)
Mike
On Jun 26, 10:52 am, DenesL wrote:
> You should be using:
>
> exec('from applications.%s.modules import xx as
> yy'%request.application)
> reload(yy)
>
> the reload is
Massimo,
Thanks for the quick reply! Yes, it's the same field I need to
validate. Can you steer me toward docs and/or examples of creating my
own validator and widget? (I have a copy of your manual).
Mike
On Jun 29, 2:16 pm, mdipierro wrote:
> It is possible but you would need to create your ow
I'm taking the liberty of extending this topic with a (somewhat)
related question. Hope that's all right.
Is it possible to use SQLFORM to create a dropdown entry with the
following properties?
1. Display a list of unique items in a given field AND
2. Accept new items typed into the entry box.
dget
>
> but in your case mywidget should return a table containing a select
> box obtained from selecting the records and an entry field (to add an
> option).
> This is not too easy although possible.
>
> Massimo
>
> On Jun 29, 1:23 pm, MikeEllis wrote:
>
&
#x27;
logging.info("FORM HAS ERRORS")
redirect(URL(r=request, f='asknewuser'))
else:
response.flash='please fill the form'
return dict(form=form)
def asknewuser():
"""
We get sent here if the operator enters
See the "table exists" discussions for background.
I'm trying to get around the problem by using a try/except but it
seems like the error type that's raised isn't defined until after the
error is raised.
So calling define_table without the try/except gives
Traceback (most recent call last):
F
incomplete table definition.
>
> Massimo
>
> On Jun 30, 9:52 am, MikeEllis wrote:
>
> > See the "table exists" discussions for background.
>
> > I'm trying to get around the problem by using a try/except but it
> > seems like the error type th
What's the recommended way to associate a text description with each
table created in the model file and display the description beside the
table listings in appadmin.py/index? I'm looking to do something like
the following:
in db.py:
...
db.define_table('blah',)
db.blah.description("Records
Jun 30, 4:57 pm, MikeEllis wrote:
>
> > doesn't migrate=False prevent me from altering the
> > table's structure within a running instance of web2py?
>
> Mostly correct - migrate=False means that Web2Py doesn't try to create
> the Table, but assumes this e
ons and
raises a decipherable error.
Any known problems with using session this way?
Cheers,
Mike
On Jun 30, 4:05 pm, MikeEllis wrote:
> What's the recommended way to associate a text description with each
> table created in the model file and display the description beside the
> tab
his is another strategy.
>
> You can, for now, also clear out all the *.table files from your app's
> databases directory (if you put them somewhere else, you can put them back
> if you change your mind)
>
> Hope this sheds a little more light.
>
> On Tue, Jun 30, 2009 a
es.
>
> In all other cases... did you move the content of the databases
> folder? Did you rename any of the files in there?
>
> Massimo
>
> On Jun 30, 4:07 pm, MikeEllis wrote:
>
> > Thanks Fran, that makes it much clearer. It would be nice if
> > migrate=True wor
hat deleted field is not in form and
everything still works.
ON DEVELOPMENT HOST
18. With web2py still running, update from SVN.
19. Visit index page. Deleted field is gone and everything still
works.
Amazing!
Cheers,
Mike
On Jul 1, 8:45 am, MikeEllis wrote:
> I'm confused, too!
(Note: there's a thread from last year on this subject, but for some
reason it's only providing links to reply to author and not to the
group)
The following model code is working correctly except that the
generated SQLFORM has INPUT elements instead of select elements even
though I've specifed an
;%(tbname,fname))
>
> select
>
> On Jul 2, 9:46 am, MikeEllis wrote:
>
> > (Note: there's a thread from last year on this subject, but for some
> > reason it's only providing links to reply to author and not to the
> > group)
>
> > The following m
Another vote for vim and ipython, but then I've never been a fan of
IDE's.
Mike
On Jul 14, 9:15 am, Benigno wrote:
> I am using MacVim, along with iPython and setting up breakpoints to
> debug using iPython.. I find it quite usefull. Before I used emacs,
> but MacEmacs latest versions are giving
FWIW, as a relatively new user of web2py, I'm much less interested in
HOWTO tutorials (Massimo's manual is quite good!) than in being able
to try and download example applications that are well-commented and
"close enough" to what I want to create that I can easily modify them
one step at time to
I've got a web2py application running on a PDA (Nokia 810). The
application controls a larger system of devices that are physically
moving within a WiFi network. The PDA is also in motion. The
web2py app is working very well, but we are encountering lower level
problems (failed connections, s
Hi all,
I'm passing the db object into an external module that needs to insert
some records into a table in the database. Not sure what the
following error means. Looks like web2py closed the db.
I'm running Version 1.64.3 (2009-06-19 07:35:40) on OS X 10.5.8
(Leopard). I'm using the built-in
ke
On Aug 31, 8:55 pm, mdipierro wrote:
> Any chance you can try the current version and see if you can
> reproduce this error?.
>
> On Aug 31, 5:45 pm, MikeEllis wrote:
>
> > Hi all,
>
> > I'm passing the db object into an external module that needs to insert
' in my environment dictionary just before
stepping into the generators via the send() method.
So if I'm understanding this correctly, it looks like web2py creates a
new instance of the db object with every page request. Is that
correct?
Thanks for all your help,
Mike
On Sep 1, 10:25 am
I'm seeing more or less the same problem but I haven't managed to get
the 2-process solution to work yet. I'm trying to use the
recommendation in version 2 of the manual:
""" An easy way to setup a secure production environment on a server
is to first stop web2py and then remove all the paramete
> On Sep 22, 2009 6:19 PM, "MikeEllis" wrote:
>
> I'm seeing more or less the same problem but I haven't managed to get
> the 2-process solution to work yet. I'm trying to use the
> recommendation in version 2 of the manual:
>
> """ An e
ecure channel."
Kuba, thanks for trying to help.
Mike
On Sep 22, 2:28 pm, Kuba Kucharski wrote:
> What do you get withhttp://myserverip:8000?
>
> On Sep 22, 2009 7:30 PM, "MikeEllis" wrote:
>
> The problem isn't getting to the admin interface. I didn't ev
I've also got a need to support uploading multiple files (perhaps
hundreds at a time) and arranging for each of them to result in a new
database record. What's the recommended way to do this?
Thanks,
Mike
On Sep 13, 11:35 am, ab wrote:
> This will require changes in this jquery plugin.
>
> Prob
I have a design question.
I'm part of a team developing a scientific app that will allow users
to upload seismic data and apply various kinds of processing and
plotting. It looks as though we'll need to support several different
raw data formats. The approach we're taking for this is to convert
> The "private" folder was supposed to mean "private of the application"
> > as of "anything this app wants manage without web2py help", not
> > "private from users".
>
> > Massimo
>
> > On Jan 26, 10:06 am, MikeEllis wrote
I get the error shown in the subject of this message when I try to
manually insert a new record into any of my tables using the built-in
db admin interface. The complete traceback is
Traceback (most recent call last):
File "/Users/mellis/web2py/gluon/restricted.py", line 173, in
restricted
statistics if you have guppy heapy installed :)
>
> -Thadeus
>
> On Wed, Jan 27, 2010 at 4:44 PM, MikeEllis wrote:
> > I get the error shown in the subject of this message when I try to
> > manually insert a new record into any of my tables using the built-in
>
I got tired of going through the edit page to get to the view after
editing a controller so I modified admin/controllers/default.py and
admin/view/default/edit.html as shown below. The changes cause an
extra line of links to the views associated with the controller to
appear at the top of the page
Ran into a small problem when I ported an app out of my local
development host and onto a remote host for more testing. Basically
it's this:
In controllers/default.py I have
f = local_import('foo', reload=True)
and in modules/foo.py I have
import bar
where bar is app/modules/bar.py.
FWIW, I had good results in a previous project using a recipe from
Massimo for a ram cached threadsafe class. I wasn't using Apache,
though.
See
http://groups.google.com/group/web2py/browse_thread/thread/325a8c8505ae7141/670cb692b8ecbab0?q=ThreadSafe+group:web2py#670cb692b8ecbab0
Cheers,
Mike
On
FALSE ALARM. One of my colleagues made a change I didn't notice.
Apologies,
Mike
On Jan 31, 9:14 pm, mdipierro wrote:
> hmm. need to to run some tests.
>
> On Jan 31, 7:52 pm, MikeEllis wrote:
>
> > Ran into a small problem when I ported an app out of my local
> >
Just upgraded to 1.74.9 After restarting the server I noticed two
persistent cron processes. My app isn't using cron. App seems to be
running fine, just wondering why the extra processes. I'm sure
they've never been there before. Similar results after upgrading
under Snow Leopard on a Mac.
Her
Thanks for catching that, Massimo. The pw is changed.
Actually, I will be using cron in the near future when we start
processing gobs of real data, but it's good to be reminded of how to
turn it off.
Cheers,
Mike
On Feb 1, 5:00 pm, Thadeus Burgess wrote:
> we might have his admin password, but
One funniness remains. I can't kill the web2py process with -SIGTERM
any more. Have break out the heavy artillery and use -9. Also,
killing the web2py process doesn't croak the cron processes. Have to
kill them individually.
Cheers,
Mike
On Feb 1, 5:00 pm, Thadeus Burgess wrote:
> we might h
sses. I think I know how to change that but I am not
> sure what the preferred behavior should be.
>
> On Feb 1, 4:48 pm, MikeEllis wrote:
>
> > One funniness remains. I can't kill the web2py process with -SIGTERM
> > any more. Have break out the heavy artillery and use -9.
> > I notice that too but I cannot figure out why yet.
>
> > I am not sure that killing the main web2py process should also kill
> > the cron processes. I think I know how to change that but I am not
> > sure what the preferred behavior should be.
>
> > On Feb 1,
92 matches
Mail list logo