[web2py] How to create a new DAL connection?

2012-09-16 Thread spiffytech
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(

Re: [web2py] Re: Major speed improvement need testers

2012-08-22 Thread spiffytech
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

[web2py] Re: whats the state of NoSQL in web2py 2.0

2012-08-20 Thread spiffytech
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')

[web2py] Re: Is copying request.env in LOAD() reliable?

2012-08-20 Thread spiffytech
> > 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

[web2py] Re: Route to static file fails on App Engine

2012-08-19 Thread spiffytech
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

[web2py] Is copying request.env in LOAD() reliable?

2012-08-19 Thread spiffytech
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

[web2py] Route to static file fails on App Engine

2012-08-17 Thread spiffytech
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

Re: [web2py] Re: Model-less approach should be standadized in web2py in future releases ...

2012-08-15 Thread spiffytech
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

[web2py] Re: DAL belongs() fails on App Engine

2012-08-14 Thread spiffytech
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

[web2py] Re: DAL belongs() fails on App Engine

2012-08-12 Thread spiffytech
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

[web2py] Re: DAL belongs() fails on App Engine

2012-08-12 Thread spiffytech
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

[web2py] Re: DAL belongs() fails on App Engine

2012-08-09 Thread spiffytech
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. >

[web2py] DAL belongs() fails on App Engine

2012-08-09 Thread spiffytech
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

[web2py] Re: web2py on appfog

2012-08-03 Thread spiffytech
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

[web2py] Re: web2py on appfog

2012-07-28 Thread spiffytech
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

[web2py] Re: Want to create pop-up ad app

2012-07-15 Thread spiffytech
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

[web2py] Re: Scheduler: help us test it while learning

2012-07-15 Thread spiffytech
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

[web2py] Re: Scheduler: help us test it while learning

2012-07-14 Thread spiffytech
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

[web2py] Re: routes_out to put static scripts on a subdomain

2012-07-14 Thread spiffytech
; > 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

[web2py] routes_out to put static scripts on a subdomain

2012-07-14 Thread spiffytech
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 = (

[web2py] Re: DAL speed - an idea

2012-03-09 Thread spiffytech
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

[web2py] Re: The Winners! Web2py Application Exhibition Version 3.0

2012-03-08 Thread spiffytech
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

Re: [web2py] Re: Sporadic ImportError with custom module

2012-03-07 Thread spiffytech
> > "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

[web2py] Re: web2py 1.99.7 is OUT

2012-03-05 Thread spiffytech
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

[web2py] Re: Last Day for Submissions! -- Web2py Application Exhibition Version 3.0

2012-03-05 Thread spiffytech
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

[web2py] Sporadic ImportError with custom module

2012-02-24 Thread spiffytech
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

[web2py] Re: Application-wide exception handler?

2012-01-15 Thread spiffytech
      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

[web2py] Application-wide exception handler?

2012-01-13 Thread spiffytech
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

[web2py] Re: working slower than PHP on shared hosting

2011-12-29 Thread spiffytech
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

[web2py] Re: newbie: How to match REST URL and extract path params

2011-12-22 Thread spiffytech
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

[web2py] Re: web2py for freelance work

2011-07-31 Thread spiffytech
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

[web2py] web2py for freelance work

2011-07-25 Thread spiffytech
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

[web2py] Re: Creating a many-to-many form with arbitrary number of fields

2011-04-12 Thread spiffytech
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

[web2py] Creating a many-to-many form with arbitrary number of fields

2011-04-11 Thread spiffytech
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

[web2py] Escape JSON vars without escaping JSON control characters

2010-12-13 Thread spiffytech
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

[web2py] Re: StackExchange for web2py community

2010-09-17 Thread spiffytech
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

[web2py] Re: Where do you use web2py?

2010-03-12 Thread spiffytech
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.

[web2py] Re: Unit testing in web2py : Some thoughts

2010-03-02 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-25 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-25 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-25 Thread spiffytech
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! > > >&

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-25 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-25 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-25 Thread spiffytech
#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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread spiffytech
["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:

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread spiffytech
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. > >

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-23 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-23 Thread spiffytech
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

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-22 Thread spiffytech
> 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

[web2py] Re: storing a Python list

2010-02-17 Thread spiffytech
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

[web2py] Re: storing a Python list

2010-02-17 Thread spiffytech
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

[web2py:30971] Re: Google Apps wep2py applications

2009-09-14 Thread spiffytech
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