Re: [google-appengine] How to calculate the size of an EmailMessage

2010-06-04 Thread Andi Albrecht
You can manually convert it to a mime message (even though it's not documented and there may be some other pitfalls): >>> from google.appengine.api import mail >>> msg = mail.EmailMessage(sender="f...@example.com", to=["b...@example.com", "b...@example.com"], subject="foo", body="bar") >>> print l

Re: [google-appengine] how to view all keys in memcache?

2010-07-05 Thread Andi Albrecht
The actual instances are serialized when stored in memcache and deserialized when retrieved from the cache. What you're seeing is a different instance ID (as returned by id(myobj)) since a new object is created. But the state of your Stock.IndexSet instance should be the same before storing in memc

Re: [google-appengine] question about gae database

2010-07-06 Thread Andi Albrecht
Assuming that you mean None with null your query to return the 296 entities should look like q = Joke.all() q.filter('content =', None) # <-- None without quotes! Andi On Tue, Jul 6, 2010 at 3:13 PM, xinxin zhou wrote: > class Joke(db.Model): >   url = db.TextProperty() >   content = db.String

Re: [google-appengine] get all child from one parent given

2010-07-10 Thread Andi Albrecht
You can run a kindless query: see http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Kindless_Ancestor_Queries Regards, Andi On Sat, Jul 10, 2010 at 10:59 AM, alf wrote: > how can i get all child from one entity parent given. thinking that > child can be in several ki

Re: [google-appengine] users.get_current_user() returning None for https requests

2010-07-13 Thread Andi Albrecht
It's not clear from your message if you login again before accessing your https URLs or if you just change the protocol part of the URL from http to https (i.e. adding a "s") or do you login again before hitting your URL using https? The cookie you'll receive for http isn't valid for your https UR

Re: [google-appengine] Re: I can see some of my source code files with Appstats

2010-07-29 Thread Andi Albrecht
On Thu, Jul 29, 2010 at 1:38 PM, bFlood wrote: > I'm pretty sure only admins can see appstats but if that's not enough, That's right. According to the appstats docs only admins should be able to see the appstats web interface and the source code of your files: http://code.google.com/appengine/do

Re: [google-appengine] Having lots of DeadlineExceeded errors on instance startup

2010-08-31 Thread Andi Albrecht
Tim Hoffman writes: > Hi > > As of today I am getting a lot of DeadlineExceeded Errors on a couple > of instances druing startup. > > I am not even getting past the initial imports, > > Nothing is being reported in system status, so it's probably > restricted part of the appengine structure. > >

Re: [google-appengine] Re: Having lots of DeadlineExceeded errors on instance startup

2010-08-31 Thread Andi Albrecht
ing them on and off, everything might be fine for 20min, > then bam. > I have even been having some dashboard failures. > > T > > On Sep 1, 1:55 pm, Andi Albrecht wrote: >> Tim Hoffman writes: >> > Hi >> >> > As of today I am getting a lot of DeadlineExceede

Re: [google-appengine] Re: Retrieving a users Google Talk Status

2010-09-30 Thread Andi Albrecht
On Thu, Sep 30, 2010 at 9:31 PM, Darien Caldwell wrote: > xmpp.get_presence() > > http://code.google.com/appengine/docs/python/xmpp/functions.html But this will only work if the users is "subscribed" to an app: http://code.google.com/appengine/docs/python/xmpp/overview.html#Invitations > > -- >

[google-appengine] Best way to disable settings from appengine_config during tests

2011-10-29 Thread Andi Albrecht
Hi all, I have set up local unit tests for a Python app according to the documentation on the App Engine site [1]. The app has appstats configured as a WSGI middleware through appengine_config.py by using the webapp_add_wsgi_middleware() directive: def webapp_add_wsgi_middleware(app): app = rec

Re: [google-appengine] Best way to disable settings from appengine_config during tests

2011-10-30 Thread Andi Albrecht
That's an interesting idea. I'd just do it the other way round and add appstats only iff APPLICATION_ID doesn't starts with 'test-' since I'm already setting this prefix when setting up the test environment. Thanks! Andi -- You received this message because you are subscribed to the Google Gr

[google-appengine] Announcing gae2django - a helper to port App Engine applications to Django

2008-10-03 Thread Andi Albrecht
I'm pleased to announce a Django helper application that ease the process of porting App Engine applications to pure Django. The "gae2django" helper application provides a Django based implementation of the App Engine APIs and it's aim is to minimize the effort of porting your App Engine applicat

Re: [google-appengine] What is wrong with my URL mapping? (app.yaml)

2010-01-21 Thread Andi Albrecht
On Thu, Jan 21, 2010 at 8:32 AM, hyn wrote: > What I'm trying to do is very simple... point /users/registration/.* > to users.py. > In users.py, I have: > > webapp.WSGIApplication([('/', RegistrationHandler)], debug = True) This doesn't match the actual URL that should be processed by your users.

Re: [google-appengine] How to get User when running Task Queue

2010-02-22 Thread Andi Albrecht
On Mon, Feb 22, 2010 at 8:17 PM, Ikai L (Google) wrote: > D'oh, I just realized this is a shorthand for "something". > > On Mon, Feb 22, 2010 at 11:17 AM, Ikai L (Google) wrote: > >> What is STH? Task Queues cannot get the current User, this will only work >> for web requests. You'll need to save

Re: [google-appengine] Re: What is wrong with my URL mapping? (app.yaml)

2010-03-03 Thread Andi Albrecht
On Tue, Mar 2, 2010 at 8:13 PM, Pydevil wrote: > i tried as you wrote here... and it doesn't work for me > app.yaml: > handlers: > - url: /scripts/.* > script: vtip.py > - url: /.* > script: main.py > > vtip.py: > application = webapp.WSGIApplication([('/scripts/.*', MainHandler)], >

Re: [google-appengine] Google App Engine Django

2010-03-17 Thread Andi Albrecht
This seems to be fixed in r102 ( http://code.google.com/p/google-app-engine-django/source/detail?r=102) Andi On Wed, Mar 17, 2010 at 6:03 AM, Robert wrote: > I installed the helper r100, typed python manage.py runserver, and > received. > > /usr/local/google_appengine/google/appengine/api/ > da

Re: [google-appengine] Google App

2010-03-17 Thread Andi Albrecht
There was another post mentioning the same problem, but with a bit more information than just a plain traceback... The ipaddr dependency was added to the helper in revision 102. It should work when you update the App Engine helper. Andi On Wed, Mar 17, 2010 at 5:59 AM, Robert wrote: > python ma

Re: [google-appengine] Transaction not Atomic

2010-04-23 Thread Andi Albrecht
Are you sure that you're not working on a parent model, that's somehow cached and therefore out-dated when you start one of those "non-atomic" transactions? Just a guess... Regards, Andi 2010/4/23, Felix E. Klee : > I may sound like an idiot for writing this, and I hope I am, but: > > Occasiona

[google-appengine] Re: Testing GAE application best practices

2009-07-03 Thread Andi Albrecht
Hi Michael, thanks for the explanations on how you do the testing. I assume you've grabbed the Rietveld test cases you've mentioned from the testing branch? A few days ago I've tried something similar to get the Rietveld tests running again. I've stripped the relevant parts of the App Engine Pat

[google-appengine] Re: Testing GAE application best practices

2009-07-03 Thread Andi Albrecht
On Fri, Jul 3, 2009 at 2:18 PM, Michelschr wrote: > > Hi, > > Thanks for your comments! > > The in-browser tests are a very important complement to tests with the > django client. > > I will suggest first Windmill instead of Selenium because at the end I > suspect that we will arrive at a better i

[google-appengine] Re: Testing GAE application best practices

2009-07-09 Thread Andi Albrecht
On Fri, Jul 3, 2009 at 3:45 PM, Michelschr wrote: > > Hi, > >> thanks for the explanations on how you do the testing. I assume you've >> grabbed the Rietveld test cases you've mentioned from the testing >> branch? > > I got 1 file: tests.py from this branch and the tests passed easily! > > Nice to

[google-appengine] Re: Does App Engine support xml.dom.minidom?

2009-07-12 Thread Andi Albrecht
Hi Jason, there's something wrong in your code example. You can't parse result with minidom. I think it should be something like from StringIO import StringIO import logging [...] try: dom = minidom.parse(StringIO(result.content)) except: logging.exception('Failed to parse XML:') self.res

[google-appengine] Re: dictionary displays problem

2009-08-05 Thread Andi Albrecht
In Django templates you can do either {% for item in xx.items %} Key: {{item.0}}, Value: {{item.1}} {% endfor %} or if you don't care about the keys {% for value in xx.values %} {{value}} {% endfor %} Andi On Wed, Aug 5, 2009 at 6:27 AM, yuan ping wu wrote: > in python.py: > values={

[google-appengine] Re: Versioning convention - best practice

2009-08-06 Thread Andi Albrecht
On Thu, Aug 6, 2009 at 2:32 PM, Jason Salas wrote: > > hi! > > i was just wondering what the best practice should be for numbering my > app's versions in GAE.  i just noticed the dashboard tracks by whole > numbers (ex: 1, 2, 3, 4, n), but my apps will still deploy properly if > i increment them b

[google-appengine] Re: Versioning convention - best practice

2009-08-06 Thread Andi Albrecht
On Thu, Aug 6, 2009 at 4:07 PM, Martyn wrote: > > Do you know if it is possible to access the version string at runtime? You can access it through: import os current_ver = os.environ['CURRENT_VERSION_ID'] > > On 6 Aug, 13:42, Andi Albrecht wrote: >> On Thu, A

[google-appengine] Re: Google Wave new line character

2009-08-06 Thread Andi Albrecht
On Fri, Aug 7, 2009 at 12:46 AM, Jason Salas wrote: > > now that i'm in the office and have my code handy, here's the routine i'm > using: > > def add(num,num2): >        sum = str(int(num) + int(num2)) >        return 'The sum of %s and %s is: %s' % (num,num2,sum) Given this code example, I thi

[google-appengine] Re: Google Wave new line character

2009-08-06 Thread Andi Albrecht
gits, otherwise the user input is invalid res = int(num1)+int(num2) ... Andi > > > > On Fri, Aug 7, 2009 at 2:19 PM, Andi > Albrecht wrote: >> >> On Fri, Aug 7, 2009 at 12:46 AM, Jason >> Salas wrote: >>> >>> now that i'm in the office an

[google-appengine] Re: How to handle MemoryError

2009-08-07 Thread Andi Albrecht
On Fri, Aug 7, 2009 at 7:25 PM, Jesse Grosjean wrote: > > I'm getting the following error in app engine: > > Traceback (most recent call last): >  File "/base/python_lib/versions/1/google/appengine/ext/webapp/ > __init__.py", line 509, in __call__ >    handler.post(*groups) >  File "/base/data/hom

[google-appengine] Re: Getting the latest version of my application

2009-08-08 Thread Andi Albrecht
Hi Alex, consider to use a version control system for that purpose. App Engine serves your application, not your code :) This question has been discussed several times on this list, try searching this list for different approaches (http://groups.google.com/group/google-appengine/search?group=goog

[google-appengine] Re: Configuring Friend Connect

2008-12-03 Thread Andi Albrecht
Hi Rajiv, here's how I did it... I copied the two files in a directory called "static" (where all my CSS and images live). Then I'd added the following lines to app.yaml: - url: /rpc_relay.html static_files: static/rpc_relay.html upload: static/rpc_relay.html - url: /canvas.html static_fi

[google-appengine] Re: Configuring Friend Connect

2008-12-04 Thread Andi Albrecht
e great to have an easy option to re-use an login on an appengine website for Friend Connect (any hints? maybe I've just missed something...) > > On Thu, Dec 4, 2008 at 6:28 AM, Andi Albrecht <[EMAIL PROTECTED]> > wrote: >> >> Hi Rajiv, >> >> here's

[google-appengine] Re: Configuring Friend Connect

2008-12-04 Thread Andi Albrecht
use a Python API to Friend Connect with an user object already present within appengine. [just dreaming... ;-)] > > On Thu, Dec 4, 2008 at 8:17 PM, Andi Albrecht <[EMAIL PROTECTED]> > wrote: >> >> On Thu, Dec 4, 2008 at 10:50 AM, kang <[EMAIL PROTECTED]> wrote: >&

[google-appengine] Re: updated 1.1.9 breaks django 1.0

2009-02-12 Thread Andi Albrecht
Django tries to read a static file (django/.svn/entries) to get the current revision. But accessing this file is prevented by the SDK (starting with 1.1.9, unfortunately os.path.exists() returns True in that case, but open() fails). As a workaround try to import Django from a zipped archive (as d

[google-appengine] Re: using memcache for caching query results

2009-03-03 Thread Andi Albrecht
2009/3/3 Jonathan : > > I am using a restful interface for an ajax application and want to be > able to store the results of queries in memcache, as much of this data > is read much more often than it is written, but it is occasionally > written. > > I have been trying to think of strategies for h

[google-appengine] Re: iterate thru 2 stringlistproperties in template

2009-03-09 Thread Andi Albrecht
I would zip() both lists on the Python side and iterate over that zipped lists in the template, e.g. # Python side newval = zip(stringlist1, stringlist2) # Template {%for item in newval%} {{item.0}} and {{item.1}} {%endfor%} Regards, Andi On Mon, Mar 9, 2009 at 2:19 PM, sagey wrote: > > Hell