[google-appengine] Re: is appengine run as a thread or as a process?

2009-03-25 Thread bd_



On Mar 26, 1:30 am, wangscu  wrote:
> hello guys!
>    i have a problem with GAE when i want to  make a reverse_rpc
> application.like i wait one request util the other request notify it .
> so it can make the client like have a state . but i code like below.
> here some problem   when i inovke  AddMessage() after GetMessage()  ,
> the GetMessage() did not notified,util it time out . then then the
> AddMessage() just can response . how does thes heppen?
>
>      does appengine is just a thread? not a process so it make request
> just like a list. or i code have some wrong?
>
> cv = threading.Condition()

Google hasn't released very much information about app engine's
internals, but this is unlikely to work - two requests may be routed
to entirely different /servers/, which obviously requires seperate
processes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: write the requested data into app engine database

2009-03-25 Thread Lacrima

Hi

Try:
person.FAMILY_NAME = unicode(self.request.get('FAMILY_NAME'))

On Mar 26, 7:43 am, DiveIntoGAE  wrote:
> the code is below:
>
>    person.FAMILY_NAME = self.request.get('FAMILY_NAME').encode
> ('utf-8')
>
> this code will cause the below error:
>      UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in
> position 0: ordinal not in range(128)
> I have
>
>     # -*- coding: utf-8 -*-
>
> in my .py file,and i also have
>
>     
>
> in my html file,why the error still happen?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] write the requested data into app engine database

2009-03-25 Thread DiveIntoGAE

the code is below:

   person.FAMILY_NAME = self.request.get('FAMILY_NAME').encode
('utf-8')

this code will cause the below error:
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in
position 0: ordinal not in range(128)
I have

# -*- coding: utf-8 -*-

in my .py file,and i also have



in my html file,why the error still happen?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] is appengine run as a thread or as a process?

2009-03-25 Thread wangscu

hello guys!
   i have a problem with GAE when i want to  make a reverse_rpc
application.like i wait one request util the other request notify it .
so it can make the client like have a state . but i code like below.
here some problem   when i inovke  AddMessage() after GetMessage()  ,
the GetMessage() did not notified,util it time out . then then the
AddMessage() just can response . how does thes heppen?

 does appengine is just a thread? not a process so it make request
just like a list. or i code have some wrong?

cv = threading.Condition()

class GetMessage(webapp.RequestHandler):
  def post(self):
   cv.acquire()
   cv.wait(4)
   cv.release()
   self.response.out.write("add")

class AddMessage(webapp.RequestHandler):
  def post(self):
   cv.acquire()
   cv.notfiyAll()
   cv.release()
   self.response.out.write("get")
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Data upload: differences between bulkload_client and bulkloader ?

2009-03-25 Thread Julian

Thanks for the clarification.

In the old version, the way to assign key names for uploaded data was
to override HandleEntity() and to create a new entity there.
With the new version(bulkloader.py), it seems you should override
GenerateKey() instead.

Maybe you can add it to the documentation.

Julian




On Mar 26, 7:27 am, Marzia Niccolai  wrote:
> Hi,
>
> The article is now obsolete and should be removed, it explains how to use
> the bulk upload tool that was available at launch.
>
> Recently, we released an improved version of the tool, which is what the
> second document explains.
>
> -Marzia
>
> On Tue, Mar 24, 2009 at 4:58 AM, Julian  wrote:
>
> > Hi,
>
> > The following docs describe how to upload csv data to the datastore:
> >http://code.google.com/appengine/articles/bulkload.html
> >http://code.google.com/appengine/docs/python/tools/uploadingdata.html
>
> > But one use the script bulkload_client.py and the other bulkloader.py.
> > In both files it is written that their purpose is to "Imports CSV data
> > over HTTP."
>
> > What is the difference?? I cannot figure out.
>
> > Julian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] __init__ and datastore get?

2009-03-25 Thread Devel63

A class's __init__() constructor gets called whether you are creating
a new db.Model object in memory for the first time, or retrieving an
existing entity from the datastore.

Is there some accepted way for knowing which case you are in from
within the __init__ call?

If retrieving from the datastore, I don't want to set any values.  But
how do I know?  Should I call object.is_saved?  Is there a better way
of handling this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread r00723r0

Wait... I didn't say anything about not using a Gmail account.

Here, look. Let me break it down as simply as I can.

The client, which a program downloaded on the laptop, authenticates
somehow and sends the IP address to the App Engine server every few
minutes (10 minutes by default). The ISP can determine what internet
subscriber was using a certain IP at a certain time. The App Engine
service stores the IP address and time of last transmission by the
client from the IP. If the laptop gets stolen, the ISP and police will
track it down given this information.

On Mar 25, 11:09 pm, "Steve Robillard" 
wrote:
> This seems to be a client side issue. Why the requirement to authenticate
> with something other than a Gmail address if at all. Why not just have the
> client add a header or headers to a request page which can uniquely id the
> machine that is calling. And ditch all requests without this header(s). One
> would think your users would need to authenticate  to get the info in the
> event the laptop is lost. So if you feel authentication is a must why not
> use a Gmail account?
>
> -Original Message-
> From: google-appengine@googlegroups.com
>
> [mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
> Sent: Wednesday, March 25, 2009 10:54 PM
> To: Google App Engine
> Subject: [google-appengine] Re: Manual Authentication
>
> It seems odd, I know, but I'm not doing anything malicious. I am making a
> laptop recovery service. The client on the laptop must update the Google App
> Engine server with the laptop's IP every few minutes to the App Engine
> server can keep track of it. But I need to make sure what user is sending
> this IP information.
>
> This is where the trouble comes in. The client on the laptop that tries to
> give the server the IP needs to authenticate but cannot without a login
> page.
>
> On Mar 25, 8:50 pm, "Steve Robillard" 
> wrote:
> > It might help to know why all the subterfuge what problem are you
> > trying to solve? As a user I would be suspicious of any system that
> > forwards me through a series of links and sends secret information.
> > With all do respect it sounds like you are trying to proxy a limited
> > resource or bypass a 3rd party subscription requirement.
>
> > Steve
>
> > -Original Message-
> > From: google-appengine@googlegroups.com
>
> > [mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
> > Sent: Wednesday, March 25, 2009 7:30 PM
> > To: Google App Engine
> > Subject: [google-appengine] Re: Manual Authentication
>
> > I may have explained myself incorrectly. I need to log in from an
> > invisible client without a web interface, and the login URL is unknown
> > to the standalone client. The client needs to log in and send some data
> silently.
>
> > The main problem is that the username and password are saved, so the
> > user will not be manually logging in. Instead the client must be able
> > to log in without a proprietary log in URL that Google provides.
>
> > A possible solution:
> > * The client connects to someapp.appspot.com/update/, which has only a
> > login URL when a user is not logged in.
> > * The client then connects to the URL and sends magical information to
> > log in.
> > * The login URL redirects back to the /update page, as it always does,
> > and the Google App Engine program stores this visit as programmed.
>
> > However, this solution is inelegant and annoying to program. Any
> > better solutions?
>
> > On Mar 25, 6:30 pm, Marzia Niccolai  wrote:
> > > Hi,
>
> > > Please see the information in our Google Accounts section which
> > > shows you how to request/require login and generate login/logout
> > > URLs:http://code.google.com/appengine/docs/python/users/
>
> > > -Marzia
>
> > > On Wed, Mar 25, 2009 at 11:43 AM, r00723r0  wrote:
>
> > > > I am writing a laptop theft recovery service. The client requests
> > > > / update on the Google App Engine server, with user credentials,
> > > > through HTTPS every few minutes. The server stores the IP from
> > > > which the request was made and the time the request was made in
> > > > the user information database model. My question is as such: how
> > > > do I authenticate the user in the Google App Engine server? The
> > > > username and password are given through POST in the HTTP request
> > > > but I'd still need a login URL which the client cannot generate.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Does TOS allow multiple versions of one app that do different things?

2009-03-25 Thread cz

The reason I ask this is for the following scenario:
My main app uses Django 1.x and has fairly low, but quite useful ;),
traffic thus often requiring a cold start. It incurs significant
startup time and so the initial requests are quite slow. The pages
also contain lots of images uploaded by users which in turn are
initially very slow to serve up.
What I'd like to do is use a lighter weight framework just to serve
images and other pseudo-static content. It would be fairly
straightforward to simply create a special version of the app that
when installed has direct access to the same datastore and can be very
fast. This wouldn't ever be set as the default version of course, but
would still be 'a part of' the default app and it would be using the
same quota bank and hopefully wouldn't be a violation of the TOS.
Anways, after reading the TOS I couldn't find an answer to this.

So, in case none of this makes much sense the gist of the question is
can I have two versions of the app live at the same time (only one
being the default)?
Say my app id is 'foo'. I upload 'foo' version 5 and then I also
upload a 'foo' version 6 with a different main.py and code that is
optimized for a specific kind of content (eg. images, no templates).
Version 5 is set as the default but generates pages with image urls
that point to version 6.

Can I do this under the TOS and still be a good GAE citizen?

thanks,
- Claude
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread Steve Robillard

This seems to be a client side issue. Why the requirement to authenticate
with something other than a Gmail address if at all. Why not just have the
client add a header or headers to a request page which can uniquely id the
machine that is calling. And ditch all requests without this header(s). One
would think your users would need to authenticate  to get the info in the
event the laptop is lost. So if you feel authentication is a must why not
use a Gmail account?

-Original Message-
From: google-appengine@googlegroups.com
[mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
Sent: Wednesday, March 25, 2009 10:54 PM
To: Google App Engine
Subject: [google-appengine] Re: Manual Authentication


It seems odd, I know, but I'm not doing anything malicious. I am making a
laptop recovery service. The client on the laptop must update the Google App
Engine server with the laptop's IP every few minutes to the App Engine
server can keep track of it. But I need to make sure what user is sending
this IP information.

This is where the trouble comes in. The client on the laptop that tries to
give the server the IP needs to authenticate but cannot without a login
page.

On Mar 25, 8:50 pm, "Steve Robillard" 
wrote:
> It might help to know why all the subterfuge what problem are you 
> trying to solve? As a user I would be suspicious of any system that 
> forwards me through a series of links and sends secret information. 
> With all do respect it sounds like you are trying to proxy a limited 
> resource or bypass a 3rd party subscription requirement.
>
> Steve
>
> -Original Message-
> From: google-appengine@googlegroups.com
>
> [mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
> Sent: Wednesday, March 25, 2009 7:30 PM
> To: Google App Engine
> Subject: [google-appengine] Re: Manual Authentication
>
> I may have explained myself incorrectly. I need to log in from an 
> invisible client without a web interface, and the login URL is unknown 
> to the standalone client. The client needs to log in and send some data
silently.
>
> The main problem is that the username and password are saved, so the 
> user will not be manually logging in. Instead the client must be able 
> to log in without a proprietary log in URL that Google provides.
>
> A possible solution:
> * The client connects to someapp.appspot.com/update/, which has only a 
> login URL when a user is not logged in.
> * The client then connects to the URL and sends magical information to 
> log in.
> * The login URL redirects back to the /update page, as it always does, 
> and the Google App Engine program stores this visit as programmed.
>
> However, this solution is inelegant and annoying to program. Any 
> better solutions?
>
> On Mar 25, 6:30 pm, Marzia Niccolai  wrote:
> > Hi,
>
> > Please see the information in our Google Accounts section which 
> > shows you how to request/require login and generate login/logout 
> > URLs:http://code.google.com/appengine/docs/python/users/
>
> > -Marzia
>
> > On Wed, Mar 25, 2009 at 11:43 AM, r00723r0  wrote:
>
> > > I am writing a laptop theft recovery service. The client requests 
> > > / update on the Google App Engine server, with user credentials, 
> > > through HTTPS every few minutes. The server stores the IP from 
> > > which the request was made and the time the request was made in 
> > > the user information database model. My question is as such: how 
> > > do I authenticate the user in the Google App Engine server? The 
> > > username and password are given through POST in the HTTP request 
> > > but I'd still need a login URL which the client cannot generate.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread r00723r0

Hello, and thank you. Could you give me an example of such a
transaction?

On Mar 25, 9:02 pm, GregF  wrote:
> Ping the server for a random number (the salt), then hash the salt
> with the hash of the password and send that to the server. The server
> stores a hash of the password, and hashes that and the salt and
> compares it with the sent hash - if it matches, it's authenticated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread r00723r0

It seems odd, I know, but I'm not doing anything malicious. I am
making a laptop recovery service. The client on the laptop must update
the Google App Engine server with the laptop's IP every few minutes to
the App Engine server can keep track of it. But I need to make sure
what user is sending this IP information.

This is where the trouble comes in. The client on the laptop that
tries to give the server the IP needs to authenticate but cannot
without a login page.

On Mar 25, 8:50 pm, "Steve Robillard" 
wrote:
> It might help to know why all the subterfuge what problem are you trying to
> solve? As a user I would be suspicious of any system that forwards me
> through a series of links and sends secret information. With all do respect
> it sounds like you are trying to proxy a limited resource or bypass a 3rd
> party subscription requirement.
>
> Steve
>
> -Original Message-
> From: google-appengine@googlegroups.com
>
> [mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
> Sent: Wednesday, March 25, 2009 7:30 PM
> To: Google App Engine
> Subject: [google-appengine] Re: Manual Authentication
>
> I may have explained myself incorrectly. I need to log in from an invisible
> client without a web interface, and the login URL is unknown to the
> standalone client. The client needs to log in and send some data silently.
>
> The main problem is that the username and password are saved, so the user
> will not be manually logging in. Instead the client must be able to log in
> without a proprietary log in URL that Google provides.
>
> A possible solution:
> * The client connects to someapp.appspot.com/update/, which has only a login
> URL when a user is not logged in.
> * The client then connects to the URL and sends magical information to log
> in.
> * The login URL redirects back to the /update page, as it always does, and
> the Google App Engine program stores this visit as programmed.
>
> However, this solution is inelegant and annoying to program. Any better
> solutions?
>
> On Mar 25, 6:30 pm, Marzia Niccolai  wrote:
> > Hi,
>
> > Please see the information in our Google Accounts section which shows
> > you how to request/require login and generate login/logout
> > URLs:http://code.google.com/appengine/docs/python/users/
>
> > -Marzia
>
> > On Wed, Mar 25, 2009 at 11:43 AM, r00723r0  wrote:
>
> > > I am writing a laptop theft recovery service. The client requests /
> > > update on the Google App Engine server, with user credentials,
> > > through HTTPS every few minutes. The server stores the IP from which
> > > the request was made and the time the request was made in the user
> > > information database model. My question is as such: how do I
> > > authenticate the user in the Google App Engine server? The username
> > > and password are given through POST in the HTTP request but I'd
> > > still need a login URL which the client cannot generate.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] HTMLParser error?

2009-03-25 Thread 秦锋

When I'm using HTMLParser to access a link below:

http://www.stats.gov.cn/tjsj/ndsj/2007/html/C0301c.htm

SDK keeps reporting:

Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\google
\appengine
\ext\webapp\__init__.py", line 498, in __call__
handler.get(*groups)
  File "D:\Data\Documents\Workspace\CNStatsSvr\src
\spider.py", line 134, in get
parser.close()
  File "C:\Python25\lib\HTMLParser.py", line 112, in close
self.goahead(1)
  File "C:\Python25\lib\HTMLParser.py", line 164, in
goahead
self.error("EOF in middle of construct")
  File "C:\Python25\lib\HTMLParser.py", line 115, in error
raise HTMLParseError(message, self.getpos())
HTMLParseError: EOF in middle of construct, at line 8, column 1


I know it's a python question, is there anyone could help?
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Datastore API and Flex Applications

2009-03-25 Thread Doug

Good Evening Everyone,

Is there an API for accessing the datastore from an Adobe Flex
application?

I was thinking that I had read about one, but now I can't find it.

Thanks,
Doug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] application instance observation and control

2009-03-25 Thread Andy Freeman

We've seen a lot of discussion about how long application instances
stay around waiting for a query.  I'd assume that this interval is
actually somewhat variable and understand that Google doesn't want to
make any promises.

What else, besides idle time, kills application instances?

We've also been told that an application instance is the fastest
cache, albeit one that is not shareable.  Are there any tools to help
us manage that cache?  (For example, if we cache too much, the
instance will throw out of memory errors.)

Is there any way to tell the run time that we'd like it to kill the
current application instance after the current request completes?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread GregF

Ping the server for a random number (the salt), then hash the salt
with the hash of the password and send that to the server. The server
stores a hash of the password, and hashes that and the salt and
compares it with the sent hash - if it matches, it's authenticated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Cold app startup stats in case you're curious

2009-03-25 Thread Brandon Thomson

My apps all use webkit/0.96 django templates. Cold start times are
<10ms for handlers that don't use templates and closer to 50ms for
handlers that do.

On Mar 25, 2:50 pm, cz  wrote:
> Django is pretty resource intensive what with all the middleware and
> template processing so it makes sense that a more minimal app would be
> much faster. As for using .96 my guess is that you'd save ~180ms by
> skipping zipimport and a fair bit more by not having to compile all
> the imports (assuming the default GAE libraries are *.pyc). I'm still
> kind of a Python newbie (old Java/C++ prgmr) so this explanation might
> be completely wrong. Please post your results if you try it out!
> You're probably right about memcache, I was trying to figure out where
> all that extra response time (not startup time) came from on a cold
> start (500ms cold vs 10ms warm). Maybe it's just the Python
> interpreter having to compile all the response processing code.
> My app serves uploaded images and other longer term datastore
> blobjects, and using a Django view to serve them up is super slow when
> cold. I'm thinking of using the lighter weight webapp framework just
> to serve this kind of content. I didn't want to use more than one
> framework for the app, but it's probably worth it in this case. For
> lower traffic apps anyway.
> regards,
> - Claude
>
> On Mar 24, 11:58 pm, Robert  wrote:
>
> > Useful stuff, thanks!
>
> > Just yesterday I was looking into this same issue. I was wondering if
> > plain 0.96 Django use (without appengine helper or patch) would be
> > significantly faster, and your post really makes me want to try that.
> > I changed the handling of a single url in my app to be a "plain" GAE
> > (webapp.WSGIApplication) handler. This URL was for a cron-triggered
> > task that runs every minute. In the absence of other traffic this
> > resulted in a cold start every minute and this processing this trivial
> > request now only uses approx. 200 ms CPU quota. When it was part of
> > the main Django app, it would take over 2000 ms CPU quota.
>
> > BTW I'm fairly convinced that memcached data doesn't get flushed out.
>
> > On Mar 24, 6:27 am, cz  wrote:
>
> > > I added some timing code to see how expensive a cold app startup is.
> > > This is a Django1.x app so YMMV.
>
> > > The typical numbers are:
>
> > > Zipimport of Django: 180ms
> > > Appengine-django-helper monkeypatching: 430ms
> > > Misc imports, app-specific patching, etc: 20ms
> > > 
> > > Total app startup: 630ms
>
> > > This is for startup only, not the time it takes to then process the
> > > request, so this is a fixed expense. Also, this is real time not cpu
> > > quota time which is much higher.
>
> > > The biggest hog is the django-helper monkeypatcher. I'm eventually
> > > going to try appengine-patch with the hope that it will be faster.
>
> > > Additionally, on a cold startup my app processes a request in about
> > > 500ms, but on a warm app it only takes 10ms due to some aggressive
> > > caching. I think that when all your app instances expire so does all
> > > it's memcached data.
>
> > > If anybody has done something similar and found different numbers
> > > please post the results and let me know what I did wrong.
>
> > > Here's the main.py I'm using in case you'd like to point out any
> > > errors in my methodology:
> > > 
>
> > > from time import clock
> > > t_main_start = clock()
>
> > > # Standard Python imports.
> > > import os
> > > import sys
> > > import logging
> > > import settings
>
> > > logging.getLogger().setLevel(settings.LOGGING_LEVEL)
>
> > > # Fix (hack) for missing unlink
> > > if os.name == 'nt':
> > >     os.unlink = lambda: None
>
> > > # TODO (after gathering stats): remove this since appengine_django
> > > does it for us
> > > # Import Django 1.x from a zipfile and get rid of v.96.
> > > t_zip_start = clock()
> > > django_zip_path = os.path.abspath('django.zip')
> > > if django_zip_path not in sys.path:
> > >     sys.path.insert(0, django_zip_path)
> > >     for k in [k for k in sys.modules if k.startswith('django')]:
> > >         del sys.modules[k]
> > > # TODO (after gathering stats): remove this line
> > > from django import template # provoke django zipimport
> > > t_zip = (clock() - t_zip_start) * 1000
>
> > > # Install appengine_django. Patches Django 1.x for use with GAE
> > > t_patch_start = clock()
> > > from appengine_django import InstallAppengineHelperForDjango
> > > InstallAppengineHelperForDjango()
> > > t_patch = (clock() - t_patch_start) * 1000
>
> > > # Patch the appengine_django patch to fix User object creation
> > > # Remove this when switching to appengine-patch
> > > from monkeypatch import patch
> > > patch()
>
> > > # Google App Engine imports.
> > > from google.appengine.ext.webapp import util
>
> > > # Import the part of Django that we use here.
> > > import django.core.handlers.wsgi
>
> >

[google-appengine] Re: Manual Authentication

2009-03-25 Thread Steve Robillard

It might help to know why all the subterfuge what problem are you trying to
solve? As a user I would be suspicious of any system that forwards me
through a series of links and sends secret information. With all do respect
it sounds like you are trying to proxy a limited resource or bypass a 3rd
party subscription requirement.

Steve 

-Original Message-
From: google-appengine@googlegroups.com
[mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
Sent: Wednesday, March 25, 2009 7:30 PM
To: Google App Engine
Subject: [google-appengine] Re: Manual Authentication


I may have explained myself incorrectly. I need to log in from an invisible
client without a web interface, and the login URL is unknown to the
standalone client. The client needs to log in and send some data silently.

The main problem is that the username and password are saved, so the user
will not be manually logging in. Instead the client must be able to log in
without a proprietary log in URL that Google provides.

A possible solution:
* The client connects to someapp.appspot.com/update/, which has only a login
URL when a user is not logged in.
* The client then connects to the URL and sends magical information to log
in.
* The login URL redirects back to the /update page, as it always does, and
the Google App Engine program stores this visit as programmed.

However, this solution is inelegant and annoying to program. Any better
solutions?

On Mar 25, 6:30 pm, Marzia Niccolai  wrote:
> Hi,
>
> Please see the information in our Google Accounts section which shows 
> you how to request/require login and generate login/logout 
> URLs:http://code.google.com/appengine/docs/python/users/
>
> -Marzia
>
> On Wed, Mar 25, 2009 at 11:43 AM, r00723r0  wrote:
>
> > I am writing a laptop theft recovery service. The client requests / 
> > update on the Google App Engine server, with user credentials, 
> > through HTTPS every few minutes. The server stores the IP from which 
> > the request was made and the time the request was made in the user 
> > information database model. My question is as such: how do I 
> > authenticate the user in the Google App Engine server? The username 
> > and password are given through POST in the HTTP request but I'd 
> > still need a login URL which the client cannot generate.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Flash, AWS S3, GAE - good solution? (secret Key stored in GAE)

2009-03-25 Thread tom s

I have a Flash/Flex app that lets users upload a file to AWS S3.
I have it working, but I want to run it by a few folks to see if there
is a better way, and checker whether there might be any security
issues.

1. User selects file
2. flash connects to GAE, gets new ID (sequential)
3. flash uses ID to build a policy file
4. flash base64s the policy, then sends it to GAE
5. GAE (which has my S3 Secret Key stored in a .py file) calculates
the signature, base64s it, and returns it to flash in a URL variable
6. flash POSTs the file to S3 using the policy and signature (bucket
is only accessible by 'me')

Any better ideas?
Any security issues?
Safe to store the S3 Secret Key in a .py file on GAE?

thanks

tom


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread r00723r0

I may have explained myself incorrectly. I need to log in from an
invisible client without a web interface, and the login URL is unknown
to the standalone client. The client needs to log in and send some
data silently.

The main problem is that the username and password are saved, so the
user will not be manually logging in. Instead the client must be able
to log in without a proprietary log in URL that Google provides.

A possible solution:
* The client connects to someapp.appspot.com/update/, which has only a
login URL when a user is not logged in.
* The client then connects to the URL and sends magical information to
log in.
* The login URL redirects back to the /update page, as it always does,
and the Google App Engine program stores this visit as programmed.

However, this solution is inelegant and annoying to program. Any
better solutions?

On Mar 25, 6:30 pm, Marzia Niccolai  wrote:
> Hi,
>
> Please see the information in our Google Accounts section which shows you
> how to request/require login and generate login/logout 
> URLs:http://code.google.com/appengine/docs/python/users/
>
> -Marzia
>
> On Wed, Mar 25, 2009 at 11:43 AM, r00723r0  wrote:
>
> > I am writing a laptop theft recovery service. The client requests /
> > update on the Google App Engine server, with user credentials, through
> > HTTPS every few minutes. The server stores the IP from which the
> > request was made and the time the request was made in the user
> > information database model. My question is as such: how do I
> > authenticate the user in the Google App Engine server? The username
> > and password are given through POST in the HTTP request but I'd still
> > need a login URL which the client cannot generate.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: President Obama open for questions on Google Moderator and App Engine

2009-03-25 Thread peterk

That's pretty cool, and a nice 'poster-child' for appengine. Is this a
somewhat permanent arrangement? Will the Whitehouse be doing this on a
recurring basis?

On Mar 25, 10:01 pm, Brett Slatkin  wrote:
> Hey Everyone,
>
> Just wanted to point out something cool that's going on with App
> Engine right now:
>
> http://www.whitehouse.gov/blog/09/03/24/Open-for-Questions-President-...
>
> http://googleblog.blogspot.com/2009/03/citizen-participation-that-sca...
>
> "At Google we hold weekly town hall-style meetings with our founders,
> CEO, and guest speakers, which always feature a Q&A session. Managing
> Q&A is a unique challenge with an audience of thousands, in offices
> around the world, who inevitably want to ask more questions than we
> have time to answer. To help address this challenge, we developed
> Google Moderator, built on App Engine.
>
> Moderator gives participants a way to submit questions and vote for
> the ones they want answered. And thanks to the scale that App Engine
> provides, this application can now support tens of thousands of people
> at once. This gives everyone the chance to be heard in a way that
> gives priority to the issues that matter most to the broader group.
>
> As you may have heard, the White House is hosting an online town hall
> meeting on Thursday and has asked people to submit questions for the
> president and vote on which ones they think he should answer.
>
> We think technology can be a force for greater accountability and
> access between citizens and their elected officials. We're excited
> that the White House has chosen to use the power of cloud-based
> applications like Google Moderator and App Engine to scale the
> president's direct dialogue with the American people.
>
> To take part in this experiment in citizen participation, please
> visit:http://WhiteHouse.gov/OpenForQuestions";
>
> We'll have a follow-up blog post once it's all done.
>
> -Brett
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Access external resources with IP block from GAE

2009-03-25 Thread Marzia Niccolai
Hi,

Currently, there is no way to get a fixed IP address with App Engine.  The
range of possible IPs is large, and we don't release the list of all IPs
your app could serve from.

-Marzia

On Wed, Mar 25, 2009 at 4:44 AM, Neves  wrote:

>
> I am curious if GAE would add payed fixed ip address like Amazon did.
>
> On 24 mar, 06:28, Alars  wrote:
> > Hi all,
> >
> > My GAE app needs to access an external service wich uses an IP check.
> > Is it possible to use a static IP with GAE or does anyone have an idea
> > for a workaround? (I dont want to pay for a service that can act as a
> > proxy)
> >
> > Cheers!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: memcache, What types can it contain?

2009-03-25 Thread Marzia Niccolai
Hi,

For a higher level answer, you can only store things in memcache that are
pickle-able. The best way to determine if something is pickle-able is to
read the Python docs:
http://docs.python.org/library/pickle.html

-Marzia

On Tue, Mar 24, 2009 at 8:34 PM, Lee Olayvar  wrote:

> Odd, thanks for the heads up.
>
> Found out, as part of my bootstrapping process, i was storing the request
> handler in the memcache; a nono it seems. :o
>
> On Mar 24, 2009 7:22 AM, "David Wilson"  wrote:
>
>
> Looks like you're trying to pickle a cStringIO object. That won't work.
>
> Options are: find the code using cStringIO and convert to using
> StringIO (I'm guessing this will work fine), or consider implementing
> __getstate__ [1] instead.
>
>
> David
>
> [1] http://www.python.org/doc/2.5.2/lib/pickle-inst.html
>
> 2009/3/24 Lee Olayvar :
>
> > Can memcache store semi-complex object instances? Or is it basically
> limited > to only simple data...
> --
> It is better to be wrong than to be vague.
>  — Freeman Dyson
>
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-25 Thread Marzia Niccolai
Hi,

Please see the information in our Google Accounts section which shows you
how to request/require login and generate login/logout URLs:
http://code.google.com/appengine/docs/python/users/

-Marzia

On Wed, Mar 25, 2009 at 11:43 AM, r00723r0  wrote:

>
> I am writing a laptop theft recovery service. The client requests /
> update on the Google App Engine server, with user credentials, through
> HTTPS every few minutes. The server stores the IP from which the
> request was made and the time the request was made in the user
> information database model. My question is as such: how do I
> authenticate the user in the Google App Engine server? The username
> and password are given through POST in the HTTP request but I'd still
> need a login URL which the client cannot generate.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Synchronized access to memcache

2009-03-25 Thread David Wilson

Hi Raghavv,

The memcache API provides the ability to atomically increment an
integer key, and return the old value. You can use this feature to
build an efficient circular buffer that supports hopefully consistent
updates. I started such a class here: 
(note this code has at least one major bug, use it as a guide only!).

Note that the AppEngine documentation provides no guarantees about the
locality or consistency across multiple keys, so the approach I took
might not be valid.


David.

2009/3/25 ragh...@gmail.com :
>
> I am trying to create a 'user activity' queue in memcache. Example:
>
> User1 logged in at time t1
> User2 logged out at time t2
> User1 played poker at time t3
> User1 updated profile at time t4
>
> Data as in above example, is stored in memcache with key name =
> "ActivityQueue"
>
> At any given time, I need all the activities done in last 5 minutes. I
> have a choice of doing it in data-store but would like to avoid it due
> to performance reasons. I don't need persistence for this data.
>
> Unless updates to the ActivityQueue are synchronized, I will lose
> certain updated.
>
> Is there a way to synchronize updates to memcache? i.e. at any given
> time only one request can append to the queue. Anybody with better
> idea on how to do queuing?
>
> >
>



-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Data upload: differences between bulkload_client and bulkloader ?

2009-03-25 Thread Marzia Niccolai
Hi,

The article is now obsolete and should be removed, it explains how to use
the bulk upload tool that was available at launch.

Recently, we released an improved version of the tool, which is what the
second document explains.

-Marzia

On Tue, Mar 24, 2009 at 4:58 AM, Julian  wrote:

>
> Hi,
>
> The following docs describe how to upload csv data to the datastore:
> http://code.google.com/appengine/articles/bulkload.html
> http://code.google.com/appengine/docs/python/tools/uploadingdata.html
>
> But one use the script bulkload_client.py and the other bulkloader.py.
> In both files it is written that their purpose is to "Imports CSV data
> over HTTP."
>
> What is the difference?? I cannot figure out.
>
>
> Julian
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Use my Google Apps account for app engine

2009-03-25 Thread Marzia Niccolai
Hi,

Yes, you can use your Google Apps account with Google App Engine.  Just
access the Admin console through
http://appengine.google.com/a/yourdomain.com

-Marzia

On Mon, Mar 23, 2009 at 12:53 PM, Ronn Ross  wrote:

> Hello,
> I subscribed to google apps premium addition. I attempt to sign in to
> google apps to upload my app and it won't let me gain access. Are you
> allowed to use your google apps account to create apps in app engine.
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Locked out

2009-03-25 Thread Marzia Niccolai
Hi,

I am not able to replicate this issue.  Are you sure you are accessing
http://appengine.google.com ?  If so, could you provide a list of steps you
followed to replicate this as well as a screenshot of the error?

-Marzia

On Sun, Mar 22, 2009 at 8:53 AM, Mr Dynamite  wrote:

>
> I can't upload a new version of my app, and when I try to sign in to
> the dashboard I get a message saying that google's security
> certificate has expired.  Any suggestions?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Created a new account and a new app, now app has vanished

2009-03-25 Thread Marzia Niccolai
Hi,

You need to access the dashboard at
http://appengine.google.com/a/ablepear.com .

-Marzia

On Fri, Mar 20, 2009 at 5:55 PM, Able Pear Software <
aps.chan...@ablepear.com> wrote:

>
> I created a new account about a half hour ago and added a new app
> after confirming via SMS.  After submitting all the "Create an
> Application" form, I was redirected right back to
> http://appengine.google.com/start,
> and even logging out and back in, there's no sign of the app or the
> App Engine Dashboard.
>
> However, I was able to upload my app code (a stub placeholder) using
> the App Engine Launcher and it's running just fine at
> http://ablepear.appspot.com/
>
> Is something just running slow today and will my app eventually appear
> in the Dashboard, or have I hit a bug somewhere?
>
> -Don
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Are all ListProperties implicitly indexed?

2009-03-25 Thread Marzia Niccolai
Hi,

Everything that is query-able must be indexed (
http://code.google.com/appengine/articles/index_building.html).  So if you
want to store, but not query, a list, I would suggest using db.BlobProperty.

-Marzia

On Mon, Mar 23, 2009 at 1:08 AM, an0  wrote:

>
> If so, can I explicitly mark a ListProperty not to be indexed?
>
> I want the list's flexibility for some attributes, but don't want them
> to be indexed, (how) can I achieve this goal?
>
> Thanks in advance.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] President Obama open for questions on Google Moderator and App Engine

2009-03-25 Thread Brett Slatkin

Hey Everyone,

Just wanted to point out something cool that's going on with App
Engine right now:

http://www.whitehouse.gov/blog/09/03/24/Open-for-Questions-President-Obama-to-Answer-Your-Questions-on-Thursday/

http://googleblog.blogspot.com/2009/03/citizen-participation-that-scales-call.html


"At Google we hold weekly town hall-style meetings with our founders,
CEO, and guest speakers, which always feature a Q&A session. Managing
Q&A is a unique challenge with an audience of thousands, in offices
around the world, who inevitably want to ask more questions than we
have time to answer. To help address this challenge, we developed
Google Moderator, built on App Engine.

Moderator gives participants a way to submit questions and vote for
the ones they want answered. And thanks to the scale that App Engine
provides, this application can now support tens of thousands of people
at once. This gives everyone the chance to be heard in a way that
gives priority to the issues that matter most to the broader group.

As you may have heard, the White House is hosting an online town hall
meeting on Thursday and has asked people to submit questions for the
president and vote on which ones they think he should answer.

We think technology can be a force for greater accountability and
access between citizens and their elected officials. We're excited
that the White House has chosen to use the power of cloud-based
applications like Google Moderator and App Engine to scale the
president's direct dialogue with the American people.

To take part in this experiment in citizen participation, please
visit: http://WhiteHouse.gov/OpenForQuestions";



We'll have a follow-up blog post once it's all done.

-Brett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Does anyone know how to implement a file upload progress bar

2009-03-25 Thread ni

Neves,

Thanks, I will give this a try.

On Mar 25, 7:42 am, Neves  wrote:
> Since GAE returns the server response only when its complete,
> the only way to do file upload progress is using Flash, like 
> inhttp://swfupload.org/
>
> On 25 mar, 02:05, ni  wrote:
>
> > I am trying to add a file update functionality to my application and
> > it works fine.  However, when loading large files there is no way to
> > tell the user about the progress of the file upload process. I have
> > seen some postings elsewhere about how to do this using PHP and AJAX,
> > but nothing that would seem to work with GAE.  Anyone know how to do
> > this in GAE and some sample code?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: my GAE domain is being redirected to an empty Google Sites homepage...

2009-03-25 Thread Marzia Niccolai
Hi,

Try following the directions here (with my instead of www):
http://groups.google.com/group/google-appengine/web/deleting-existing-www-mapping-from-google-apps

-Marzia

On Sat, Mar 21, 2009 at 10:13 PM, William  wrote:

>
> Anyone ever have this happen?
>
> I have a web app running on Google App Engine.  I want to host it
> using a custom domain name.
>
> I set this up following the instructions available at
> http://www.google.com/support/a/bin/answer.py?hl=en&answer=91077#verified
> ...  I actually did it for 3 different domains that I use as different
> faces for my app:
>
> This was working fine for several weeks until about 2 hours ago when
> one of the domains started forwarding to a blank Google Sites
> page..  )-:
>
> This URL - http://my.opensolar.org/ was rendering my Google App Engine
> web app earlier today.  Now it displays the blank Google Sites
> page...  any ideas why this is happening?  When I log into Google
> Apps, I see all three domains associated with my GAE account.  Two of
> them work fine, but a couple of hours - http://my.opensolar.org/
> stopped working.  ???
>
> Any ideas, thoughts or suggestions would be greatly appreciated.
>
> Thanks!
>
> William
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Manual Authentication

2009-03-25 Thread r00723r0

I am writing a laptop theft recovery service. The client requests /
update on the Google App Engine server, with user credentials, through
HTTPS every few minutes. The server stores the IP from which the
request was made and the time the request was made in the user
information database model. My question is as such: how do I
authenticate the user in the Google App Engine server? The username
and password are given through POST in the HTTP request but I'd still
need a login URL which the client cannot generate.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Cold app startup stats in case you're curious

2009-03-25 Thread cz

Django is pretty resource intensive what with all the middleware and
template processing so it makes sense that a more minimal app would be
much faster. As for using .96 my guess is that you'd save ~180ms by
skipping zipimport and a fair bit more by not having to compile all
the imports (assuming the default GAE libraries are *.pyc). I'm still
kind of a Python newbie (old Java/C++ prgmr) so this explanation might
be completely wrong. Please post your results if you try it out!
You're probably right about memcache, I was trying to figure out where
all that extra response time (not startup time) came from on a cold
start (500ms cold vs 10ms warm). Maybe it's just the Python
interpreter having to compile all the response processing code.
My app serves uploaded images and other longer term datastore
blobjects, and using a Django view to serve them up is super slow when
cold. I'm thinking of using the lighter weight webapp framework just
to serve this kind of content. I didn't want to use more than one
framework for the app, but it's probably worth it in this case. For
lower traffic apps anyway.
regards,
- Claude


On Mar 24, 11:58 pm, Robert  wrote:
> Useful stuff, thanks!
>
> Just yesterday I was looking into this same issue. I was wondering if
> plain 0.96 Django use (without appengine helper or patch) would be
> significantly faster, and your post really makes me want to try that.
> I changed the handling of a single url in my app to be a "plain" GAE
> (webapp.WSGIApplication) handler. This URL was for a cron-triggered
> task that runs every minute. In the absence of other traffic this
> resulted in a cold start every minute and this processing this trivial
> request now only uses approx. 200 ms CPU quota. When it was part of
> the main Django app, it would take over 2000 ms CPU quota.
>
> BTW I'm fairly convinced that memcached data doesn't get flushed out.
>
> On Mar 24, 6:27 am, cz  wrote:
>
> > I added some timing code to see how expensive a cold app startup is.
> > This is a Django1.x app so YMMV.
>
> > The typical numbers are:
>
> > Zipimport of Django: 180ms
> > Appengine-django-helper monkeypatching: 430ms
> > Misc imports, app-specific patching, etc: 20ms
> > 
> > Total app startup: 630ms
>
> > This is for startup only, not the time it takes to then process the
> > request, so this is a fixed expense. Also, this is real time not cpu
> > quota time which is much higher.
>
> > The biggest hog is the django-helper monkeypatcher. I'm eventually
> > going to try appengine-patch with the hope that it will be faster.
>
> > Additionally, on a cold startup my app processes a request in about
> > 500ms, but on a warm app it only takes 10ms due to some aggressive
> > caching. I think that when all your app instances expire so does all
> > it's memcached data.
>
> > If anybody has done something similar and found different numbers
> > please post the results and let me know what I did wrong.
>
> > Here's the main.py I'm using in case you'd like to point out any
> > errors in my methodology:
> > 
>
> > from time import clock
> > t_main_start = clock()
>
> > # Standard Python imports.
> > import os
> > import sys
> > import logging
> > import settings
>
> > logging.getLogger().setLevel(settings.LOGGING_LEVEL)
>
> > # Fix (hack) for missing unlink
> > if os.name == 'nt':
> >     os.unlink = lambda: None
>
> > # TODO (after gathering stats): remove this since appengine_django
> > does it for us
> > # Import Django 1.x from a zipfile and get rid of v.96.
> > t_zip_start = clock()
> > django_zip_path = os.path.abspath('django.zip')
> > if django_zip_path not in sys.path:
> >     sys.path.insert(0, django_zip_path)
> >     for k in [k for k in sys.modules if k.startswith('django')]:
> >         del sys.modules[k]
> > # TODO (after gathering stats): remove this line
> > from django import template # provoke django zipimport
> > t_zip = (clock() - t_zip_start) * 1000
>
> > # Install appengine_django. Patches Django 1.x for use with GAE
> > t_patch_start = clock()
> > from appengine_django import InstallAppengineHelperForDjango
> > InstallAppengineHelperForDjango()
> > t_patch = (clock() - t_patch_start) * 1000
>
> > # Patch the appengine_django patch to fix User object creation
> > # Remove this when switching to appengine-patch
> > from monkeypatch import patch
> > patch()
>
> > # Google App Engine imports.
> > from google.appengine.ext.webapp import util
>
> > # Import the part of Django that we use here.
> > import django.core.handlers.wsgi
>
> > t_main = (clock() - t_main_start) * 1000
> > logging.info('[TIME] main.py startup: %.1fms (zipimport: %.1fms,
> > appengine-django: %.1fms)' % (t_main,t_zip,t_patch))
>
> > def real_main():
> >     t_request_start = clock()
> >     # Create a Django application for WSGI.
> >     application = django.core.handlers.wsgi.WSGIHandler()
>
> >     # Run the WSGI CGI ha

[google-appengine] Re: getlistfeed fails

2009-03-25 Thread Jeff S

Hi mrsixcount,

I haven't reproduced this issue but I have a few suggestions which
would help narrow down the problem.

I noticed the following lines, which can now be removed because
run_on_appengine does the same thing.

import gdata.urlfetch
# Use urlfetch instead of httplib
gdata.service.http_request_handler = gdata.urlfetch

Also, I would recommend changing GSheerService to do something more
like this:

def GSheetService():
  # When you passed in sKey and wKeyUser
  # those are used as email and password
  gd_client = gdata.spreadsheet.service.SpreadsheetsService();
  # run_on_appengine should be called on the
  # client being used. Also since this is using
  # ClientLogin, I recommend turning off auto
  # token storage and marking this as
  # "single_user_mode" as shown below.
  # More details here:
  # http://code.google.com/appengine/articles/gdata.html and
  # http://code.google.com/appengine/articles/more_google_data.html
  gdata.alt.appengine.run_on_appengine(gd_client, store_tokens=False,
  single_user_mode=True)
  gd_client.email = 'test...@gmail.com';
  gd_client.password = '';
  # After setting the username and password,
  # the auth token must be obtained by
  # calling ProgrammaticLogin (or ClientLogin)
  gd_client.ProgrammaticLogin()
  return gd_client;

Could you give this a try and let me know how it goes? If this doesn't
resolve the issue, please share your new code and I'll try to
reproduce. Thanks for being so thorough with sharing your code, this
is very helpful.

Happy coding,

Jeff

On Mar 24, 1:56 pm, mrsixcount  wrote:
> Hi guys,
>
> I'm really perplexed by this one.  I added the urlfetch fix and the
> run_on_appengine but am not sure if I did it write.  Without the
> urlfetch fix it says that the port is not defined.
>
> I am using the following code in GAE i get a 404 not found error:
> ===
>
> Traceback (most recent call last):
>   File "/Applications/GoogleAppEngineLauncher.app/Contents/
> Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> google_appengine/google/appengine/ext/webapp/__init__.py", line
> 500, in __call__
>     handler.post(*groups)
>   File "/Users/Dean/Sites/helloworld/helloworld.py", line
> 134, in post
>     a = validateUser(email,pwd)
>   File "/Users/Dean/Sites/helloworld/helloworld.py", line
> 95, in validateUser
>     feed = gd_client.GetListFeed(sKey,wKeyUser,query = qga)
>   File "/Users/Dean/Sites/helloworld/gdata/spreadsheet/
> service.py", line 249, in GetListFeed
>     converter=gdata.spreadsheet.SpreadsheetsListFeedFromString)
>   File "/Users/Dean/Sites/helloworld/gdata/service.py", line
> 1019, in Get
>     'reason': server_response.reason, 'body': result_body}
> RequestError: {'status': 404, 'body': '\n
> \nNot Found\n\n BGCOLOR="#FF" TEXT="#00">
> \n

Not Found

\n

Error 404

\n BODY>\n\n', 'reason': ''} > > > === > > If I do the same thing in native python with the client library it > works. > > any ideas? I've changed the usernames and passwords in the pasted > code. > > > import os > import cgi > import string > > from google.appengine.api import users > from google.appengine.ext import webapp > from google.appengine.ext.webapp.util import run_wsgi_app > from google.appengine.ext.webapp import template > from google.appengine.ext import db > > import wsgiref.handlers > try: >         from xml.etree import ElementTree > except ImportError: >         from elementtree import ElementTree > > import gdata.service > import gdata.alt.appengine > import atom.service > import gdata.spreadsheet > import gdata.spreadsheet.service > import atom > > import gdata.urlfetch > # Use urlfetch instead of httplib > gdata.service.http_request_handler = gdata.urlfetch > > import settings > > import hashlib > from random import choice > from base64 import b64decode, b64encode > > #b64hash = "OJF6H4KdxFLgLu+oTDNFodCEfMA="; > sKey = ''; > wKeyUser = 'od6'; > wKeyLogin = 'od4'; > wKeyTut = 'od7'; > wKeyTutList = 'od5'; > > def GenPasswd(length=8, chars=string.letters+string.digits): >         return ''.join([choice(chars) for i in range(length)]) > > def utf16tobin(s): >         return s.encode('hex')[4:].decode('hex') > > def checkhash(hashval, unhashed): >         b64salt = "123456789012345678901234" >         binsalt = b64decode(b64salt) >         password_string = unhashed.encode("utf16") >         password_string = utf16tobin(password_string) >         m1 = hashlib.sha1() >         # Pass in salt >         m1.update(binsalt + password_string) >         # Pass in password >         # B64 encode the binary digest >         if b64encode(m1.digest()) == hashval: >             return True >         else: >                 return False > > def GSheetService(): >         client = gdata.service.GDataService() >         gdata.alt.appengine.run_on_appengine(client) > >         gd_client = gdata.spreadsheet.service.SpreadsheetsService > (sKey,wKeyUser);

[google-appengine] Re: Odd problem with urlfetch from picasa servers

2009-03-25 Thread Jeff S



On Mar 22, 4:10 pm, notcourage  wrote:
> Did you ever find the solution?
>
> Is photo.media.thumbnail[1].url the URL for the actual image? Or a
> page containing it?

Great question, it would help if we could see URL being requested. The
reason I most often see for not being able to retrieve an image is
that the imgmax parameter is not being included.

http://code.google.com/apis/picasaweb/faq.html#embed_image

>
> I don't understand how to upload an image to picasa since
> gd_client.InsertPhotoSimple requires a filename and an appengine app
> doesn't have access to the file system, does it?

Good point. You could use the lower-level Post method found in
gdata.service.GDataService along with a gdata.MediaSource object to
simulate a file. This might look something like:

media_source = gdata.MediaSource(
file_handle=StringIO.StringIO(your_image_data),
content_type='image/jpeg',
content_length=len(your_image_data),
file_name='example.jpg')

Then look at the implementation for InsertPhoto(Simple) for ideas on
how to use the client.Post method.

Thank you,

Jeff

>
> Thx.
>
> On Feb 26, 3:32 am, "G. Nyman"  wrote:
>
> > Hello everybody,
>
> > I have been banging my head against this problem for a while now and I
> > can't seem to understand why it does what it does.
>
> > I am trying to import pictures fromPicasausing the code appended at
> > the end of this post. It works fine in the dev environment but for
> > some reasonpicasareturns 404 when i try to run it online.
>
> > The devserver-logs say:
> > INFO     2009-02-26 10:24:35,093 svgae.py] Got the following 
> > url:http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50...,
> > data was truncated? 0
> > INFO     2009-02-26 10:24:35,093 svgae.py] Big thumb got status 200
> > and lenght: 99720
> > INFO     2009-02-26 10:24:35,108 dev_appserver.py] "GET /
> > no_go_with_picasa HTTP/1.1" 200 -
>
> > The real thing says:
> > 02-26 02:25AM 24.551 /no_go_with_picasa 200 927ms 951ms-cpu 0kb
> > 130.232.90.98 - - [26/Feb/2009:02:25:25 -0800] "GET /no_go_with_picasa
> > HTTP/1.1" 200 104 - -
> > I 02-26 02:25AM 25.473
> > Got the following 
> > url:http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50...,
> > data was truncated? 0
> > I 02-26 02:25AM 25.474
> > Big thumb got status 404 and lenght: 1421
>
> > This might be apicasaproblem but I tought I'll try here first. The
> > url to the photo works in both cases so I don't understand the 404.
> > The most interesting thing is that urlfetch on photo.media.thumbnail
> > [0].url works fine.
>
> > Thankfull for all assistance
>
> > /G. Nyman
>
> > Code to replicate the problem:
> > ---
> > class PicasaProblem(webapp.RequestHandler):
> >         def get(self):
> >                 gd_client = gdata.photos.service.PhotosService()
> >                 gdata.alt.appengine.run_on_appengine(gd_client)
> >                 username = 'tehviu'
> >                 albumid = 'SigmaTest'
> >                 photos = gd_client.GetFeed(
> >                     '/data/feed/api/user/%s/album/%s?
> > kind=photo&thumbsize=64,1024&imgmax=d' % (
> >                         username, albumid))
> >                 for photo in photos.entry:
> >                         img_thumb_big = None
> >                         try:
> >                                 img_thumb_big = 
> > urlfetch.fetch(photo.media.thumbnail[1].url)
> >                         except Exception, e:
> >                                 logging.exception(e)
> >                                 error = 'Image importing error'
>
> >                         logging.info("Got the following url: " + 
> > photo.media.thumbnail
> > [1].url + ", data was truncated? " + str
> > (img_thumb_big.content_was_truncated))
> >                         logging.info("Big thumb got status "+ str
> > (img_thumb_big.status_code) + " and lenght: " + img_thumb_big.headers
> > ['content-length'])
> >                         break
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Accessing the datastore remotely with remote_api

2009-03-25 Thread Andy Freeman

http://groups.google.com/group/google-appengine/browse_thread/thread/10fc2635dbfc6b6e

On Mar 25, 3:32 am, service G2100  wrote:
> Yes, I am trying to use remote_api from GAE.
>
> Since each application has resource limitation.
>
> Just trying to use multiple apps to connect single data source.
>
> Best Regards
> Tom Wu
>
> 2009/3/25 GregF 
>
>
>
>
>
> > It sounds like you are trying to use remote_api from GAE,  rather than
> > your local machine. GAE libraries have sockets locked down to prevent
> > abuse, which may be the source of your problem. On GAE, the only
> > network option you have is url_fetch.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] SMS Verification

2009-03-25 Thread Hsinmu

Hi all,

I couldn't find anyone to contact about the SMS verification problem
so I decided to post a message here and see if anyone has any advices.

I tried using my US AT&T cell phone for the SMS verification but I
never received one. However, I can receive SMS from any other phones
or Internet SMS sending website, so it's probably not a problem on my
side. After a couple of attempts, it started to complain that I have
used this phone number for too many times and wouldn't let me to use
my phone number anymore. I submitted a request through the SMS issue
web page in the FAQ a few days ago, but didn't receive any response
since then. I saw a couple of people posting the same problem: US AT&T
phones, cannot receive anything from google app engine, no response
from the SMS issue web page. But they didn't mention how the problem
was resolved, if it is resolved.

I would appreciate any suggestion. Thanks!

Best regards,
-Michael

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to control the access to a set of static files

2009-03-25 Thread Dong Liu

Thanks for the suggestion.

I think what you mentioned is
http://code.google.com/appengine/docs/python/images/overview.html

I will verify if it is good for my case.

Cheers,

Dong

On Wed, Mar 25, 2009 at 11:20 AM, Barry Hunter
 wrote:
>
> You can actully serve files that 'look' static via a python script.
> And because its a script you can put what ever authenitication method
> you like.
>
> Have a look in the documentation there is a demo if serving images
> dynamically. The images are fetched from the datastore which has the
> benefit you can upload new files without the limitation of the number
> of files etc (but you are subject to datastore limits...)
>
>
>
> On 25/03/2009, Dong  wrote:
>>
>>  Hi,
>>
>>  The application I am developing now need to control the access to a
>>  set of static files (pdfs). I still have no idea about how to achieve
>>  thin in app engine. Can someone point out?
>>
>>  Cheers,
>>
>>  Dong
>>
>>  >
>>
>
> >
>



-- 
http://dongnotes.blogspot.com/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to control the access to a set of static files

2009-03-25 Thread Barry Hunter

You can actully serve files that 'look' static via a python script.
And because its a script you can put what ever authenitication method
you like.

Have a look in the documentation there is a demo if serving images
dynamically. The images are fetched from the datastore which has the
benefit you can upload new files without the limitation of the number
of files etc (but you are subject to datastore limits...)



On 25/03/2009, Dong  wrote:
>
>  Hi,
>
>  The application I am developing now need to control the access to a
>  set of static files (pdfs). I still have no idea about how to achieve
>  thin in app engine. Can someone point out?
>
>  Cheers,
>
>  Dong
>
>  >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] How to control the access to a set of static files

2009-03-25 Thread Dong

Hi,

The application I am developing now need to control the access to a
set of static files (pdfs). I still have no idea about how to achieve
thin in app engine. Can someone point out?

Cheers,

Dong

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Synchronized access to memcache

2009-03-25 Thread ragh...@gmail.com

I am trying to create a 'user activity' queue in memcache. Example:

User1 logged in at time t1
User2 logged out at time t2
User1 played poker at time t3
User1 updated profile at time t4

Data as in above example, is stored in memcache with key name =
"ActivityQueue"

At any given time, I need all the activities done in last 5 minutes. I
have a choice of doing it in data-store but would like to avoid it due
to performance reasons. I don't need persistence for this data.

Unless updates to the ActivityQueue are synchronized, I will lose
certain updated.

Is there a way to synchronize updates to memcache? i.e. at any given
time only one request can append to the queue. Anybody with better
idea on how to do queuing?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to do editing??

2009-03-25 Thread Arun Shanker Prasad

Hi,

If you are using Django framework,

request.POST.get('field_name') will give you the post value.

As to what to use to get the form in edit mode use,

editForm = UserProfileForm(instance=db.get(key))

To use in validation i.e postback,

postbackForm = UserProfileForm(data=request.POST)


Thanks,
Arun Shanker Prasad.

On Mar 25, 9:02 am, arnie  wrote:
> Does there exists a way of accessing the submitted form fields without
> creating an instance of the same like we do in non django based
> project like self.request.get(fieldname)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: django form problems

2009-03-25 Thread Arun Shanker Prasad

Hi,

I think the Django forms by default sets the 'required=True'. If you
want the form to be submitted without any values u need to supply
'required=False'.

wf_first_name = forms.CharField(required=False)

Thanks,
Arun Shanker Prasad.

On Mar 25, 7:51 am, arnie  wrote:
> I am using app engine patch sample and using django template forms.
> Corresponding to the user form, I have created the class as given
> below
> class CreateUserForm(forms.Form):
>         wf_first_name = forms.CharField()
>         wf_last_name = forms.CharField()
>         wf_company = forms.CharField()
>         wf_title = forms.CharField()
>         wf_street_address = forms.CharField()
>
> The template form's field are First Name [id=wf_first_name], Last Name
> [wf_last_name] and so on.
> My problem is that if I submit the form without editing an field on
> the form then inside the function that is handling both the GET and
> the POST request, as shown
> existingUserForm = CreateUserForm(request.POST)
> userDetails = {}
> if(request.method =="POST"):
> if existingUserForm.is_valid():
> The last line always fails
> On the other hand if i submit the form while editing some fields then
> the above code works
> What's going wrong here?
> Thanks
> Arnie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: GQL: Computed column

2009-03-25 Thread Adam

I think that you should add an average_rating field to your  model,
and whenever you update the total_rating and num_of_rating columns,
recompute the average rating and write that to the record as well.
Then, you can query quite simply on the average rating field.  You
will, of course, need to do the retrieval and updating of the record
in a transaction.

On Mar 25, 9:52 am, Will  wrote:
> Hi there,
>
> I have a model like this,
>
> class Rating(db.Model):
>     ...
>     total_rating = db.IntegerProperty(required=True, default=0)
>     num_of_rating = db.IntegerProperty(required=True, default=0)
>
> I'd like to return the top 10 average rating entities, like in SQL:
>     ORDER BY total_rating/num_of_rating DESC           -- suppose
> num_of_rating > 0
>
> Any ideas on how to archive this on GAE/GQL?
>
> Thanks,
>
> Will
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: App Engine Patch - dumpdata then loaddata

2009-03-25 Thread Big Stu

Alright, I think I optimistically read Waldemars note about how
DateTimeProperty was the only property that is supported.  I'll shelf
this for now.  I'll take a stab at this at implementing the other
properties at some point soon.

Stu

On Mar 24, 7:45 pm, Big Stu  wrote:
> Looks like this BadValueError is happening when the deserializer tries
> to parse the "data" field of the "sessions.session" model.
>
> On Mar 24, 7:30 pm, Big Stu  wrote:
>
> > So, I editing the django1.0/core/serializers/python.py file to have
> > the changes mentioned in Issue 70 for Google App Engine Helper, and
> > I'm not getting this error:
>
> > Installing json fixture 'data' from absolute path.
> > Problem installing fixture 'data.json': Traceback (most recent call
> > last):
> >   File "/home/sadohert/development/google_ae/leagr_patch/common/zip-
> > packages/django-1.0.2.zip/django/core/management/commands/
> > loaddata.py", line 116, in handle
> >     for obj in objects:
> >   File "/home/sadohert/development/google_ae/leagr_patch/common/zip-
> > packages/django-1.0.2.zip/django/core/serializers/json.py", line 41,
> > in Deserializer
> >     for obj in PythonDeserializer(simplejson.load(stream)):
> >   File "/home/sadohert/development/google_ae/leagr_patch/common/zip-
> > packages/django-1.0.2.zip/django/core/serializers/python.py", line
> > 119, in Deserializer
> >     data[field.name] = field.validate(field_value)
> >   File "/home/sadohert/development/google_ae/google_appengine/google/
> > appengine/ext/db/__init__.py", line 1910, in validate
> >     'to a Blob instance (%s)' % (self.name, err))
> > BadValueError: Property data must be convertible to a Blob instance
> > (Blob() argument should be str instance, not unicode)
>
> > Could there be something wrong with my setup?  Otherwise I would think
> > there would have been many complaints about this issue already.
> > On Mar 24, 12:42 pm, Big Stu  wrote:
>
> > > I just found out how insanely easy it is to open, edit, and save a
> > > file within a zip file under vim.  I came across it on this link:
>
> > >http://blog.vorpal.cc/category/linux/vim-can-open-zip-files.html
>
> > > On Mar 24, 12:34 pm, Big Stu  wrote:
>
> > > > I'm working with the most recent GAE Patch but still seem to have the
> > > > problem.  This issue here with GAE-Helper describes what I'm seeing
> > > > exactly:
>
> > > > Issue 70:        Deserializer does not decode datetime fields 
> > > > properlyhttp://code.google.com/p/google-app-engine-django/issues/detail?id=70
>
> > > > Is there any convenient way I can setup my development environment so
> > > > django is used in its unzipped form?  This way I can edit pieces and
> > > > see if that solves my problem, without having to unzip django1.0, make
> > > > the edit, and rezip?
>
> > > > Thanks
>
> > > > Stu
>
> > > > On Mar 21, 7:08 am, Waldemar Kornewald  wrote:
>
> > > > > On Mar 20, 3:31 pm, Big Stu  wrote:
>
> > > > > > Hi Waldemar,
> > > > > >   Thanks for following up, and thanks for all your hard work with 
> > > > > > App
> > > > > > Engine Patch.  I'm having a lot of fun learning about app engine and
> > > > > > django in my spare time, and hope to one day move my full time 
> > > > > > career
> > > > > > into this stuff.  Django, GAE, and your stuff will have a huge hand 
> > > > > > in
> > > > > > that.
>
> > > > > > Anyway, the property I'm tryign to dump is DateTimeProperty:
> > > > > > date = db.DateTimeProperty()
>
> > > > > That should work with the repository version.
>
> > > > > Bye,
> > > > > Waldemar Kornewald
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] GQL: Computed column

2009-03-25 Thread Will
Hi there,

I have a model like this,

class Rating(db.Model):
...
total_rating = db.IntegerProperty(required=True, default=0)
num_of_rating = db.IntegerProperty(required=True, default=0)

I'd like to return the top 10 average rating entities, like in SQL:
ORDER BY total_rating/num_of_rating DESC   -- suppose
num_of_rating > 0

Any ideas on how to archive this on GAE/GQL?

Thanks,

Will

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Odd problem with urlfetch from picasa servers

2009-03-25 Thread service G2100
Cache !


2009/3/25 sagasw 

>
> You could try to get with this url
>
>
> http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50/s800/IMG_6776.jpg
>
> If it is successful, I know the reason.
>
>
> On Feb 26, 6:32 pm, "G. Nyman"  wrote:
> > Hello everybody,
> >
> > I have been banging my head against this problem for a while now and I
> > can't seem to understand why it does what it does.
> >
> > I am trying to import pictures from Picasa using the code appended at
> > the end of this post. It works fine in the dev environment but for
> > some reason picasa returns 404 when i try to run it online.
> >
> > The devserver-logs say:
> > INFO 2009-02-26 10:24:35,093 svgae.py] Got the following url:
> http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50...,
> > data was truncated? 0
> > INFO 2009-02-26 10:24:35,093 svgae.py] Big thumb got status 200
> > and lenght: 99720
> > INFO 2009-02-26 10:24:35,108 dev_appserver.py] "GET /
> > no_go_with_picasa HTTP/1.1" 200 -
> >
> > The real thing says:
> > 02-26 02:25AM 24.551 /no_go_with_picasa 200 927ms 951ms-cpu 0kb
> > 130.232.90.98 - - [26/Feb/2009:02:25:25 -0800] "GET /no_go_with_picasa
> > HTTP/1.1" 200 104 - -
> > I 02-26 02:25AM 25.473
> > Got the following url:
> http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50...,
> > data was truncated? 0
> > I 02-26 02:25AM 25.474
> > Big thumb got status 404 and lenght: 1421
> >
> > This might be a picasa problem but I tought I'll try here first. The
> > url to the photo works in both cases so I don't understand the 404.
> > The most interesting thing is that urlfetch on photo.media.thumbnail
> > [0].url works fine.
> >
> > Thankfull for all assistance
> >
> > /G. Nyman
> >
> > Code to replicate the problem:
> > ---
> > class PicasaProblem(webapp.RequestHandler):
> > def get(self):
> > gd_client = gdata.photos.service.PhotosService()
> > gdata.alt.appengine.run_on_appengine(gd_client)
> > username = 'tehviu'
> > albumid = 'SigmaTest'
> > photos = gd_client.GetFeed(
> > '/data/feed/api/user/%s/album/%s?
> > kind=photo&thumbsize=64,1024&imgmax=d' % (
> > username, albumid))
> > for photo in photos.entry:
> > img_thumb_big = None
> > try:
> > img_thumb_big =
> urlfetch.fetch(photo.media.thumbnail[1].url)
> > except Exception, e:
> > logging.exception(e)
> > error = 'Image importing error'
> >
> > logging.info("Got the following url: " +
> photo.media.thumbnail
> > [1].url + ", data was truncated? " + str
> > (img_thumb_big.content_was_truncated))
> > logging.info("Big thumb got status "+ str
> > (img_thumb_big.status_code) + " and lenght: " + img_thumb_big.headers
> > ['content-length'])
> > break
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Odd problem with urlfetch from picasa servers

2009-03-25 Thread sagasw

You could try to get with this url

http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50/s800/IMG_6776.jpg

If it is successful, I know the reason.


On Feb 26, 6:32 pm, "G. Nyman"  wrote:
> Hello everybody,
>
> I have been banging my head against this problem for a while now and I
> can't seem to understand why it does what it does.
>
> I am trying to import pictures from Picasa using the code appended at
> the end of this post. It works fine in the dev environment but for
> some reason picasa returns 404 when i try to run it online.
>
> The devserver-logs say:
> INFO     2009-02-26 10:24:35,093 svgae.py] Got the following 
> url:http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50...,
> data was truncated? 0
> INFO     2009-02-26 10:24:35,093 svgae.py] Big thumb got status 200
> and lenght: 99720
> INFO     2009-02-26 10:24:35,108 dev_appserver.py] "GET /
> no_go_with_picasa HTTP/1.1" 200 -
>
> The real thing says:
> 02-26 02:25AM 24.551 /no_go_with_picasa 200 927ms 951ms-cpu 0kb
> 130.232.90.98 - - [26/Feb/2009:02:25:25 -0800] "GET /no_go_with_picasa
> HTTP/1.1" 200 104 - -
> I 02-26 02:25AM 25.473
> Got the following 
> url:http://lh6.ggpht.com/_mUcXljy1w9g/SaQ-uXbkY4I/ACE/DJtdqCz6u50...,
> data was truncated? 0
> I 02-26 02:25AM 25.474
> Big thumb got status 404 and lenght: 1421
>
> This might be a picasa problem but I tought I'll try here first. The
> url to the photo works in both cases so I don't understand the 404.
> The most interesting thing is that urlfetch on photo.media.thumbnail
> [0].url works fine.
>
> Thankfull for all assistance
>
> /G. Nyman
>
> Code to replicate the problem:
> ---
> class PicasaProblem(webapp.RequestHandler):
>         def get(self):
>                 gd_client = gdata.photos.service.PhotosService()
>                 gdata.alt.appengine.run_on_appengine(gd_client)
>                 username = 'tehviu'
>                 albumid = 'SigmaTest'
>                 photos = gd_client.GetFeed(
>                     '/data/feed/api/user/%s/album/%s?
> kind=photo&thumbsize=64,1024&imgmax=d' % (
>                         username, albumid))
>                 for photo in photos.entry:
>                         img_thumb_big = None
>                         try:
>                                 img_thumb_big = 
> urlfetch.fetch(photo.media.thumbnail[1].url)
>                         except Exception, e:
>                                 logging.exception(e)
>                                 error = 'Image importing error'
>
>                         logging.info("Got the following url: " + 
> photo.media.thumbnail
> [1].url + ", data was truncated? " + str
> (img_thumb_big.content_was_truncated))
>                         logging.info("Big thumb got status "+ str
> (img_thumb_big.status_code) + " and lenght: " + img_thumb_big.headers
> ['content-length'])
>                         break
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Accessing the datastore remotely with remote_api

2009-03-25 Thread service G2100
It will be wonderful If google can provide the remote access from GAE for
billing account.

Best Regards
Tom Wu


2009/3/25 service G2100 

> Hi lan,
>
> According to the TOS.
> Does it mean app engine only for small application ?
> No scaling structure will approve by google ?
>
> Is any possibility for pay user like amazon EC2 and simpledb ?
>
> Thanks.
>
>
> Best Regards
> Tom Wu
>
>
>
>
> 2009/3/25 Ian Lewis 
>
>
>> Tom,
>>
>> You can't use the remote api from appengine. It's for use in accessing
>> the data from applications outside appengine.
>>
>> AFAICT, trying to connect multiple apps to a single datasource to get
>> around resource limitations is a violation of google's terms of
>> service. You might want to take a look at them.
>>
>> http://code.google.com/appengine/terms.html
>>
>> Ian
>>
>> On Wed, Mar 25, 2009 at 7:32 PM, service G2100 
>> wrote:
>> > Yes, I am trying to use remote_api from GAE.
>> >
>> > Since each application has resource limitation.
>> >
>> > Just trying to use multiple apps to connect single data source.
>> >
>> >
>> > Best Regards
>> > Tom Wu
>> >
>> >
>> > 2009/3/25 GregF 
>> >>
>> >> It sounds like you are trying to use remote_api from GAE,  rather than
>> >> your local machine. GAE libraries have sockets locked down to prevent
>> >> abuse, which may be the source of your problem. On GAE, the only
>> >> network option you have is url_fetch.
>> >>
>> >>
>> >>
>> >
>> >
>> > >
>> >
>>
>>
>>
>> --
>> ===
>> 株式会社ビープラウド  イアン・ルイス
>> 〒150-0012
>> 東京都渋谷区広尾1-11-2アイオス広尾ビル604
>> email: ianmle...@beproud.jp
>> TEL:03-5795-2707
>> FAX:03-5795-2708
>> http://www.beproud.jp/
>> ===
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Contacting Appengine Team

2009-03-25 Thread Makeable

Thank you kindly Marzia.

Brgds,

Matt Williams

On Jan 28, 1:11 pm, Marzia Niccolai  wrote:
> Hi Matt,
>
> I believe the issue should now be sorted out with the email with which
> you are writing from. You should be able to sign in to App Engine and
> create apps here:http://appengine.google.com/a/makeable.co.uk
>
> -Marzia
>
>
>
> On Mon, Jan 26, 2009 at 10:36 PM, Makeable  wrote:
>
> > Hello All,
>
> > Im keen to get started with AppEngine. Unfortunately, I decided to
> > delete the account I first registered with as I have moved to google
> > apps and planned to use my account as registered there. Now I am
> > unable to recreate the account as my mobile has already been used.
>
> > Would anyone be so kind as to provide me with a method of contacting
> > someone so I may get this resolved? I did try the SMS issue reporting,
> > but there appears to be problems if you have more than a handful of
> > characters in the comments box.
>
> > Kind Regards,
>
> > Matt Williams
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Access external resources with IP block from GAE

2009-03-25 Thread Neves

I am curious if GAE would add payed fixed ip address like Amazon did.

On 24 mar, 06:28, Alars  wrote:
> Hi all,
>
> My GAE app needs to access an external service wich uses an IP check.
> Is it possible to use a static IP with GAE or does anyone have an idea
> for a workaround? (I dont want to pay for a service that can act as a
> proxy)
>
> Cheers!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Does anyone know how to implement a file upload progress bar

2009-03-25 Thread Neves

Since GAE returns the server response only when its complete,
the only way to do file upload progress is using Flash, like in
http://swfupload.org/

On 25 mar, 02:05, ni  wrote:
> I am trying to add a file update functionality to my application and
> it works fine.  However, when loading large files there is no way to
> tell the user about the progress of the file upload process. I have
> seen some postings elsewhere about how to do this using PHP and AJAX,
> but nothing that would seem to work with GAE.  Anyone know how to do
> this in GAE and some sample code?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Accessing the datastore remotely with remote_api

2009-03-25 Thread service G2100
Hi lan,

According to the TOS.
Does it mean app engine only for small application ?
No scaling structure will approve by google ?

Is any possibility for pay user like amazon EC2 and simpledb ?

Thanks.


Best Regards
Tom Wu




2009/3/25 Ian Lewis 

>
> Tom,
>
> You can't use the remote api from appengine. It's for use in accessing
> the data from applications outside appengine.
>
> AFAICT, trying to connect multiple apps to a single datasource to get
> around resource limitations is a violation of google's terms of
> service. You might want to take a look at them.
>
> http://code.google.com/appengine/terms.html
>
> Ian
>
> On Wed, Mar 25, 2009 at 7:32 PM, service G2100 
> wrote:
> > Yes, I am trying to use remote_api from GAE.
> >
> > Since each application has resource limitation.
> >
> > Just trying to use multiple apps to connect single data source.
> >
> >
> > Best Regards
> > Tom Wu
> >
> >
> > 2009/3/25 GregF 
> >>
> >> It sounds like you are trying to use remote_api from GAE,  rather than
> >> your local machine. GAE libraries have sockets locked down to prevent
> >> abuse, which may be the source of your problem. On GAE, the only
> >> network option you have is url_fetch.
> >>
> >>
> >>
> >
> >
> > >
> >
>
>
>
> --
> ===
> 株式会社ビープラウド  イアン・ルイス
> 〒150-0012
> 東京都渋谷区広尾1-11-2アイオス広尾ビル604
> email: ianmle...@beproud.jp
> TEL:03-5795-2707
> FAX:03-5795-2708
> http://www.beproud.jp/
> ===
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Accessing the datastore remotely with remote_api

2009-03-25 Thread Ian Lewis

Tom,

You can't use the remote api from appengine. It's for use in accessing
the data from applications outside appengine.

AFAICT, trying to connect multiple apps to a single datasource to get
around resource limitations is a violation of google's terms of
service. You might want to take a look at them.

http://code.google.com/appengine/terms.html

Ian

On Wed, Mar 25, 2009 at 7:32 PM, service G2100  wrote:
> Yes, I am trying to use remote_api from GAE.
>
> Since each application has resource limitation.
>
> Just trying to use multiple apps to connect single data source.
>
>
> Best Regards
> Tom Wu
>
>
> 2009/3/25 GregF 
>>
>> It sounds like you are trying to use remote_api from GAE,  rather than
>> your local machine. GAE libraries have sockets locked down to prevent
>> abuse, which may be the source of your problem. On GAE, the only
>> network option you have is url_fetch.
>>
>>
>>
>
>
> >
>



-- 
===
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianmle...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
===

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Accessing the datastore remotely with remote_api

2009-03-25 Thread service G2100
Yes, I am trying to use remote_api from GAE.

Since each application has resource limitation.

Just trying to use multiple apps to connect single data source.


Best Regards
Tom Wu


2009/3/25 GregF 

>
> It sounds like you are trying to use remote_api from GAE,  rather than
> your local machine. GAE libraries have sockets locked down to prevent
> abuse, which may be the source of your problem. On GAE, the only
> network option you have is url_fetch.
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: open source app engine

2009-03-25 Thread GregF

Thanks for publicising this - it is excellent news and will make
developers less nervous about dipping their toes into GAE.

It is also testament to Google's corporate ethics that they are
supporting this project - just imagine the storm of lawsuits that
would land on anyone trying to do this with Azure...

On Mar 25, 12:32 pm, Andy Freeman  wrote:
> I haven't seen any mention of appscalehttp://code.google.com/p/appscale/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Accessing the datastore remotely with remote_api

2009-03-25 Thread GregF

It sounds like you are trying to use remote_api from GAE,  rather than
your local machine. GAE libraries have sockets locked down to prevent
abuse, which may be the source of your problem. On GAE, the only
network option you have is url_fetch.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Ideas for a bit more advanced search

2009-03-25 Thread Robert

Hi,

Interesting issue. I think that you have problems scaling this as the
inequality filter on query for Keywords will actually result in a set
of queries. I'm trying an alternative approach, but to meet some
possible slightly different requirements.
I create a db record "IndexTerm" for each keyword and use that keyword
as the key_name for that record. Each IndexTerm has a field
"referents"; a db.Text field that contains a space separated list of
key names to the objects (in your case documents) that have this
keyword.
Indexing a document is a bit of a job as for each term we need to walk
the list_as_string to check if the doc's keyname is already there. But
we can write all relevant IndexTerms in one db.put() operation.
Searching is fast though as we simply fetch all IndexTerms with the
requested keywords; this is one db.get() operation with db.Keys
constructed form the keywords. Then need to walk the lists of
referents and do some ranking. I used db.Text to avoid additional
indexing by the GAE database.
This approach works well for my purposes but it also has some issues:
the main problem is that the list of referents will get long,
especially for "popular" terms. I'm trying to partition that list,
e.g. by type of object (which works in my domain, but probably not in
others), e.g. "email docs" and "blog posts" could have their own lists
or their own IndexTerms class.

On Feb 23, 6:41 pm, Steffen 'stefreak' Neubauer 
wrote:
> I hacked something together, with google-like syntax, but its not
> really satisfying my needs because of index.yaml-problems. But here is
> it, maybe its helpful to someone else.
> Possible search terms are:
>  debian lenny
>  "debian lenny"
>  debian -lenny (this is not really working as expected at the moment)
>
> models.py:http://nopaste.biz/67482
> views.py:http://nopaste.biz/67481
>
> Example:http://stefreakstest.appspot.com/
>
>  signature.asc
> < 1KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---