I'm writing a script that runs in the web2py environment and accesses my
database through the DAL. Because my script is multithreaded and the DB
logic is not easily isolated to a single thread, I need multiple
connections to the DB, which means multiple DAL instances. I see I can do
this:
DAL(
I'd like to cast my vote against implementing something as core as Storage
in C, as that hinders web2py's support for PyPy and other alternate
runtimes that don't play nice with C modules.
On Wednesday, August 22, 2012 1:15:45 PM UTC-4, Massimo Di Pierro wrote:
>
> Some more info the issue
Are there any restrictions on what operations can/cannot be performed with
MongoDB through the DAL? E.g., I don't think MongoDB has a native JOIN
equivalent- does web2py emulate one?
On Monday, August 20, 2012 9:02:12 AM UTC-4, Massimo Di Pierro wrote:
>
> db=DAL('mongodb://127.0.0.1:5984/db')
>
> I assume you're using LOAD() with ajax=False (the default), correct?
Correct.
> I think Massimo generally discourages use of non-ajax components
What's the rationale behind this?
> LOAD('default', 'mycomponent', vars=dict(rows=rows))
>
That did the trick nicely, and feels much less h
st put the strings in
> and it seems to do what i want.
>
> on GAE you might rather do this in app.yaml as you save yourself loading
> web2py to serve a static file.
>
> cfh
>
> On Friday, August 17, 2012 8:14:08 PM UTC-7, spiffytech wrote:
>>
>> I'm try
For efficiency and simplicity, I would like to pass Python variables (such
as Rows objects) through LOAD() calls and have them accessible from the
loaded component. After checking the LOAD() source code, I found I could do
this by inserting the variables into request.env, since LOAD copies the
I'm trying to make routes.py send certain URLs to static files, but I can't
make it work on App Engine (neither the development server nor a production
deployment). The following route works with Rocket, and not App Engine:
routes_in = (
(r'.*stuff.txt.*', r'/init/static/stuff.txt'),
)
# Te
Well done, sir! I think this is an excellent way to solve the problem.
Model-less is still there for anyone who wants it, but with LazyDAL web2py
fixes the performance hit it takes from models while retaining the
simplicity, lack of boilerplate code, and fast implementation times that
set it ap
Yep, that fixes it! Thanks for your work on that!
On Tuesday, August 14, 2012 6:18:29 PM UTC-4, howesc wrote:
>
> i added a patch against trunk to the ticket. spiffytech - can you see if
> that works for you?
>
> cfh
>
> On Monday, August 13, 2012 12:20:02 AM UTC-7, howe
t it can be done?
>
> Anthony
>
> On Sunday, August 12, 2012 9:23:39 PM UTC-4, spiffytech wrote:
>>
>> I tested with your suggested orderby, but the outcome was the same.
>>
>> I tested with the query as you wrote it below, with no common_filter, and
>> the
IN queries (web2py belongs queries) that they
> have no more than 30 items in the list. "because i said so" says google.
>
>
>
> On Thursday, August 9, 2012 1:57:13 PM UTC-7, spiffytech wrote:
>>
>> I've narrowed the problem down further- the excepti
to
> serialize Rows objects to memcache (at least i think that is the limitation)
>
> cfh
>
> On Thursday, August 9, 2012 10:40:33 AM UTC-7, spiffytech wrote:
>>
>> I'm trying to use the DAL belongs clause on App Engine and am getting an
>> error.
>
I'm trying to use the DAL belongs clause on App Engine and am getting an
error.
posts = db(db.posts.id.belongs(post_ids)).select(db.posts.ALL, cache=(cache.
ram, 60))
Produces:
BadArgumentError: First ordering property must be the same as inequality
filter property, if specified for this quer
an app will perform reasonably on
their service.
So, now that I got a Rackspace deployment working, and their hosting isn't
slower than molasses, I'm a little more optimistic about AppFog.
On Sunday, July 29, 2012 12:04:06 AM UTC-4, spiffytech wrote:
>
> Tonight I threw up
Tonight I threw up a copy of my personal site, just to see if AppFog is
worth looking into. Perhaps my experience would have been better if I tried
during business hours while their live chat support was open, but I don't
plan to use AppFog after this experience.
The highlights:
- They adve
You can use web2py to implement the backend for such an ad system. It's
perfectly capable of deciding which ad to serve, recording things about who
views which ad, letting advertisers upload ads, etc. Most of that will
probably be straight-forward database queries that any web framework,
includ
By the way, I think this app is an *excellent* way to get features tested,
and to introduce users to features they might not ordinarily think to use.
I'd love to see the idea more-widely adopted!
On Thursday, July 12, 2012 4:36:38 PM UTC-4, Niphlod wrote:
>
> Hello everybody, in the last month
All the tests passed for me.
On Thursday, July 12, 2012 4:36:38 PM UTC-4, Niphlod wrote:
>
> Hello everybody, in the last month several changes were commited to the
> scheduler, in order to improve it.
> Table schemas were changed, to add some features that were missed by some
> users.
> On the
;
> On Saturday, 14 July 2012 09:13:51 UTC-5, spiffytech wrote:
>>
>> I'm trying to make routes_out put all requests for static content on a
>> static subdomain, e.g. domain.com/static/file.css ->
>> static.domain.com/static/file.css
>>
>> The followin
I'm trying to make routes_out put all requests for static content on a
static subdomain, e.g. domain.com/static/file.css ->
static.domain.com/static/file.css
The following is the closest I've come, but it doesn't work- it produces
static./static/file.css. What am I doing wrong?
routes_out = (
Before we add special features to the DAL, has anyone profiled the DAL with
queries and data similar to nick name's to see if there's any low-hanging
fruit we can tackle to speed up the normal select()?
nick name, can you please provide your table schema so we can test
performance on data sets
r RSS reading website.
>
> A working demo can be viewed at http://mobileblur.spiffyte.ch
>
> https://github.com/spiffytech/MobileBlur/tarball/master
>
>
>
> 2nd Place Prize $50
>
> Phyo Arkar from from Bu
>
> "spiffytech", how is your process/threads apache and wsgi conf?
>
My apache configuration is pretty straightforward:
WSGIScriptAlias /
"/home/spiffytech/apache/mobileblur.spiffyte.ch/docroot/wsgihandler.py"
I'm using the stock web2py wsgihandler.py
Have you considered publishing release candidates ~1 week ahead of a
release, to allow early-adopters to upgrade and see what's broken,
rather than having the rapid stream of releases? I saw you said "I'm
releasing 1.99.5 tomorrow, please test it today", but that's rather a
short and informal testi
When will the winners be announced?
On Feb 14, 11:04 pm, NetAdmin wrote:
> Hello All,
>
> February 15 is the last day for submissions for the
> Web2pyApplicationExhibitionVersion 3.0 so don't delay!
>
> For more details, see the pinned message at the top of the news-group.
>
> Mr.NetAdmin
>
> M
user:group Apache is configured to use).
The full source code can be found here[0], and I can provide
additional information on the server if needed.
What could be going wrong?
[0] https://github.com/spiffytech/MobileBlur/tree/master/applications/mobileblur
redirect(URL('my_IOError_page'))
>
> response._caller = mycaller
>
> response._caller wraps all action calls. Give it a try and let us know
> if this works.
>
> On Jan 13, 8:23 pm, spiffytech wrote:
>
>
>
>
>
>
>
> > My web2py appli
My web2py application is littered with calls to a library that loves
throwing exceptions when the website it connects to isn't available.
I'd like my web2py app to catch the exceptions thrown by the library
and redirect the user to a friendly error page. However, there are too
many library calls to
If I read the state dump correctly, your site is running over CGI, the
slowest possible way to host a Python website. CGI starts a new
process for each request. This is fine for PHP, since the PHP runtime
starts up very quickly. The Python virtual machine, however, starts up
much more slowly.
I ex
What you need is the pattern-based routing system:
http://web2py.com/books/default/chapter/29/4#Pattern-based-system
The pattern-based system allows you to route URLs based on regular
expressions. You can convert certain portions of a URL into GET args
or vars.
web2py does not allow you to map UR
What's the complexity of site you guys normally build with web2py? Is
it mostly CRUD stuff, or anything more complicated? Has anyone built a
CMS in web2py?
On Jul 26, 1:39 am, howesc wrote:
> i do all my work as freelance work, and have done 98% of it in web2py in the
> last 2-3 years. it works
I'm picking out a framework to use for freelance web development. Does
anyone use web2py in that sort of situation? How does it fare? Do you
find anything particularly limiting or particularly easy? How do
clients respond when you tell them you're building the site in Python
(not PHP), and that you
On Apr 11, 11:49 pm, JorgeRpo wrote:
> what is ingredient_num for?
It's to keep track of what order the ingredients are in- recipes
usually list ingredients in the order you will use them.
On Apr 12, 1:14 am, pbreit wrote:
> I'd suggest something like this:
That's essentially what I planned t
I'm creating a tool to manage recipes and I'm stuck creating the
recipe entry form. Each recipe has a many-to-many database relation
with ingredients. The user needs to be able to enter an arbitrary
number of ingredients for each recipe. Each ingredient used in a
recipe must include the quantity an
I'm fetching data from my database, converting it to JSON with
simplejson.dumps(), then passing it to my view to include in my
Javascript. I need to escape the JSON vars to prevent XSS attacks
without escaping all of the brackets, braces, and quotes that make
JSON work.
How can I do this? What I'v
StackExchange is designed such that people who don't know what they're
talking about get voted down, while those who have quality answers get
voted up to the top. When I'm reading StackOverflow, the reading the
highest-voted questions first makes the poor quality of the lower-
voted questions very
I use web2py for my personal website (www.spiffyte.ch). I'm also using
web2py to handle the server-side portions of a turn-based multiplayer
game I'm working on. The automatic JSON encoding is very handy for
that.
On Mar 12, 11:29 am, Thadeus Burgess wrote:
> It blogs (thadeusb.com /http://code.
I finally finished the article I promised. I couldn't post to the
wiki, so I posted to AlterEgo instead:
http://web2py.com/AlterEgo/default/show/260
Since I've done little with web2py forms and auth, they're not
covered. Feel free to change the article to include how to test them.
On Mar 2, 8:5
t
> command line args.
>
> -Thadeus
>
> On Thu, Feb 25, 2010 at 1:37 PM, spiffytech wrote:
> > ot know any reason as to why web2py passes along args that it is
> >> not using. However I think this could be beneficial in certain scripts
> >> that need to rely on ce
at the -S arg to determine
> what app I am currently working on for this script.
>
> There should be a way though to easily filter out web2py args from
> sys.argv in a script perhaps a helper function in shell.py that
> can do this for you when you call it.
>
> -Thadeus
ave your
> code structured.
>
> -Thadeus
>
> On Thu, Feb 25, 2010 at 8:02 AM, Tiago Almeida
>
> wrote:
> > I concur. Thanks :)
>
> > On Thu, Feb 25, 2010 at 1:52 PM, Nicol van der Merwe
> > wrote:
>
> >> Super awesome, thanks!
>
> >&
stCase):
def setUp(self):
request = Request() # Use a clean request
def testListActiveGames(self):
# Set variables for the test function
request.post_vars["game_id"] = 1
request.post_vars["username"] = "spiffytech"
# Call a
r actual database? Usually I
> define a test.sqlite database that has
> nothing in it, and during my tests gets data inserted, altered, and
> then removed at the end of the tests.
>
> -Thadeus
>
> On Wed, Feb 24, 2010 at 9:35 PM, spiffytech wrote:
> > Thanks! Interesting ar
#x27;m
> unfortunately just too busy to research all this and make my own slice).
>
> It would be very much appreciated if this can be done :)
>
> Nicolaas
>
> On Thu, Feb 25, 2010 at 5:35 AM, spiffytech wrote:
> > Thanks! Interesting article! My test cases now execute. Ho
["game_id"] = 1
self.request.post_vars["username"] = "spiffytech"
self.controller.list_active_games()
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestListActiveGames))
unittest.TextTestRunner(verbosity=2).run(suite)
==
It is called with the command:
t;"
> >>>> db(db.people.id > 0).count()
> > '35'
> > """
> > return db(db.people.id > 0).count()
>
> > now when I run
>
> > `python web2py.py -T init/default/index`
>
> > produces my doctest.
>
>
I'm running the latest version, 1.75.4.
On Feb 23, 11:35 am, Thadeus Burgess wrote:
> What version of web2py are you running?
>
> What is the output of ``python web2py.py --help``
>
> -Thadeus
>
> On Tue, Feb 23, 2010 at 5:23 AM, Jon Romero wrote:
> > ust put a prin "Hello world!" inside the te
te database)
>
> > And if you want to use unittest
>
> > python web2py.py -S -M -R
> > /path/to/web2py/applications/yourapp/tests/testControllerA.py
>
> > Will execute the file inside of the web2py environment (with access to
> > database models as denoted
> The link you provided gives an example of using the unittest classes
> (not doctest), in which you can import anything you want since it is
> just a python file.
AlterEgo 213 (which Jon linked to) does not show how to get your
controllers to see your database models- the example code doesn't
int
e.dumps(value))
>
> a_list = MY_PICKLE.get("listkey")
>
> # do some stuff to list
>
> MY_PICKLE.save("listkey", a_list)
>
> -Thadeus
>
> On Wed, Feb 17, 2010 at 1:20 PM, spiffytech wrote:
> > I'm serializing with Pickle in my
I'm serializing with Pickle in my app, but it's a hassle to dump/load
the data every time I mess with it. Is there a way to make the
serializing happen automatically with DB access?
-Brian
On Feb 17, 1:46 pm, Carl wrote:
> thanks Jorge; most helpful in pointing me in the right direction.
>
> Th
Are there plans to make web2py write admin files to the BigTable
datastore instead of the filesystem on GAE?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to
52 matches
Mail list logo