[web2py] Re: new features and new book sections/chapters

2010-08-06 Thread Robin B
The docs look amazing, and web2py should get many more users as a result, nice work. Robin On Aug 6, 10:17 am, mdipierro wrote: > yes, thanks to Jonathan, Thadeus, Michele, Bruno, Sriram and all those > who are helping with revisions. > > Massimo > > On Aug 6, 10:12 am, Adi wrote: > > > > > Gre

[web2py] Re: Custom form renderings and attributes

2010-05-25 Thread Robin B
You might want to also take a look at Google's new Storage for Developers: http://code.google.com/apis/storage/ It is pretty much Google's clone of Amazon S3 storage, but with a nice web interface. Robin On May 15, 10:47 am, Oatman wrote: > Sorry to hijack the thread somewhat, but where can I

[web2py] Re: Running a script with Google App Engine

2010-05-25 Thread Robin B
Recently (05/19/10) the task queues execute during development: "Auto task execution is now enabled in the dev_appserver. To turn this off use the flag --disable_task_running." http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes Robin On May 11, 7:45 pm, Richard wrote: > > Does this

[web2py] Re: Is GAE worth using

2010-05-06 Thread Robin B
The 1000 result limit was removed in Feb when they added query cursors [1]. You can use the task queue to perform fault tolerant map reduce jobs [2]. Full text search should be announced this month at GoogleIO. [1] http://googleappengine.blogspot.com/2010/02/app-engine-sdk-131-including-major.h

[web2py] Re: read file in GAE?

2010-02-20 Thread Robin B
Yes GAE supports read-only access to 'application' files in production, that is how the view loader works. GAE handles static and application files separately. When your app is uploaded, the static files are pushed to a static file server and your application files are pushed to an application se

[web2py] Re: Validating Unique Database Entries Using GAE

2010-01-13 Thread Robin B
As a warning, querying before inserting does not guarantee uniqueness in the transactional sense. If 2 users try to add the same name at the same time, they will both insert and you will not have uniqueness. The only way to get transactional uniqueness on GAE is using a keyname and a transactiona

[web2py] Re: force login and register over https on GAE

2010-01-13 Thread Robin B
You don't need a route, you need a redirect. Check the path and scheme each request, and redirect to what you want. Robin On Jan 11, 2:44 am, JimK wrote: > Is it possible to setup a route that redirects all attempts to access > the login and register pages to https?  In other words, userA goes

[web2py:37471] Re: how to use GAE remote api?

2009-12-17 Thread Robin B
Since you already have the remote API and console working, it is easy to delete a table by name: Lets assume your web2py model was called 'person': >>> from google.appengine.ext import db >>> class person(db.Expando): pass >>> for p in person.all(): ... p.delete() >>> person.all().count(

[web2py:37370] Re: new DAL('gae')

2009-12-16 Thread Robin B
t least there > should not be. Yet I do not know how GAE is implemented and I have not > benchmarked it. > > Massimo > > On Dec 13, 11:17 pm, Robin B wrote: > > > IN is not magic, and evaluates1 db query for each member, and should > > be used carefully. >

[web2py:37148] Re: new DAL('gae')

2009-12-13 Thread Robin B
IN is not magic, and evaluates1 db query for each member, and should be used carefully. q3=(db.table.field.belongs(('value1','value2','value3'))) evaluates 3 db queries to get the result, Robin On Dec 13, 5:33 am, Richard wrote: > neat! I need to keep closer track of GAE developments ... > > O

[web2py:35379] Re: crazy crazy idea

2009-11-14 Thread Robin B
Massimo, This sounds like the Python ski trip that you have been looking for: http://www.coactivate.org/projects/snow-sprint-2010/project-home Robin On Nov 14, 6:44 pm, weheh wrote: > If you've never skiied in the US, then I recommend Utah. The snow is > the best. And access from the airport

[web2py:35206] Re: GAE caching

2009-11-12 Thread Robin B
Okay I updated the recipe to use memcache and cron to synchronize tasks and ensure exactly 1 task is ever active http://appengine-cookbook.appspot.com/recipe/hot-handler Robin On Nov 12, 4:26 pm, Robin B wrote: > > Robin, do you have any idea how we can make sure, that a new keep- >

[web2py:35205] Re: GAE caching

2009-11-12 Thread Robin B
> Robin, do you have any idea how we can make sure, that a new keep- > alive task only gets insertet, if the queue is empty? Unfortunately > there seems to be no method to query a task queue. I do not think you can read the queue length. Tasks will not be removed unless they receive a 200 http

[web2py:34886] Re: anybody seen this?

2009-11-08 Thread Robin B
You should also see this: http://www.extjs.com/deploy/dev/examples/desktop/desktop.html Robin On Nov 8, 1:02 am, mdipierro wrote: > Really nice. > > On Nov 7, 11:01 pm, Wes James wrote: > > > Massimo, > > > I thought I'd try some web2py with that site below: > > >http://db.nr.usu.edu/qpacn >

[web2py:34424] Re: full text search on GAE

2009-11-02 Thread Robin B
I have not tried it, but it looks safe to integrate because it should not result in 'exploding indexes' which was the main limitation of SearchableModel. Robin On Nov 2, 12:45 pm, mdipierro wrote: > a friend pointed me to this: > > http://www.billkatz.com/2009/6/Simple-Full-Text-Search-for-App-

[web2py:34400] Re: How to transfer gae database to local sqlite and vice versa?

2009-11-02 Thread Robin B
ect 1000 records for downloading. Sounds not > smooth, but it is the only way. :-/  Perhaps I shall consider using > other slicehost etc. m > > On Nov2, 10:15am, Robin B wrote: > > > Take a look at the appengine bulk loader: > > >http://code.google.com/appengine/doc

[web2py:34372] Re: How to transfer gae database to local sqlite and vice versa?

2009-11-01 Thread Robin B
Take a look at the appengine bulk loader: http://code.google.com/appengine/docs/python/tools/uploadingdata.html Once you have the data locally as csv, you can load it into a sql database by writing a script to import it into web2py. Robin On Oct 31, 10:48 pm, mdipierro wrote: > It works on GA

[web2py:34157] Re: GAE caching

2009-10-29 Thread Robin B
g itself and the entire web2py app gets cached? > > Massimo > > On Oct 30, 12:30 am, Robin B wrote: > > > Looks like google exponentially backs off a task when it fails, so > > here is a version that uses eta to schedule the next task 10s in the > > future. > > >

[web2py:34150] Re: GAE caching

2009-10-29 Thread Robin B
07 /_ah/queue/default 200 44ms 35cpu_ms 10-29 10:26PM 41.017 /_ah/queue/default 200 24ms 12cpu_ms Literally like clock work, a task hits your app once every 10 seconds. Robin On Oct 29, 11:47 pm, Robin B wrote: > I looked at the docs and came up with this code: > > ### some

[web2py:34149] Re: GAE caching

2009-10-29 Thread Robin B
On Oct 29, 10:16 pm, Robin B wrote: > > > > neat - now I get it. That's a nice hack! > > > Did you find that out from the Google App Engine group, or thought of > > > it yourself? > > > Thought of it myself. > > > Robin > > > On Oct 29, 12:

[web2py:34133] Re: GAE caching

2009-10-29 Thread Robin B
e Google App Engine group, or thought of > it yourself? > > Richard > > On Oct 29, 10:29 am, Robin B wrote: > > > > The docs say a task will run when resources are free. In your > > > experience do the tasks generally run on time? > > > Yes, they are tr

[web2py:34003] Re: GAE don't create table ?

2009-10-28 Thread Robin B
Your tables do not not show up until data is inserted because GAE does not create any tables, ever. It uses BigTable which stores your app's data and everyone else's app's data in 1 giant shared distributed table. There is only one table in appengine and it is BigTable, thus the name. When you

[web2py:34002] Re: GAE caching

2009-10-28 Thread Robin B
king the task queue to accomplish a specific goal of calling the task periodically since tasks can run much more frequently than cron which is necessary to keep a handler 'hot'. Robin > > Richard > > On Oct 28, 11:23 pm, Robin B wrote: > > > Oops typo: I said cron

[web2py:33911] Re: GAE caching

2009-10-28 Thread Robin B
cron be fast enough > (at 1/sec)? > Task queue is labelled experimental so I am wary to use it at the > moment. > > Richard > > On Oct 28, 4:13 pm, Robin B wrote: > > > > How long does it stay cached? > > > Inactive Python handlers used to last ~1 minute,

[web2py:33894] Re: GAE caching

2009-10-27 Thread Robin B
> How long does it stay cached? Inactive Python handlers used to last ~1 minute, recently it is closer to 15 seconds. Java servlets last longer, over a minute, maybe becuase they are so slow to boot (6 seconds +). One of the coming releases is supposed to speed up the cold boot times. Cron has

[web2py:33362] Autoretry Datastore Timeout Exceptions on GAE

2009-10-21 Thread Robin B
If you have been running an application on GAE in production, and you inspect your logs, you should have noticed spurious 'Datastore Timeout' exceptions resulting in HTTP 500 errors / tickets. These Timeouts are inherent to distributed systems like BigTable and can often be resolved by simply ret

[web2py:33158] Re: belongs() in GAE

2009-10-19 Thread Robin B
The equivalent for field.belongs('A','B','C') is like field=='A'|| field=='B'||field=='C' on GAE you can do AND (&&) but not do OR (||), so it can be done using 3 separate queries and append/unique the results. On GAE you need to think in terms of what query is cheap at request time, and merging

[web2py:33119] Re: I can not do "orderby=db.table.id" in GAE

2009-10-18 Thread Robin B
GAE now has support for query and orderby id, but nobody has exposed it to the DAL yet! If you do a search for "__key__" on the web2py mailing list, you can see that I have pointed this out over 3 times. http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Queries_on_Key

[web2py:33020] Re: Cron table deletion on GAE

2009-10-16 Thread Robin B
ask Queue above at least this way you can do it slowly > and not eat up to much CPU time.  In the future I hope to upload new > data first, and then slowly delete old data to avoid having to buy > extra CPU time. > > On Oct 15, 3:30 pm, Robin B wrote: > > > You could look at

[web2py:32963] Re: db rollback on GAE

2009-10-15 Thread Robin B
If you need to use a transaction, you could still do it using web2py: from google.appengine.ext import db as gaedb def txn(): counter = db.counters[cid] if counter: counter.update_record(count = counter.count+1) return counter counter = gaedb.run_in_transaction(txn) print co

[web2py:32962] Re: Cron table deletion on GAE

2009-10-15 Thread Robin B
You could look at the task queue to build a more dynamic version of what you are doing with cron polling. Also tasks can execute in parallel, so instead of 30,000/200 units of time to delete, you can do (30,000/200)/N where N is the level of concurrency you set for your task queue. Robin On Oct

[web2py:32344] Re: Google app engine retrieve data from related table

2009-10-06 Thread Robin B
If you want to keep it normalized, and the intersection is less than 1000 entities, and joined by a primary key (ID), use a batch get, to fetch all the join items in parallel. If you are going to de-normalize, take a look at google ListProperty. Robin On Oct 6, 9:59 am, "Michael - afewtips.com"

[web2py:32253] Re: can't access 'id' field when running GAE dev_appserver

2009-10-05 Thread Robin B
GAE has added a feature so you can query by id or keyname (using __key__), it is not implemented in DAL yet. http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Queries_on_Keys Robin On Oct 5, 8:07 am, mdipierro wrote: > GAE is very weird. It does allow queries that

[web2py:32228] Re: GAE Tutorial to Web2py

2009-10-04 Thread Robin B
Try not checking for 'POST' or chat, to see if there is a problem with those checks: def message(): import logging message = request.vars logging.debug(str(message)) from google.appengine.api import xmpp user_address = 'chrisjmurr...@gmail.com' xmp

[web2py:32172] Re: GAE Tutorial to Web2py

2009-10-03 Thread Robin B
, murray3 wrote: > > > this is just a test of your code: > > >http://testhogg.appspot.com/init/default/sendhttp://testhogg.appspot > > > i guess you just browse to /send and then browse to /chat which asks > > for login > > but prints "none" > > > also

[web2py:31969] Re: app engine data model best practices

2009-09-30 Thread Robin B
> One entity group per web2py object, lack of list property support, > etc. dooms the current implementation to "small" web sites. If db.py > has no tables, will the "Web2py also re-evaluates your model > definition" overhead vanish? Yes, and to be practical, there is not much overhead. I was t

[web2py:31944] Re: app engine data model best practices

2009-09-30 Thread Robin B
request, but then you only rebuild the models that you actually use for each request, which is ideally no models for a cached response. Robin On Sep 30, 1:08 pm, mdipierro wrote: > On Sep 30, 1:01 pm, Robin B wrote: > > > > so i guess the next question is, do i have anything

[web2py:31929] Re: app engine data model best practices

2009-09-30 Thread Robin B
> so i guess the next question is, do i have anything to worry about > when using web2py on app engine per data model efficiency? I am not sure what you are asking exactly. If you use several tables and references, without list properties and batch get, you would see the N+1 query problem de-re

[web2py:31912] Re: app engine data model best practices

2009-09-30 Thread Robin B
> Massimo or anyone familiar with app engine, i am beginning development > with bot app engine and web2py and have reviewed much of the google io > videos especially those by bret slatkin regarding how to work with the > app engine datastore properly. I hope but am guessing it is probably > not th

[web2py:31775] Re: migrating to GAE questions

2009-09-27 Thread Robin B
to gql.py and add any other features they need. Robin On Sep 27, 10:51 pm, mdipierro wrote: > On Sep 27, 9:50 pm, Robin B wrote: > > > > exactly. To get optimized code on both platforms I currently need to > > > use: > > > > if request.env.web2py_runtime_gae:

[web2py:31773] Re: migrating to GAE questions

2009-09-27 Thread Robin B
> exactly. To get optimized code on both platforms I currently need to > use: > > if request.env.web2py_runtime_gae: > records = [db.test[id] for id in test_ids] > else: > records = db(db.test.id.belongs(test_ids)).select() > > So what I am suggesting is the DAL support "belongs" for GAE b

[web2py:31751] Re: migrating to GAE questions

2009-09-27 Thread Robin B
> I get an error for orderby=~db.test.field - is it just reverse order > that is not supported? I didn't see this mentioned in the manual. Reverse order is supported, orderby=~db.test.field, orders descending where 'field' is a field in your table. eg. orderby=~db.test.title to order by title fi

[web2py:31738] Re: migrating to GAE questions

2009-09-26 Thread Robin B
On Sep 26, 11:20 pm, Richard wrote: > I have been playing with GAE for the first time and found using it > with web2py a pleasure. web2py and GAE are a killer combination! > > A few questions: > > How do you order your items? Currently I am selecting and then sorting > in Python manually. You

[web2py:31733] Re: GAE Tutorial to Web2py

2009-09-26 Thread Robin B
es.py. Robin On Sep 26, 6:32 pm, mdipierro wrote: > Nice Robin, > why split it over two apps (init and _ah)? > > On Sep 26, 6:17 pm, Robin B wrote: > > > how about something like this: > > > To send: > > applications/init/controllers/default.py: > > > de

[web2py:31730] Re: GAE Tutorial to Web2py

2009-09-26 Thread Robin B
sic skeleton app for this to get us started? > chrism > > On Sep 24, 5:44 am, Robin B wrote: > > > If you port it to web2py, then you don't need to wrap their handler, > > unless I am misunderstanding. > > > All that has to built a web2py controller function th

[web2py:31589] Re: GAE Tutorial to Web2py

2009-09-23 Thread Robin B
nderstand how to wrap the handler so that I > can be called from a controller function. We could make a wsgi_adaptor > inside the controller but there has to be a better way. > > On Sep 23, 3:57 pm, Robin B wrote: > > > Yes, > > > I believe the url  ('/_ah/x

[web2py:31566] Re: GAE Tutorial to Web2py

2009-09-23 Thread Robin B
it should be possible to rewrite the entire example as a web2py > application. Is there specific significance it the URL names ('/_ah/ > xmpp/message/chat/') used in the example? Because preserving those > would require roots. > > Massimo > > On Sep 23, 2:25 pm, Robin

[web2py:/] Re: GAE Tutorial to Web2py

2009-09-23 Thread Robin B
t; Robin On Sep 23, 8:01 am, mdipierro wrote: > What's a IM field? > > On Sep 22, 10:13 pm, Robin B wrote: > > > You can edit app.yaml to dispatch requests to those xmpp handlers > > based on prefix (/_ah/*), and let web2py handle everything that's left > >

[web2py:31504] Re: GAE Tutorial to Web2py

2009-09-22 Thread Robin B
You can edit app.yaml to dispatch requests to those xmpp handlers based on prefix (/_ah/*), and let web2py handle everything that's left (/*) Or you can rewrite those handlers as web2py controller/functions and use routes.py to map the specific urls to app/controller/function Robin On Sep 22, 5

[web2py:31383] Re: How mature is DAL's GAE support

2009-09-20 Thread Robin B
ot be used because it is O (n) and also does not work beyond 1000 rows. Robin On Sep 20, 12:54 pm, notcourage wrote: > Are you implying that the GAE DAL could profit from new exceptions for > BigTableDownForMaintenance & BigTableTimeOut? > > On Sep 19, 11:12 am, Robin B wrote: >

[web2py:31363] Re: GAE Uploading data.

2009-09-19 Thread Robin B
n as to how I go about that?  With the 1000 entity limit on > selects I'm trying to think now how to best find only duplicates. > Unfortunately I didn't put any 'time' variables in the table.  I'm > open to suggestions. > > On Sep 19, 8:02 pm, Robin B wrote:

[web2py:31343] Re: GAE Uploading data.

2009-09-19 Thread Robin B
ve the entries, you might instead create a brand new table with a different name somehow. > > Thanks for pointing out where I can find info on what the web2py > fields translate to in datastore terms.  That will help me insure I > don't have an issue with that in the future. > W

[web2py:31334] Re: GAE Uploading data.

2009-09-19 Thread Robin B
> Looking over two tables here are the things I've identified as > possible problems: > 1 - This table has a 'double' in it. Not just int/string like the > working one. For GAE uploading I defined the double field as a GAE > "float" property. Is it possible web2py defines a 'double' as > someth

[web2py:31328] Re: gae: gluon undefined

2009-09-19 Thread Robin B
gae, debug) = \ ('gae:production', True, False) Robin On Sep 19, 8:19 am, notcourage wrote: > Is there a variable which distinguishes dev & production for gae? It > would simplify deployment. > > On Sep 18, 3:46 pm, Robin B wrote: > > > To s

[web2py:31326] Re: How mature is DAL's GAE support

2009-09-19 Thread Robin B
The GAE DAL does not try to handle the 1000 fetch limit. GAE apps must be designed differently, meaning if you need more than 1000 results from a query, then probably what you were attempting to do is not scalable. Queries are O(#results), so you should keep your queries small to make your reque

[web2py:31289] Re: gae: gluon undefined

2009-09-18 Thread Robin B
To send mail locally, you need to specify the mail server to be used: http://code.google.com/appengine/docs/python/tools/devserver.html#Using_Mail Robin On Sep 17, 11:02 pm, notcourage wrote: > I can send email after deploying to gae but not in the dev env. --~--~-~--~~

[web2py:31235] Re: gae: gluon undefined

2009-09-17 Thread Robin B
Install Python 2.5 (GAE requires 2.5) and try again. Robin On Sep 17, 5:14 pm, notcourage wrote: > I'm using Vista. > > create c:\swe\notcourage-guestbook folder > extract webpy here (don't run web2py.py) > edit app.yaml > create applications folder here > create init folder here > copy my app'

[web2py:30643] Re: get random record efficiently

2009-09-10 Thread Robin B
machine, and you can iterate over all rows and ensure they have a float random field. Robin On Sep 10, 1:11 am, Richard wrote: > neat! > > On Sep 10, 3:32 pm, Robin B wrote: > > > On GAE, the default ordering depends on which index is needed to > > answer the query, and it

[web2py:30580] Re: get random record efficiently

2009-09-09 Thread Robin B
On GAE, the default ordering depends on which index is needed to answer the query, and it is stable, so it is non-random. To get random rows on GAE, I use a float field called random, which is assigned a float from 0 and 1, then to pull random rows, I just generate a random float and query by tab

[web2py:29132] Re: web2py, bigtable and the '09 DAL

2009-08-22 Thread Robin B
You can access the 'table._tableobj' which is the generated GAE Model object, however this is not a public interface and not subject to backwards compatibility. Posts = db['posts']._tableobj Posts.get_by_id(long(id)) Robin On Aug 21, 3:45 am, dlypka wrote: > Here are my GAE DALnr snippets. >

[web2py:26075] Re: Is it possible to store documents in S3 and rest in Google App Engine?

2009-07-09 Thread Robin B
> Assuming this can be done... are we sure that accessing S3 via REST > from GAE does not exceed the time limit? If I remember correctly, you can stream uploads directly to S3, which bypasses GAE and avoids any timeout. So from GAE, at request time, you ask S3 for a unique upload url, then POST

[web2py:23516] Re: Index Error on GAE

2009-06-07 Thread Robin B
cts". > > > Is it a bug? > > > Thanks! > > > Tito > > > On Sun, Jun 7, 2009 at 11:18 AM, Tito Garrido wrote: > > > Thank you folks, > > > > I'll try appcfg.py update_indexes myapp/ to test... localy it works > > > perfectly. >

[web2py:23460] Re: Index Error on GAE

2009-06-06 Thread Robin B
The easiest way to fix this is to exercise your app on the development server, (use the query that needs that missing index) which will add the missing index to the generated index.yaml. The next time you update/deploy your index.yaml to production, GAE will 'build' the new index which takes time

[web2py:20776] Re: help on GAE

2009-04-28 Thread Robin B
To add the email/password, try these switches with appcfg.py: --email=... --passin http://code.google.com/appengine/docs/python/tools/uploadinganapp.html#Command_Line_Arguments Robin On Apr 28, 5:03 pm, mdipierro wrote: > would somebody be able to send a piece of Python code to > programmatic

[web2py:19810] Re: Poor performance on GAE

2009-04-15 Thread Robin B
I am also not happy with the CGI performance of GAE. Some interesting numbers: welcome/default/index: cold request time: ~1500ms warm request time: ~150ms (about 1/10 time of a cold request) a warm process is reaped in just *60 sec* if there is no activity. If you have a low activity site, w

[web2py:19778] Re: Poor performance on GAE

2009-04-14 Thread Robin B
Some ideas: There is a log_stats decorator in gaehandler.py that can be uncommented and enabled in production to give a more precise timing profile than the log coarse timing. The main caching mechanism is in compileapp.py and the compiled code should be cached in a dict called 'cfs' which can b

[web2py:19681] Re: GAE help

2009-04-13 Thread Robin B
> it detects GAE it will cache bytecode compiled models and actions. I > just tried and it works. > > Massimo > > On Apr 13, 10:09 am, Robin B wrote: > > > Looks good, but I tried inspecting 'cfs' to verify that it is caching > > the ccode: > > > in c

[web2py:19667] Re: GAE help

2009-04-13 Thread Robin B
ot;"" Request: %.2fms/%.2fms (real time/cpu time)""" Robin On Apr 13, 12:07 am, mdipierro wrote: > OK. done. check the trunk and let me know what you think. I am also > reposting this as 1.61 for now because 1.60 may be broken on GAE. > > Massimo > >

[web2py:19614] Re: GAE help

2009-04-12 Thread Robin B
. Please give it a try. If the imp.get_magic > works on gae then web2py may have been slower on GAE that it is > supposed to be. This should fix it. > > Massimo > > On Apr 11, 7:59 pm, Robin B wrote: > > > I am not sure if that is true or not. > > > To test for G

[web2py:19604] Re: GAE help

2009-04-11 Thread Robin B
I am not sure if that is true or not. To test for GAE, I would set 'is_gae' to True in gaehandler.py to achieve fool-proof detection. To detect production/debug on GAE, I use this in 0.py: response.debug = os.environ.get('SERVER_SOFTWARE','').startswith ('Devel') Robin On Apr 11, 2:59 pm, mdi

[web2py:19291] sample of application routes.py

2009-04-06 Thread Robin B
I thought it would be cool to have a routes.py for each application, so I put the following in web2py/routes.py, which combines the routes from each application/*/routes.py at boot time. web2py/routes.py: from gluon.fileutils import listdir import os,glob apps_with_routes = [] app_routes = glob.

[web2py:17514] Re: Does web2py support memcached as a session store ?

2009-03-04 Thread Robin B
No one has published a 'RAMDB' (a DAL driver for RAM). It could easily be implemented as a global dict, and it could be useful for say caching, but I would not put sessions into ram for production. If you have more than 1 application server/process, you will not be able to share sessions between

[web2py:17483] Re: Does web2py support memcached as a session store ?

2009-03-04 Thread Robin B
I have been using MEMDB to store sessions in memcache since August 2008: http://groups.google.com/group/web2py/browse_thread/thread/cd89f11de4d23b53/f67faac66a695ca2?hl=en&lnk=gst&q=memdb#f67faac66a695ca2 the code is under contrib: from gluon.contrib.memdb import * from google.appengine.api.mem

[web2py:17364] Re: Admin under GAE SDK?

2009-03-02 Thread Robin B
If you need an ORM, you can wrap the DAL inside an ORM. I believe that is how SQLAlchemy works (models and schemas). That way your ORM gets the benefit of DAL abstraction. If you can design a usable ORM model that wraps the DAL, others might also be interested. Web2py is built in layers, the D

[web2py:17363] Re: sharding counters

2009-03-02 Thread Robin B
You must use transactions to atomically increment any counter shard. Web2py does not have transactions yet, so just use google models for the sharded counters, and increment/sum them inside/after form.accepts (). Robin On Mar 2, 6:11 pm, Jim wrote: > In the first message, I give a reference to

[web2py:17043] Re: GAE: datatime inequality filters strange behaviour !

2009-02-26 Thread Robin B
The obj_represent/datetime code was modified after 1.56.2. I would check if this problem is present in 1.56.2 and if the gql.py doctests still pass on trunk. Robin On Feb 26, 10:21 am, mdipierro wrote: > I missed the part where you said this problem was on GAE. > > Robin? Do you have anything

[web2py:16804] Re: web2py on gae - errors & questions

2009-02-23 Thread Robin B
It looks like a problem converting datetimes to/from strings? Robin On Feb 23, 9:21 am, mdipierro wrote: > Robin, > > what is the bug? > > Massimo > > On Feb 23, 9:04 am, Robin B wrote: > > > Looks like the type coercion code was last modified in r725. > &

[web2py:16797] Re: New Appliance Submission: QrOne CSS Designer

2009-02-23 Thread Robin B
To really fix this, requires runtime configuration, but web2py does not have configuration, so the down side is that configuration is sprinkled throughout the app with if/else, try/except, comment/ uncomment. I agree that a standard configuration would be more maintainable. Robin On Feb 23, 9:0

[web2py:16795] Re: web2py on gae - errors & questions

2009-02-23 Thread Robin B
Looks like the type coercion code was last modified in r725. http://code.google.com/p/web2py/source/diff?spec=svn743&r=725&format=side&path=/trunk/gluon/contrib/gql.py&old_path=/trunk/gluon/contrib/gql.py&old=718 If the bug is not in 1.56.2, try using 1.56.2 until this can be fixed/ patched. Ro

[web2py:16617] Re: DAL subset supported by GAE

2009-02-20 Thread Robin B
, 11:13 am, "Sebastian E. Ovide" wrote: > On Fri, Feb 20, 2009 at 12:36 AM, Robin B wrote: > > > I have the transactions working, but it is not fully compatible with > > web2py DAL, but it could be soon ( needs type coercion, db.table.ALL, > > etc)  Also in

[web2py:16593] Re: New Appliance Submission: QrOne CSS Designer

2009-02-19 Thread Robin B
I think this is very well done. The autoupdating gives instant feedback. To get it working on appengine, I had to add: models/0.py: session.forget() Because web2py was trying to write sessions to the filesystem. Congratulations on releasing this great tool! Robin On Feb 19, 2:51 pm, black

[web2py:/] Re: DAL subset supported by GAE

2009-02-19 Thread Robin B
; > is there any schedule for the GAE transactions/entity groups ? > > if not, how would it be the best way (web2py upgrades compatible !) to > use entity groups and transaction with web2py ? > > thanks > > On Jan 19, 2:59 pm, Robin B wrote: > > > > Groups

[web2py:16499] Re: SearchableModel App engine

2009-02-18 Thread Robin B
SearchableModel is workable as long as you have 1 or at most 2 words in the search, otherwise the indexes 'explode' in size. You should be able to mark a field as non-indexed, and non-ascii fields should be non-indexed by default. If there were some doctests, this could be added to gql.py. Robi

[web2py:16265] Re: GAE bug ?

2009-02-12 Thread Robin B
> r=db(db.cas_user.id==id).select() #OK > r=db(db.cas_user.verification==key).select() #OK > r=db(db.cas_user.id==id)(db.cas_user.verification==key).select() #OK > but not on GAE Google added query/sort by id in a recent SDK release, and the new GAE driver that I am writing supports it, so this q

[web2py:16137] Re: gluon.utils

2009-02-10 Thread Robin B
it in > gluon.tools > > Massimo > > On Jan 30, 1:20 pm, Robin B wrote: > > >web2py.urlfetch, works on every platform :) > > > Robin > > > On Jan 30, 1:13 pm, mdipierro wrote: > > > > make a proposal. It is not easy to auto-detect gae since y

[web2py:16136] Re: 1.56.1 on GAE error 'SQLQuery' object has no attribute 'left'

2009-02-10 Thread Robin B
-with-google-app-engine Robin On Feb 10, 2:30 am, ANDROSoft wrote: > This error exist only in itemize and when items in table must be > paginated. When i set nitems>count(items in table) everything is > working. Search form is working ok. > > On Feb 9, 1:28 pm, Robin B wrote

[web2py:16111] Re: GAE: sql bug

2009-02-09 Thread Robin B
I think you are misunderstanding the error message. BadValueError: Property size must be a float The error message is saying you must pass in a 'float'ing point number, and 0 is not a floating point number. # This does not work gdb = GQLDB() gdb.define_table('potato',gdb.Field('size','double',d

[web2py:16077] Re: RFC: table select/delete, limitby=num

2009-02-09 Thread Robin B
And its fully transactional when you pass callable args, all the drivers will get it for free because it is not done at the driver level. Robin On Feb 8, 3:46 pm, Robin B wrote: > I think in SQL you can use '|' to generate each in 1 query. > > Robin > > On Feb 8, 3:44 pm, mdip

[web2py:16066] Re: 1.56.1 on GAE error 'SQLQuery' object has no attribute 'left'

2009-02-09 Thread Robin B
It appears like it is trying to call str(query) where the query does not have a left operator. what happens if you change this: gql.py:591: def __str__(self): return str(self.left) to this: gql.py:591: def __str__(self): return str(getattr(self,'left','')) Robin On Feb

[web2py:16047] Re: alternative way to import modules

2009-02-08 Thread Robin B
Robin On Feb 8, 5:48 pm, mdipierro wrote: > should this be in web2py? Pros/cons? > > Massimo > > On Feb 8, 5:38 pm, Robin B wrote: > > > Here is another version of mod_import() that does not use string > > splitting: > > > def mod_import(name): > >

[web2py:16042] Re: alternative way to import modules

2009-02-08 Thread Robin B
ot; wrote: > Ooooh! starting to look yummy...  :-) > > On Thu, Jan 8, 2009 at 1:04 PM, Robin B wrote: > > > > def mod_import(name,request=None): > > >   if request: name='applications.%s.modules.%s' % > > > (request.application, name) > >

[web2py:16036] Re: RFC: table select/delete, limitby=num

2009-02-08 Thread Robin B
I think in SQL you can use '|' to generate each in 1 query. Robin On Feb 8, 3:44 pm, mdipierro wrote: > In principle I am for all of these but I am not sure they can be > implemented easily in SQL without loops. Can they? > > On Feb 8, 3:39 pm, Robin B wrote: > &g

[web2py:16033] RFC: table select/delete, limitby=num

2009-02-08 Thread Robin B
We could add select and delete to tables and limitby could have a shortcut: instead of: (db.posts.id>0).select(orderby=~db.posts.created_at,limitby=(0,10)) how about: db.posts.select(orderby=~db.posts.created_at, limitby=10) batch get: db.posts.select([3,5,9]) and delete could also accept kwar

[web2py:15987] Re: joins between database drivers

2009-02-07 Thread Robin B
7;posts') posts._tablename -> '_shared__posts' Robin On Feb 7, 12:03 pm, Robin B wrote: > Namespaces can also be generalized by unifying under the DAL: > > dal = DAL() > dal.define_namespace('app',request.application) > dal.define_namespace(

[web2py:15986] Re: joins between database drivers

2009-02-07 Thread Robin B
7;gaedb','google') dal.shared.gaedb.define_table('posts',dal.Field('title')) db = dal.shared.gaedb db.posts._tablename -> '_shared__posts' Robin On Feb 7, 11:40 am, Robin B wrote: > And what about this: > > dal = DAL() > dal.define_database

[web2py:15985] Re: joins between database drivers

2009-02-07 Thread Robin B
isk = CacheClient(db=dal.fsdb) @cache(request.env.path_info,time_expire=5,cache_model=cache.mem) def cache_controller_in_ram(): import time t=time.ctime() return dict(time=t,link=A('click me',_href=URL(r=request))) Robin On Feb 7, 11:25 am, Robin B wrote: > I am implement

[web2py:15984] joins between database drivers

2009-02-07 Thread Robin B
I am implementing the joins on GAE, and I realized that you should be able to perform joins between DAL databases whether it is the same driver or not. fsdb = FSDB(...,name='fsdb') gaedb = GAEDB(...,name='gaedb') rows = ((gaedb.users.name=='bob')& (gaedb.users.id==fsdb.users.id)).select(fsdb.use

[web2py:15983] Re: RFC: DAL transactions

2009-02-07 Thread Robin B
On Feb 7, 9:11 am, mdipierro wrote: > I assume this is in your latest patch. I will try apply it during the > week-end. > > On Feb 7, 8:39 am, Robin B wrote: > > > update() and update_record() should accept callables: > > > def txn(record): > >   attrs

[web2py:15977] RFC: DAL transactions

2009-02-07 Thread Robin B
update() and update_record() should accept callables: def txn(record): attrs = {} if record.name == 'bob': attrs['count'] = record.count + 1 elif record.name == 'alice': attrs['count'] = record.count - 1 return attrs #complex transactions (db.posts.id>0).update(txn) # simple tra

[web2py:15722] Re: Migrate and GAE

2009-02-01 Thread Robin B
uestions: > > Isn't the plan to do away with gql.py? > > Does the query class encapsulate sql or is it a different syntax? (I > know I'm being lazy here I will look it up) > > On Feb 1, 10:29 pm, Robin B wrote: > > > Yes it is ignored. > > > Some of the

  1   2   3   >