[google-appengine] Re: GAE datastore insertion rate
I got the contention errors, during my first run, using a ReferenceProperty to link a Note to a Device (not a parent). Only after I watched Brett's presentation did I add the device group entity and parent=device code. Adding the device group entity and parent=device code, seems to have solved the "too much contention for these entities" problem. Quote From 'Keys and Entity Groups': http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths "The more entity groups your application has—that is, the more root entities there are—the more efficiently the datastore can distribute the entity groups across datastore nodes." Brett does a great job of describing this in his presentation: http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine For me, having all the notes from a device grouped together on a datastore node is great. I process the notes in sequence, but, I'd like to process the devices in parallel. This is where I'm looking for scalability, across the devices. I need to inform the App Engine that its ok to process these (notes) in sequence, but handle these (devices) in parallel. Making the device group entity seems to have done that. Thank you for your help, -David Story --~--~-~--~~~---~--~~ 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: GAE datastore insertion rate
Hi David, accordingly with http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html#Entity_Groups_Ancestors_and_Paths "An entity without a parent is a root entity"... so you don't need to associate each note to a parent... I'm wondering... when you got these contention errors, were you assiging a parent to the notes (entity groups) ? if that is the case, then you were using a single entity group ! On Jan 27, 12:03 am, iDavid wrote: > After watching Brett's video, the answer became > clear.http://sites.google.com/site/io/building-scalable-web-applications-wi... > > Create a group entity for each device. Then all device's can > have their notes inserted in parallel. > > I will give this a try and report back. > > -David Story --~--~-~--~~~---~--~~ 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: Permanent Unique User Identifier (part 2)
The openid solution is as easy to use as the user api for appengine. In my implementation, I direct the users using a "Login using Google" link, which sends them to a google page where they click a Continue to sign in button, which sends them back to my site where I finish handling the openid authentication process. On Jan 27, 8:31 pm, Ryan Lamansky wrote: > I'm aware of the OpenID option, but I'm concerned about having to > train users how to use it. Ease of use is critical. > > The ability to migrate off App Engine isn't useful to me because I > could never cost effectively reach the same level of scalability. > > -Ryan > > On Jan 26, 5:21 pm, "bowman.jos...@gmail.com" > > wrote: > > As someone suggested in that thread, I'd suggest you look at Google > > Openid. I went this route because it also offers a way for you to > > persist your user identity if you move your domain off of appengine. > > > On Jan 26, 5:22 pm, Ryan Lamansky wrote: > > > > As a follow-up to this thread > > > here:http://groups.google.com/group/google-appengine/browse_thread/thread/... > > > > I've created a defect report > > > here:http://code.google.com/p/googleappengine/issues/detail?id=1019 > > > > I'm really hoping Google can do something, as I'm hesitant to proceed > > > with any of my App Engine ideas knowing that my users are going to get > > > burned :| > > > > -Ryan --~--~-~--~~~---~--~~ 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: Googe App Engine and Friend Connect...
Thanks sir! It worked for me. It was great help. Regards Anand On Jan 11, 6:13 am, Jove wrote: > Hi benzrad, > > Go ahead adding that code to your app.yaml. It works for my site on > GAE. > > Few more informations: > * I put the canvas.htmland rpc_relay.htmlon %AppHome%/media/ folder > * Add the following code at the begining of app.yaml. Make sure those > handles are registered **before** other python/django handlers > - url: /canvas.html > static_files: media/canvas.html > upload: media/canvas.html > > - url: /rpc_relay.html > static_files: media/rpc_relay.html > upload: media/rpc_relay.html > > * test on your local server. It should work. Then upload to GAE to > check the live gadget > > On Jan 4, 10:12 am, benzrad wrote: > > > i tried the code, but it don't work on my app athttp://app21zh.appspot.com > > .in friend connect in the process to setup the site, it still reported > > can't find the 2files, which i had place all over includingstatic > > folder. > > i need more instruction.TIA. > > > On Jan 1, 3:56 pm, "Shalin Shekhar Mangar" > > wrote: > > > > You can add them inside the "static" directory. You must also map them to > > > '/' (root) by adding the following in your app.yaml file. > > > > - url: /canvas.html > > > static_files:static/canvas.html > > > upload:static/canvas.html > > > > - url: /rpc_relay.html > > > static_files:static/rpc_relay.html > > > upload:static/rpc_relay.html > > > > Hope that helps. > > > > On Mon, Dec 29, 2008 at 7:21 AM, benzrad wrote: > > > > > dear sir, > > > > i also want to add google friend connect onto my GAE, but where > > > > directory should i place the 2 file google asked for uploading, ie., > > > > canvas.html&rpc_relay.html? i place them on the root folder of my > > > > app, also place them in thestaticfolder with otherhtmlfiles, but > > > > neither working, ie, the setup process of google friend connect can't > > > > find them. where and how to setup in the py file to let the 2html > > > >filescan be found on root folder? i absolutely bland on python code, > > > > but i try to learn.p help me out. > > > > -- > > > Regards, > > > Shalin Shekhar Mangar. --~--~-~--~~~---~--~~ 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: Complex tagging of items
This is what I have right now for simple 'tag1 OR tag2' cases. But how do you efficiently retrieve items for 'tag1 AND (tag2 OR tag3) AND NOT tag4' with this model? On Jan 27, 12:59 am, Seronja wrote: > Here's where old good relational databases theory comes in. > > How will I do it: > Create a model ``Tags'': > class Tags(db.Model): > tag_name = db.StringProperty() > Create a model ``Items'': > class Items(db.Model): > item_name = db.StringProperty() > And create a model ``ItemTags'' > class ItemTags(db.model): > tag = db.ReferenceProperty(Tags) > item = db.ReferenceProperty(Items) > > So when you need to get items for some tags you first query the > ``ItemTags'' for items with concrete tag(s) thgan by key you get > Items. > > Cheers, > Serhiy > > On Jan 24, 3:17 am, George Sudarkoff wrote: > > > I have a bit of a problem coming up with an efficient data model/algo > > for a project I am working on: > > > I have a few hundred items, each tagged with zero or more tags. I need > > to be able to fetch items that, for example, are tagged with tag1 AND > > (tag2 OR tag3) AND NOT tag4. > > > Any help would be greatly appreciated! --~--~-~--~~~---~--~~ 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: Complex tagging of items
On Jan 25, 11:17 pm, ryan wrote: > On Jan 25, 11:43 am, Anthony wrote: > > > If you store the tags as a StringList wouldn't this query work.. > > > WHERE tags = tag1 AND tags IN [tag2,tag3] AND tags != tag4 > > > From the docs it says the IN & != do run multiple queries behind the > > scenes so not sure if it will be as quick as running it in memory for > > a few hundred items, but if you need more than a few hundred items you > > are not going to be able to do it in memory before it starts timing > > out. > > good call, anthony! that query does indeed do what george wants, and > you're right about how != and IN work behind the scenes. > > the problem with that query, unfortunately, is that it needs this > index: > > - kind: Foo > properties: > - name: tags > - name: tags > - name: tags > > ...which is almost certain to explode on entities with any more than a > handful of tags: > > http://code.google.com/appengine/docs/python/datastore/queriesandinde... Very cool! On average I won't have more than 2-3 tags per item, so I really think this solution might work! I'll try it and report back the results. --~--~-~--~~~---~--~~ 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] A possible way to improve this Google Group
I hope this is in compliance with posting rules etc etc and I know that it is not usually a good sign to start off with such a sentence, so I'll cut to the chase: I have about 20 beta invites available for a service called Aardvark. Aardvark is new application that facilitates user-to-user questions and answers. Users can both ask and answer questions. Upon registration, users list their areas of expertise. Questions relating to those areas are routed to them. All of this can take place via IM, GChat, and a UI on their web site. You can read more here: http://venturebeat.com/2008/11/05/social-search-product-aardvark-think-yahoo-answers-meets-twitter-but-better/ I think it would be neat if a sizable portion of the Google App Engine Google Group signed up for this service and listed Google App Engine as an area of expertise. I am willing to give away about 10 invites on this group, the only condition is that you *promise* to use your beta invites to invite others from this Google Group as well. In case you were wondering, the other 10 invites will go to the Django Users Group ;) Simply reply or private message me with your email address and I'll get you set up. Thanks, and I apologize if I broke any rules, Alan --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
I do know of a company that may offer a similar service, but for Ruby: http://devver.net/ . They are part of the TechStars incubator, I believe. On Jan 27, 5:58 pm, ryan wrote: > On Jan 27, 9:11 am, Peter Cooper > wrote: > > > I believe in diversity and to prove it I admit I once used pico and pine. > > wait, you admit? as in, there's something wrong with them now? :P > > http://snarfed.org/space/gmail+vs+pine --~--~-~--~~~---~--~~ 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: Permanent Unique User Identifier (part 2)
I'm aware of the OpenID option, but I'm concerned about having to train users how to use it. Ease of use is critical. The ability to migrate off App Engine isn't useful to me because I could never cost effectively reach the same level of scalability. -Ryan On Jan 26, 5:21 pm, "bowman.jos...@gmail.com" wrote: > As someone suggested in that thread, I'd suggest you look at Google > Openid. I went this route because it also offers a way for you to > persist your user identity if you move your domain off of appengine. > > On Jan 26, 5:22 pm, Ryan Lamansky wrote: > > > As a follow-up to this thread > > here:http://groups.google.com/group/google-appengine/browse_thread/thread/... > > > I've created a defect report > > here:http://code.google.com/p/googleappengine/issues/detail?id=1019 > > > I'm really hoping Google can do something, as I'm hesitant to proceed > > with any of my App Engine ideas knowing that my users are going to get > > burned :| > > > -Ryan --~--~-~--~~~---~--~~ 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: GAE datastore insertion rate
Thank you for your suggestions, I really appreciate them. My load test is sending data exactly as the physical devices in the field would do. Each device will send 4 Notes per POST, once a minute (a note every 15 seconds). I did not know about the "batch-put", I will make the necessary code changes for that. (Thank you Brett) I'm grouping the notes with the devices they came from. My first implementation, simply used the ReferenceProperty(), but quickly ran into the"too much contention for these entities" problem on the Note entity. Afterwatching Brett's presentation on "sharding", I thought I'd get moreparallelizm by making the devices a group entity and putting the notes in them. Which seemed to work, until I hit my quota. It's ok if the device group entity is 'locked' while inserting notes associated with it. Each physical device is unique, and it will only make one POST at a time. My goal is to be able to handle each device in parallel. If this works out, I'd like to run a 1 hour load test with 5,000 devices, to come up with a cost model for my company. I expect the number of devices to grow over the coming year, and need a scalable system to support this load. Thank you, -David Story --~--~-~--~~~---~--~~ 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: GAE datastore insertion rate
Why do you put all nodes for a device in one entity group (same parent node)? Entity groups should be kept small (in most cases) because you lock all members of the group if you do a put() on one of them. Only use entity groups if you need some transaction function to do the update on some of the group members or you need the parent / grandparent relation. All members of an entity group are stored on the same Bigtable "disk" (no possibility for distributed storage for members in an entity group). Why don't you add a ReferenceProperty to the node class? [1] This property references the device object you now set as parent. For a query you now select on this ReferenceProperty instead of selecting for parent. This is what the back-reference property is doing behind the scene, construct a Query object that filters on the ReferenceProperty. [1] http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html#References --~--~-~--~~~---~--~~ 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] Django Custom Authentication Backend (with app-engine-patch)
I'm trying to write a custom authentication backend for Django, as described here: http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authentication-backend I started with the simple "SettingsBackend" example in the docs, and that doesn't even work. As soon as I try to construct a User object, it's like the code just stops running. Nothing after this gets run, and no exception is raised. Yet the login page renders properly and says "Invalid Login". I'm totally stumped, and don't even understand how this is possible. Any suggestions? P.S. Haven't even tried in the cloud yet. This is just with local runserver. --~--~-~--~~~---~--~~ 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] Debug with pdb + Django + app-engine-patch ?
I can't get pdb to work with Django + app-engine-patch. When I do this in my code: import pdb pdb.set_trace() I get a stack trace printed to the console with a "BdbQuit" exception, but the (Pdb) prompt itself is written to the HTML output with the HTML for the Debug error page immediately following. No interactive prompt ever comes up. Am I missing a step? --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
On Jan 27, 9:11 am, Peter Cooper wrote: > I believe in diversity and to prove it I admit I once used pico and pine. wait, you admit? as in, there's something wrong with them now? :P http://snarfed.org/space/gmail+vs+pine --~--~-~--~~~---~--~~ 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: API calls/minute quotas
> @boson > Yeah, I know, but I'm referring to the burst quotas, which are not > visible anywhere (unless you count the high CPU usage quota, which > probably works similarly to the burst quotas.) I'm assuming there is > one burst quota per API (datastore, images, ...) > > Basically these quotas are small but refresh very quickly, so once a > spike in usage occurs, the site will run out of quota, but in a few > minutes when things have calmed down, the site will be able to operate > again. You can see when you're hitting burst quotas on the "Quota Details" page. The "Rate" column will change to "Limited" when you've hit a burst limit or if you've completely consumed a quota for the day. --~--~-~--~~~---~--~~ 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 Console 1.0beta3 released
This is great stuff! This and gaebar go a LONG way toward making production apps more manageable. Thanks! On Jan 23, 12:28 am, Jason Smith wrote: > Hi, Group. > > I am pleased to announce the release of App EngineConsoleversion > 1.0beta3. Please seehttp://con.appspot.com/for demos, documentation, > and downloads. > > App EngineConsoleis an interactive Python session running in the > server, which you use from a web browser. Designed to be embedded > within App Engine projects, theconsoleassists developers with > testing and debugging their code and data in both development and > production settings. > > New changes to App EngineConsole: > > * Support the SDK version 1.1.8 > * Full support for Firefox, Chrome, Safari, and Internet Explorer > browsers > * Several bug fixes and unit tests > > Thanks very much to everybody who has emailed me with bug reports, > comments, and other feedback. Future plans for App EngineConsole > include persistent sessions, simultaneous sessions (i.e. > “copiloting”), and autocompletion; and I am eager to hear ideas from > other App Engine developers. --~--~-~--~~~---~--~~ 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: API calls/minute quotas
@Marzia Thanks, I'll be sure to fire off a message once I actually need the extra quota (right now I was just simulating high usage so I can live without it for a while longer =) @boson Yeah, I know, but I'm referring to the burst quotas, which are not visible anywhere (unless you count the high CPU usage quota, which probably works similarly to the burst quotas.) I'm assuming there is one burst quota per API (datastore, images, ...) Basically these quotas are small but refresh very quickly, so once a spike in usage occurs, the site will run out of quota, but in a few minutes when things have calmed down, the site will be able to operate again. This is a smart concept but I seem to be hitting this limit fairly quickly and I wish I could see how quickly I spend the quota and how fast it replenishes, so I can make an estimate on the number of concurrent users I can support. Regards, Andreas On Jan 27, 7:15 pm, boson wrote: > On Jan 27, 12:04 am, Blixt wrote: > > > I hope these quotas will be visible in the future so > > that they can be monitored, and that there will be options to extend > > these quotas. > > FYI there is a page in the App Engine admin console that shows all > your quota and gives up-to-the-minute monitoring, including 4 separate > Image-related quotas. > > Go to:http://appengine.google.com/ > > Select your app, then select "Quota Details" in the left column. --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
There was a presenter at TC50 who had something like this for open- source apps. http://devunity.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: API calls/minute quotas
On Jan 27, 12:04 am, Blixt wrote: > I hope these quotas will be visible in the future so > that they can be monitored, and that there will be options to extend > these quotas. FYI there is a page in the App Engine admin console that shows all your quota and gives up-to-the-minute monitoring, including 4 separate Image-related quotas. Go to: http://appengine.google.com/ Select your app, then select "Quota Details" in the left column. --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
Yes, I looked at New Zoho and I certainly did not mean to imply disparagement of the product. I believe in diversity and to prove it I admit I once used pico and pine. Cloud based IDE would be nice for a scenario where there were coders, test engineers, and managers all in different locations without any way to walk into each other's office. Version control in the Cloud -- how would that work? On Tue, Jan 27, 2009 at 8:58 AM, adelevie wrote: > > Peter, that is what I had in mind. Although, I must say I am quite > impressed with this New Zoho product. I think there is room for both > such products. > One is meant for ultra-fast, noob-friendly deployment and the other > would be meant for coders who would like programming to be as > convenient as Gmail (the gateway drug to web 2.0 :) ) > > On Jan 27, 11:49 am, Peter Cooper > wrote: > > I get the impression that what adelevie was after was an app that lives > on > > appspot.com with .py, .yaml, etc., in datastore, that would be > accessible > > from the cloud with the proper authentication, but would be an IDE for > GAE > > only. No more dev_appserver.py or appcfg.py or the accoutrements > therewith, > > for them that want the GAE IDE on appspot.com. Does that comport with > what > > you meant adelevie? > > > > On Tue, Jan 27, 2009 at 8:43 AM, kang wrote: > > > Zoho Creator got an update today with a new feature that lets you > deploy > > > your Zoho Creator applications to Google App Engine. > > > > http://blogs.zoho.com/general/zoho-creator-deploys-to-google-app-engine/ > > > > > On Tue, Jan 27, 2009 at 8:34 AM, adelevie wrote: > > > > >> Does anyone else agree that a web-based IDE for GAE would be awesome? > > >> Thoughts? > > >> How can this be done? > > >> I'm thinking Google could whip out a pretty neat solution--maybe using > > >> a Google Docs-like text editor and an ajaxy file system. > > > > > -- > > > Stay hungry,Stay foolish. > > > --~--~-~--~~~---~--~~ 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: Basic Question concerning "def get(self) and def post(self)"
Just to clarify, > [...] The other, most common, request is POST, which means [...] By the above I did not mean to imply that POST is the most common request (that would be GET --- POST would be second; for most sites, anyways), I just meant that it's the other one of the most common requests. Regards, Andreas On Jan 27, 6:06 pm, Blixt wrote: > Yes, def does define a function. Your functions must be called "get" > to handle GET requests and "post" to handle POST requests. Here's a > short explanation: > > When a HTTP request is received and directed to your request handler > (MainPage in this case), the application will call the appropriate > function on your request handler. > > The "appropriate function" is determined by the type of the HTTP > request. Most requests are GET requests, which means the client is > simply requesting the contents at a particular address. The other, > most common, request is POST, which means the client is requesting an > address, but it's got some data to deliver first (such as the contents > of a form.) > > So if you type in an address in your browser that goes to the MainPage > request handler, the application will attempt to call its "get" > function. If you have a form on the page with the attribute > method="post", your browser will perform a POST request to the page > with the contents of the form. This will call the "post" function. > > There are also other, less common HTTP requests such as HEAD and PUT, > but you barely ever have to worry about those. > > Regards, > Andreas > > On Jan 27, 2:56 pm, 0815pascal wrote: > > > Hello, > > > I'm new to google app engine and also new to python. I don't > > understand why you have to code it like this: > > > class MainPage(webapp.RequestHandler): > > def get(self): > > > I thought that def would define a function. But if I label it > > different then get or post it doesn't work. Can somebody give me a > > basic idea? --~--~-~--~~~---~--~~ 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: Basic Question concerning "def get(self) and def post(self)"
Yes, def does define a function. Your functions must be called "get" to handle GET requests and "post" to handle POST requests. Here's a short explanation: When a HTTP request is received and directed to your request handler (MainPage in this case), the application will call the appropriate function on your request handler. The "appropriate function" is determined by the type of the HTTP request. Most requests are GET requests, which means the client is simply requesting the contents at a particular address. The other, most common, request is POST, which means the client is requesting an address, but it's got some data to deliver first (such as the contents of a form.) So if you type in an address in your browser that goes to the MainPage request handler, the application will attempt to call its "get" function. If you have a form on the page with the attribute method="post", your browser will perform a POST request to the page with the contents of the form. This will call the "post" function. There are also other, less common HTTP requests such as HEAD and PUT, but you barely ever have to worry about those. Regards, Andreas On Jan 27, 2:56 pm, 0815pascal wrote: > Hello, > > I'm new to google app engine and also new to python. I don't > understand why you have to code it like this: > > class MainPage(webapp.RequestHandler): > def get(self): > > I thought that def would define a function. But if I label it > different then get or post it doesn't work. Can somebody give me a > basic idea? --~--~-~--~~~---~--~~ 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: Basic Question concerning "def get(self) and def post(self)"
read pages 91-93 of "Python Essential Reference", 3rd ed., by the honorable David M. Beazley. Depending on your use of parameters or decorators, self is a parameter and you need it for the namespace reference. On Tue, Jan 27, 2009 at 5:56 AM, 0815pascal wrote: > > Hello, > > I'm new to google app engine and also new to python. I don't > understand why you have to code it like this: > > class MainPage(webapp.RequestHandler): > def get(self): > > I thought that def would define a function. But if I label it > different then get or post it doesn't work. Can somebody give me a > basic idea? > > > > --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
Peter, that is what I had in mind. Although, I must say I am quite impressed with this New Zoho product. I think there is room for both such products. One is meant for ultra-fast, noob-friendly deployment and the other would be meant for coders who would like programming to be as convenient as Gmail (the gateway drug to web 2.0 :) ) On Jan 27, 11:49 am, Peter Cooper wrote: > I get the impression that what adelevie was after was an app that lives on > appspot.com with .py, .yaml, etc., in datastore, that would be accessible > from the cloud with the proper authentication, but would be an IDE for GAE > only. No more dev_appserver.py or appcfg.py or the accoutrements therewith, > for them that want the GAE IDE on appspot.com. Does that comport with what > you meant adelevie? > > On Tue, Jan 27, 2009 at 8:43 AM, kang wrote: > > Zoho Creator got an update today with a new feature that lets you deploy > > your Zoho Creator applications to Google App Engine. > >http://blogs.zoho.com/general/zoho-creator-deploys-to-google-app-engine/ > > > On Tue, Jan 27, 2009 at 8:34 AM, adelevie wrote: > > >> Does anyone else agree that a web-based IDE for GAE would be awesome? > >> Thoughts? > >> How can this be done? > >> I'm thinking Google could whip out a pretty neat solution--maybe using > >> a Google Docs-like text editor and an ajaxy file system. > > > -- > > Stay hungry,Stay foolish. --~--~-~--~~~---~--~~ 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] Basic Question concerning "def get(self) and def post(self)"
Hello, I'm new to google app engine and also new to python. I don't understand why you have to code it like this: class MainPage(webapp.RequestHandler): def get(self): I thought that def would define a function. But if I label it different then get or post it doesn't work. Can somebody give me a basic idea? --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
I get the impression that what adelevie was after was an app that lives on appspot.com with .py, .yaml, etc., in datastore, that would be accessible from the cloud with the proper authentication, but would be an IDE for GAE only. No more dev_appserver.py or appcfg.py or the accoutrements therewith, for them that want the GAE IDE on appspot.com. Does that comport with what you meant adelevie? On Tue, Jan 27, 2009 at 8:43 AM, kang wrote: > Zoho Creator got an update today with a new feature that lets you deploy > your Zoho Creator applications to Google App Engine. > http://blogs.zoho.com/general/zoho-creator-deploys-to-google-app-engine/ > > On Tue, Jan 27, 2009 at 8:34 AM, adelevie wrote: > >> >> Does anyone else agree that a web-based IDE for GAE would be awesome? >> Thoughts? >> How can this be done? >> I'm thinking Google could whip out a pretty neat solution--maybe using >> a Google Docs-like text editor and an ajaxy file system. >> >> > > > -- > Stay hungry,Stay foolish. > > > > --~--~-~--~~~---~--~~ 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: Serving static files
That did the trick. Thank you [both] On Jan 26, 2:50 am, Blixt wrote: > Looks to me like there's three spaces in front of "static_dir: > static". Try removing one of the spaces so that there are only two. > > Regards, > Andreas > > On Jan 26, 5:41 am, James Ashley wrote: > > > I feel like a complete idiot. > > > Here's my app.yaml: > > > application: whatever > > version: 1 > > runtime: python > > api_version: 1 > > > handlers: > > - url: /static > > static_dir: static > > > When I try to run dev_appserver, I get this exception/stack trace: > > > $ python ./dev_appserver.py -d ../pyjamas/ > > ERROR 2009-01-26 04:15:15,236 dev_appserver_main.py] Fatal error > > when loading > > application configuration: > > mapping values are not allowed here > > in "../pyjamas/app.yaml", line 8, column 14 > > > I've compared it with app.yaml's from various working projects, and I > > just don't see the difference. > > > What am I doing that's bone-headed here? > > > Thanks, > > James > > --~--~-~--~~~---~--~~ 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: Cloud hosted IDE
Zoho Creator got an update today with a new feature that lets you deploy your Zoho Creator applications to Google App Engine. http://blogs.zoho.com/general/zoho-creator-deploys-to-google-app-engine/ On Tue, Jan 27, 2009 at 8:34 AM, adelevie wrote: > > Does anyone else agree that a web-based IDE for GAE would be awesome? > Thoughts? > How can this be done? > I'm thinking Google could whip out a pretty neat solution--maybe using > a Google Docs-like text editor and an ajaxy file system. > > > -- Stay hungry,Stay foolish. --~--~-~--~~~---~--~~ 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] Cloud hosted IDE
Does anyone else agree that a web-based IDE for GAE would be awesome? Thoughts? How can this be done? I'm thinking Google could whip out a pretty neat solution--maybe using a Google Docs-like text editor and an ajaxy file system. --~--~-~--~~~---~--~~ 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, including a file
Thanks! I have found my problem... When I render the templates I first load the Template and then for each page render I create a Context object and do: self.response.out.write(templateObject.render(contextObject)) When I change this back to: self.response.out.write(template.render(templatePath, contextVals)) it works perfectly. I wasn't aware of the difference except thought that loading in the template object would be faster since it removes repeated operations. Can I still use the template-object method and includes together? Thanks loads! At the very least I know the problem and can get it working now. =) On Jan 27, 11:03 am, Alexander Kojevnikov wrote: > I've created a sample project with just one page and the inclusion > works fine both in the SDK and in production. Take a look, may be you > will spot differences with your project: > > http://www.sendspace.com/file/qrsyjh --~--~-~--~~~---~--~~ 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] Are query/fetch LIMITs a suggestion or a guarantee?
When is it safe to assume that a fetch that returns less than LIMIT items has returned all matching items? (Clearly if a fetch returns LIMIT items, there may be more matching items.) "returns" is important - I'm assuming that the fetch isn't running into cpu quotas. For example, is there a limit on the total size of a fetch result? (If the matching items are 990kbytes, 1000 items is almost a gigabyte.) However, I'm primarily interested in cases where total size isn't an issue. (My items are reasonably small and I'm specifying a limit that is significantly less than 1000.) Does the datastore ever just say "that's enough, if you really want more items, fetch again" before it reaches the specified limit? (Yes, I know how the LIMIT clause in the query interacts with the limit specified in the fetch itself.) --~--~-~--~~~---~--~~ 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] Suggestion for anyone using session classes that rely on the datastore
I've started work on version 1.1.3 of gaeutilities which is going to add a flag to not save new sessions by default, as well as adding a save method. I've got the first bit of functionality live on a site that every hour has a script that connects and adds anywhere from 80-150 items to my datastore. The script doesn't store cookies, so every request started a new session. Last night, since adding the new sessions code in, there is a noticeable (though not dramatic) decrease in the CPU Seconds Used/ Second. My suggestion for anyone using sessions is to avoid using datastore backed sessions for anonymous users. gaeutilities with version 1.1.3 will make this easier. Those of you using memcache or pure cookie solutions should not have the overhead that the datastore backed cookies bring to the table, so this may be less of an issue for you. --~--~-~--~~~---~--~~ 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: API calls/minute quotas
Hi, If you are hitting this quota limit, please just apply for an increase: http://code.google.com/support/bin/request.py?contact_type=AppEngineContact Every resource on the system has some quota associated with it, for things like Image Transforms, it's high enough that the majority of applications will never hit it. Of course, there are always exceptions, and if you are hitting it, we are usually happy to increase your quota. -Marzia On Tue, Jan 27, 2009 at 6:04 AM, Blixt wrote: > > Hi there! > > From what I understand, there are "invisible" quotas that limit how > many API requests you can do every x time. Here's an example of an > exception raised when this quota is exceeded: "The API call > images.Transform() required more quota than is available." > > How should these be handled? It seems irrational to force users to > retry their requests later, when some of the limits seem to be > enforced already with only a few simultaneous users (in this case I'm > referring to the images.Transform API call, with a few people > uploading, say, five images each that then need to be resized to > multiple sizes.) I hope these quotas will be visible in the future so > that they can be monitored, and that there will be options to extend > these quotas. > > Regards, > Andreas > > > --~--~-~--~~~---~--~~ 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: Complex tagging of items
Here's where old good relational databases theory comes in. How will I do it: Create a model ``Tags'': class Tags(db.Model): tag_name = db.StringProperty() Create a model ``Items'': class Items(db.Model): item_name = db.StringProperty() And create a model ``ItemTags'' class ItemTags(db.model): tag = db.ReferenceProperty(Tags) item = db.ReferenceProperty(Items) So when you need to get items for some tags you first query the ``ItemTags'' for items with concrete tag(s) thgan by key you get Items. Cheers, Serhiy On Jan 24, 3:17 am, George Sudarkoff wrote: > I have a bit of a problem coming up with an efficient data model/algo > for a project I am working on: > > I have a few hundred items, each tagged with zero or more tags. I need > to be able to fetch items that, for example, are tagged with tag1 AND > (tag2 OR tag3) AND NOT tag4. > > Any help would be greatly appreciated! --~--~-~--~~~---~--~~ 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: internal error when deploying a new non-default version
konryd, What kind of internal error do you get? 2009/1/27 konryd > > Almost every time I deploy a new version of my app and try to access > it using http://[version].latest.myappnamae.appspot.com I get internal > error, unless I make it default. > > > --~--~-~--~~~---~--~~ 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] internal error when deploying a new non-default version
Almost every time I deploy a new version of my app and try to access it using http://[version].latest.myappnamae.appspot.com I get internal error, unless I make it default. --~--~-~--~~~---~--~~ 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's manage.py shell and local Interactive Development Console
Thanks for the tip, Ian. Looks like whenever I make a change in one, I need to restart the other to see the change. Not the most integrated development environment, but at least there is a workaround. On Jan 27, 8:06 am, Ian Lewis wrote: > Dennis, > > The development appserver appears to load the local datastore file on > startup so you will need to restart the shell to see updates made in the > admin. > > Ian > > 2009/1/27 Dennis > > > > > > > > > Actually, it's the interaction between the "manage.py shell" and the > > Development Console's "Datastore Viewer" > > that I'm getting the odd behavior on. > > The "interactive console" does not have the proper django context > > setup so it's not really usable for django interaction as far as I can > > tell > > (and so i tried "manage.py shell" for interactive python access to the > > datastore). > > > On Jan 27, 12:16 am, Dennis wrote: > > > For those running App Engine Helper for Django, > > > has anyone gotten the "manage.py shell" to work consistently with the > > > Interactive Development Console webpage (http://localhost:8080/_ah/admin > > > ) ? > > > I'm getting strange behavior: entities created in manage.py shell > > > don't appear in the console webpage until I restart the app server > > > (manage.py runserver) and sometimes they don't appear at all. > > > Entities defined in manage.py shell can disappear completely from the > > > datastore after I exit the shell. I'm also getting similar behavior > > > when I create a new entity kind. > > -- > === > 株式会社ビープラウド イアン・ルイス > 〒150-0012 > 東京都渋谷区広尾1-11-2アイオス広尾ビル604 > email: ianmle...@beproud.jp > TEL:03-5795-2707 > FAX:03-5795-2708http://www.beproud.jp/ > ===- 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] Re: How to append to BlobProperty
from google.appengine.ext import db class Foo(db.Model): b = db.BlobProperty() def butWhy(self, s): self.b = self.b + s f = Foo( b = "Append to a Blob?" ) f.butWhy(" You can, but why?") print f.b # "Append to a Blob? You can, but why?" I suspect you should be using a Text property. On Jan 23, 11:20 am, Will wrote: > Hi all, > > I'd like to append a byte string to a db.BlobProperty, but can't figure out > how. For example, > Any ideas? Thanks in advance. > > 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: How to append to BlobProperty
When creating an UploadStorage entity, you should initialise the content property: my_entity = UploadStorage(content='') or: my_entity = UploadStorage() my_entity.content = '' # or whatever your initial value is I know, it a bit confusing. When you define the property in the class, UploadStorage.content is an instance of db.BlobProperty. But when you access it after the entity is created, it returns the actual value of the property, which is of db.Blob type (subclass of str). On Jan 27, 10:13 pm, Will wrote: > I rewrote it, now the error message became > > unsupported operand type(s) for +=: 'NoneType' and 'str' > > pointing at > > self.content += src > > Seems *content* was not constructed in modified __init__. If I added > > self.content = db.BlobProperty(required=True) > > into __init__ while keeping the definition in the class body, I got > > Property content must be convertible to a Blob instance (Blob() argument > should be str instance, not BlobProperty) > > Seems this time* content* was constructed but in __init__() somehow it > wanted to initialize it by a Blob instance, not BlobProperty?! > > Will > > On Tue, Jan 27, 2009 at 6:43 PM, Alexander Kojevnikov < > > alexan...@kojevnikov.com> wrote: > > > Rewrite your UploadStorage class to declare the module properties in > > the class body, not in the __init__ method. App Engine forwards access > > to property definitions to the actual property values, creation of the > > properties in __init__ is probably not compatible with it. > > > For example, when you access self.content in your append() method, GAE > > returns the value of the append property, not the property definition. > > > Try this code: > > > class UploadStorage(db.Model): > > content = db.BlobProperty(required=True) > > last_change = db.DateTimeProperty(required=True, auto_now=True) > > field_name = db.StringProperty(required=True, default=u'') > > .. > > > def __init__(self, field_name, file_name, content_type, > > content_length, charset): > > if field_name: > > self.field_name = field_name > > > def append(self, src): > > self.content += src > > > On Jan 27, 9:25 pm, Will wrote: > > > Here you go, > > > > -- > > > class UploadStorage(db.Model): > > > def __init__(self, field_name, file_name, content_type, > > content_length, > > > charset): > > > self.content = db.BlobProperty(required=True) > > > self.last_change = db.DateTimeProperty(required=True, > > auto_now=True) > > > self.field_name = db.StringProperty(required=True, default=u'') > > > .. > > > > if (field_name): > > > self.field_name = field_name > > > > def append(self, src): > > > self.content += src > > > - > > > class GAEUploadedFile(UploadedFile): > > > def __init__(self, field_name, file_name, content_type, > > content_length, > > > charset): > > > self.__storage = UploadStorage(field_name, file_name, > > content_type, > > > content_length, charset) > > > .. > > > > def write(self, content): # append > > > self.__storage.append(content) > > > self.size = len(self.__storage.content) > > > > Thanks, > > > > Will > > > > On Tue, Jan 27, 2009 at 7:47 AM, Alexander Kojevnikov < > > > > alexan...@kojevnikov.com> wrote: > > > > > > No, doesn't work. I got > > > > > > unsupported operand type(s) for +=: 'BlobProperty' and 'str' > > > > > > Same as before. > > > > > Could you post here all related code, including the construction of a > > > > Storage entity? --~--~-~--~~~---~--~~ 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: Form support on a PDA/Smart Phone
I personally see no reason why a smartphone would remain unsupported... you only need to write the site to cater for the phones limitations. This appears straight forward to simply choosing a different style of output, as long as the smartphone is able to talk HTTP to the host and GET/POST or use a RESTful service (the iPhone is an example RESTful device). The only limitations I know for device access would be down to connectivity and the limits of what you know about providing to the device. just my 2 cents ... Sincerely, Jeremy On Tue, 2009-01-27 at 00:53 -0800, vb wrote: > Hi, > > Is it possible to access an application created in AppEngine through > PDA/Smart Phones. > Is there any support for certain versions of Smart Phones. > > Thanks & Regards, > Vignesh. > --~--~-~--~~~---~--~~ > 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 > -~--~~~~--~~--~--~--- > signature.asc Description: This is a digitally signed message part
[google-appengine] Re: How to append to BlobProperty
I rewrote it, now the error message became unsupported operand type(s) for +=: 'NoneType' and 'str' pointing at self.content += src Seems *content* was not constructed in modified __init__. If I added self.content = db.BlobProperty(required=True) into __init__ while keeping the definition in the class body, I got Property content must be convertible to a Blob instance (Blob() argument should be str instance, not BlobProperty) Seems this time* content* was constructed but in __init__() somehow it wanted to initialize it by a Blob instance, not BlobProperty?! Will On Tue, Jan 27, 2009 at 6:43 PM, Alexander Kojevnikov < alexan...@kojevnikov.com> wrote: > > Rewrite your UploadStorage class to declare the module properties in > the class body, not in the __init__ method. App Engine forwards access > to property definitions to the actual property values, creation of the > properties in __init__ is probably not compatible with it. > > For example, when you access self.content in your append() method, GAE > returns the value of the append property, not the property definition. > > Try this code: > > class UploadStorage(db.Model): > content = db.BlobProperty(required=True) > last_change = db.DateTimeProperty(required=True, auto_now=True) > field_name = db.StringProperty(required=True, default=u'') >.. > > def __init__(self, field_name, file_name, content_type, > content_length, charset): > if field_name: >self.field_name = field_name > >def append(self, src): >self.content += src > > > On Jan 27, 9:25 pm, Will wrote: > > Here you go, > > > > -- > > class UploadStorage(db.Model): > > def __init__(self, field_name, file_name, content_type, > content_length, > > charset): > > self.content = db.BlobProperty(required=True) > > self.last_change = db.DateTimeProperty(required=True, > auto_now=True) > > self.field_name = db.StringProperty(required=True, default=u'') > > .. > > > > if (field_name): > > self.field_name = field_name > > > > def append(self, src): > > self.content += src > > - > > class GAEUploadedFile(UploadedFile): > > def __init__(self, field_name, file_name, content_type, > content_length, > > charset): > > self.__storage = UploadStorage(field_name, file_name, > content_type, > > content_length, charset) > > .. > > > > def write(self, content): # append > > self.__storage.append(content) > > self.size = len(self.__storage.content) > > > > Thanks, > > > > Will > > > > On Tue, Jan 27, 2009 at 7:47 AM, Alexander Kojevnikov < > > > > alexan...@kojevnikov.com> wrote: > > > > > > No, doesn't work. I got > > > > > > unsupported operand type(s) for +=: 'BlobProperty' and 'str' > > > > > > Same as before. > > > > > Could you post here all related code, including the construction of a > > > Storage entity? > > > --~--~-~--~~~---~--~~ 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, including a file
I've created a sample project with just one page and the inclusion works fine both in the SDK and in production. Take a look, may be you will spot differences with your project: http://www.sendspace.com/file/qrsyjh On Jan 27, 8:47 pm, Larry wrote: > Good point. =) > > Here is my page that is being rendered without the template > included:http://silicon.appspot.com/readdoc?id=12619 > > Here's the template (contained in / and > /templates):http://silicon.appspot.com/readdoc?id=12620 > > And finally, here is my app.yaml > file:http://silicon.appspot.com/readdoc?id=12480 > > Thanks again for the continued help! :) > > On Jan 26, 12:19 am, Alexander Kojevnikov > wrote: > > > Please post here your templates and also the app.yaml file, you can > > use dpaste as @theillustratedlife has suggested. > > > On Jan 26, 8:27 am, Larry wrote: > > > > I'm using the templates that are currently inbuilt into AppEngine (I'm > > > not including Django myself). My folder structure has the parent and > > > template in the root directory and also a copy of the template in / > > > templates. > > > > Would getting the latest Django be necessary? Or do I just need to > > > tweak things? > > > > Thanks, > > > Lster > > > > On Jan 24, 2:01 am, Alexander Kojevnikov > > > wrote: > > > > > > Has anyone got include working? I've been searching everywhere but > > > > > find any simple examples of AppEngine including templates! > > > > > {% include %} works for me, I'm using app-engine-patch. > > > > > Which version of Django do you use? What is your folder structure, > > > > where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ 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 append to BlobProperty
Rewrite your UploadStorage class to declare the module properties in the class body, not in the __init__ method. App Engine forwards access to property definitions to the actual property values, creation of the properties in __init__ is probably not compatible with it. For example, when you access self.content in your append() method, GAE returns the value of the append property, not the property definition. Try this code: class UploadStorage(db.Model): content = db.BlobProperty(required=True) last_change = db.DateTimeProperty(required=True, auto_now=True) field_name = db.StringProperty(required=True, default=u'') .. def __init__(self, field_name, file_name, content_type, content_length, charset): if field_name: self.field_name = field_name def append(self, src): self.content += src On Jan 27, 9:25 pm, Will wrote: > Here you go, > > -- > class UploadStorage(db.Model): > def __init__(self, field_name, file_name, content_type, content_length, > charset): > self.content = db.BlobProperty(required=True) > self.last_change = db.DateTimeProperty(required=True, auto_now=True) > self.field_name = db.StringProperty(required=True, default=u'') > .. > > if (field_name): > self.field_name = field_name > > def append(self, src): > self.content += src > - > class GAEUploadedFile(UploadedFile): > def __init__(self, field_name, file_name, content_type, content_length, > charset): > self.__storage = UploadStorage(field_name, file_name, content_type, > content_length, charset) > .. > > def write(self, content): # append > self.__storage.append(content) > self.size = len(self.__storage.content) > > Thanks, > > Will > > On Tue, Jan 27, 2009 at 7:47 AM, Alexander Kojevnikov < > > alexan...@kojevnikov.com> wrote: > > > > No, doesn't work. I got > > > > unsupported operand type(s) for +=: 'BlobProperty' and 'str' > > > > Same as before. > > > Could you post here all related code, including the construction of a > > Storage entity? --~--~-~--~~~---~--~~ 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 append to BlobProperty
Here you go, -- class UploadStorage(db.Model): def __init__(self, field_name, file_name, content_type, content_length, charset): self.content = db.BlobProperty(required=True) self.last_change = db.DateTimeProperty(required=True, auto_now=True) self.field_name = db.StringProperty(required=True, default=u'') .. if (field_name): self.field_name = field_name def append(self, src): self.content += src - class GAEUploadedFile(UploadedFile): def __init__(self, field_name, file_name, content_type, content_length, charset): self.__storage = UploadStorage(field_name, file_name, content_type, content_length, charset) .. def write(self, content): # append self.__storage.append(content) self.size = len(self.__storage.content) Thanks, Will On Tue, Jan 27, 2009 at 7:47 AM, Alexander Kojevnikov < alexan...@kojevnikov.com> wrote: > > > No, doesn't work. I got > > > > unsupported operand type(s) for +=: 'BlobProperty' and 'str' > > > > Same as before. > > > Could you post here all related code, including the construction of a > Storage entity? > > > --~--~-~--~~~---~--~~ 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, including a file
Good point. =) Here is my page that is being rendered without the template included: http://silicon.appspot.com/readdoc?id=12619 Here's the template (contained in / and /templates): http://silicon.appspot.com/readdoc?id=12620 And finally, here is my app.yaml file: http://silicon.appspot.com/readdoc?id=12480 Thanks again for the continued help! :) On Jan 26, 12:19 am, Alexander Kojevnikov wrote: > Please post here your templates and also the app.yaml file, you can > use dpaste as @theillustratedlife has suggested. > > On Jan 26, 8:27 am, Larry wrote: > > > I'm using the templates that are currently inbuilt into AppEngine (I'm > > not including Django myself). My folder structure has the parent and > > template in the root directory and also a copy of the template in / > > templates. > > > Would getting the latest Django be necessary? Or do I just need to > > tweak things? > > > Thanks, > > Lster > > > On Jan 24, 2:01 am, Alexander Kojevnikov > > wrote: > > > > > Has anyone got include working? I've been searching everywhere but > > > > find any simple examples of AppEngine including templates! > > > > {% include %} works for me, I'm using app-engine-patch. > > > > Which version of Django do you use? What is your folder structure, > > > where the templates are kept (both the parent and the included one)? --~--~-~--~~~---~--~~ 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] Form support on a PDA/Smart Phone
Hi, Is it possible to access an application created in AppEngine through PDA/Smart Phones. Is there any support for certain versions of Smart Phones. Thanks & Regards, Vignesh. --~--~-~--~~~---~--~~ 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 Paging on App Engine
yes, you are right, this is even better :) Tx for the tip! Constantin On 26 Jan., 19:32, ryan wrote: > agreed, that would definitely help prevent multiple created values. > using a guid generator would be even better. > > having said that, paging on "created" properties like that aren't > really necessary now that we have __key__ filters and sort orders: > > http://code.google.com/appengine/docs/python/datastore/queriesandinde... > > they can be used manually, but i've also described a general way to > use them to support scalable paging with any query: > > http://groups.google.com/group/google-appengine/browse_thread/thread/... --~--~-~--~~~---~--~~ 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] API calls/minute quotas
Hi there! >From what I understand, there are "invisible" quotas that limit how many API requests you can do every x time. Here's an example of an exception raised when this quota is exceeded: "The API call images.Transform() required more quota than is available." How should these be handled? It seems irrational to force users to retry their requests later, when some of the limits seem to be enforced already with only a few simultaneous users (in this case I'm referring to the images.Transform API call, with a few people uploading, say, five images each that then need to be resized to multiple sizes.) I hope these quotas will be visible in the future so that they can be monitored, and that there will be options to extend these quotas. Regards, Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---