[google-appengine] Re: Getting 'UnicodeDecodeError'. Please help
Thanks, it worked. At least the application is not raising such errors any more. I am novice as far as Python is concerned so can you please give a short explanation for the solution you provided. With this code what I noticed is that the character which was creating problem was not included in the final result string. So I tried with the following a.decode('utf8','replace') This statement instead of removing the character replaced it with some other character. So please suggest which one should I use, the one with 'ignore' or the one with 'replace' and WHY? Can you also suggest me some good book for learning PYTHON? Thanks once again. Nishant On Oct 14, 4:27 pm, kang [EMAIL PROTECTED] wrote: a.decode('utf8','ignore') On Tue, Oct 14, 2008 at 12:44 PM, Nishu [EMAIL PROTECTED] wrote: Hello, I am trying to develop a screen scraping application using the google Webapp framework. The application parses the html output of some other page to extract the required data and then forms a string out of these data. Sometimes the application works well but at times the application raises the following error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x95 in position 100: ordinal not in range(128) After googling around for some time I tried the following: sys.setdefaultencoding(UTF-8) As a result the default encoding was set to 'UTF-8' but even this did not solve the problem and now the application raised the following error: UnicodeDecodeError: 'utf8' codec can't decode byte.. So please help me solve this problem. Thanking you in advance. Nishant -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 1000 mcycles to update a single entity
That would be a nice addition. Currently I've created a pickled property (suggested by a previous post to this group) for properties that don't need to be indexed, but I fear it won't play well with djangoforms / model forms. On Oct 15, 12:04 am, djidjadji [EMAIL PROTECTED] wrote: For this entity at least 44 (10+1+2+15+1+15) index updates have to be done in 16 different index tables (10+1+2+1+1+1). Every attribute has its implicit index and you get an implicit index for the 'product' of the property lists. Not to mention the index tables mentioned in the index.yaml file that this entity uses. It can grow big when you have the ListProperties used in the index.yaml file, 15 extra updates for every mention of the string list property. I'm sure not every property of an entity is used in a query to retrieve objects. To reduce the number of index updates it could be useful to have a non-index version of every property type. Just like we have for the StringProperty. The TextProperty does not have an index to be updated. A possible syntax to tell AppEngine NOT to create and update an index for a property would be to add an attribute to the Property constructor. The default value of the attribute is True. def MyModel(db.Model): id = db.IntegerProperty(required=True) num1 = db.IntegerProperty(need_index=False) This would also help not to often hit the entity-index-update-limit ('exploding' index). Are the index updates counted in the mcycles used? 2008/10/15 Josh Heitzman [EMAIL PROTECTED]: Regarding the first question, those mcycle numbers are from logs on GAE, not from local profiling. But if you mean are lots of people using, no. I was the only user with any data when I did the test. Regarding the second question, the entities are not what I would consider large. For example, one has 10 integer properties, 1 string property, 2 datetime properties, one string list property (15 strings with none more 30 characters long), and one int list property (only 1 value at the moment). The entity group had 4 entities in it when I generated those numbers. There is no contention involved, as the data is user specific and I was the only user with data when I did the test. On Oct 14, 8:31 pm, David Symonds [EMAIL PROTECTED] wrote: On Wed, Oct 15, 2008 at 1:50 PM, Josh Heitzman [EMAIL PROTECTED] wrote: Actually, I'm it take about 1500 mcycle to update one entity and then an about an additional 1000 mcycle per additional entity (each a different kind in this case) that is updated via the same db.put call. Is this in production? What size is the entity? Is it in a large entity group? How much contention do you think is involved? Dave. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 1000 mcycles to update a single entity
There are no indexes in index.yaml for these entity kinds and not very many of the properties are being changed at one time (no idea if that matters or not). If updating the implicit indexes is the majority of the cost of doing these updates, then I definitely agree that either-- 1) an attribute for disabling the implicit indexing of properties should be added, or 2) native serialization needs to be provided as part of the runtime so we can quickly (de)serialize our data (from)into a blob. On Oct 15, 12:04 am, djidjadji [EMAIL PROTECTED] wrote: For this entity at least 44 (10+1+2+15+1+15) index updates have to be done in 16 different index tables (10+1+2+1+1+1). Every attribute has its implicit index and you get an implicit index for the 'product' of the property lists. Not to mention the index tables mentioned in the index.yaml file that this entity uses. It can grow big when you have the ListProperties used in the index.yaml file, 15 extra updates for every mention of the string list property. I'm sure not every property of an entity is used in a query to retrieve objects. To reduce the number of index updates it could be useful to have a non-index version of every property type. Just like we have for the StringProperty. The TextProperty does not have an index to be updated. A possible syntax to tell AppEngine NOT to create and update an index for a property would be to add an attribute to the Property constructor. The default value of the attribute is True. def MyModel(db.Model): id = db.IntegerProperty(required=True) num1 = db.IntegerProperty(need_index=False) This would also help not to often hit the entity-index-update-limit ('exploding' index). Are the index updates counted in the mcycles used? 2008/10/15 Josh Heitzman [EMAIL PROTECTED]: Regarding the first question, those mcycle numbers are from logs on GAE, not from local profiling. But if you mean are lots of people using, no. I was the only user with any data when I did the test. Regarding the second question, the entities are not what I would consider large. For example, one has 10 integer properties, 1 string property, 2 datetime properties, one string list property (15 strings with none more 30 characters long), and one int list property (only 1 value at the moment). The entity group had 4 entities in it when I generated those numbers. There is no contention involved, as the data is user specific and I was the only user with data when I did the test. On Oct 14, 8:31 pm, David Symonds [EMAIL PROTECTED] wrote: On Wed, Oct 15, 2008 at 1:50 PM, Josh Heitzman [EMAIL PROTECTED] wrote: Actually, I'm it take about 1500 mcycle to update one entity and then an about an additional 1000 mcycle per additional entity (each a different kind in this case) that is updated via the same db.put call. Is this in production? What size is the entity? Is it in a large entity group? How much contention do you think is involved? Dave. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: decision to be an API and not a protocol...
And, by that comment I don't mean to imply that we're not interested in HTTPS :-P, but instead that we're not interested in opening up direct protocol buffer access to our APIs. On Oct 14, 9:17 pm, Jon McAlister [EMAIL PROTECTED] wrote: We are indeed an application hosting infrastructure first and foremost, as Peter correctly claims. And yes, we do have protocols underlying all of our APIs. They are built on protocol buffers:http://code.google.com/p/protobuf/. We presently serve only HTTP, though, and are not interested in serving on any other protocols. Does this answer your question, Jason? On Oct 11, 10:51 pm, jsnx [EMAIL PROTECTED] wrote: I'm curious about the App Engine team's decision to be make App Engine an API and not a protocol. There must be protocols underyling all this stuff -- though they may be pretty rough -- and protocol level access would have facilitated use of Ruby, PHP, Haskell, Bourne Shell and Perl as well as Python. It is true that protocol level access would have perhaps undermined that app hosting feature of Google App Engine, or would have complicated it beyond reason. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 1000 mcycles to update a single entity
For this entity at least 44 (10+1+2+15+1+15) index updates have to be done in 16 different index tables (10+1+2+1+1+1). Every attribute has its implicit index and you get an implicit index for the 'product' of the property lists. Not to mention the index tables mentioned in the index.yaml file that this entity uses. It can grow big when you have the ListProperties used in the index.yaml file, 15 extra updates for every mention of the string list property. I'm sure not every property of an entity is used in a query to retrieve objects. To reduce the number of index updates it could be useful to have a non-index version of every property type. Just like we have for the StringProperty. The TextProperty does not have an index to be updated. A possible syntax to tell AppEngine NOT to create and update an index for a property would be to add an attribute to the Property constructor. The default value of the attribute is True. def MyModel(db.Model): id = db.IntegerProperty(required=True) num1 = db.IntegerProperty(need_index=False) This would also help not to often hit the entity-index-update-limit ('exploding' index). Are the index updates counted in the mcycles used? 2008/10/15 Josh Heitzman [EMAIL PROTECTED]: Regarding the first question, those mcycle numbers are from logs on GAE, not from local profiling. But if you mean are lots of people using, no. I was the only user with any data when I did the test. Regarding the second question, the entities are not what I would consider large. For example, one has 10 integer properties, 1 string property, 2 datetime properties, one string list property (15 strings with none more 30 characters long), and one int list property (only 1 value at the moment). The entity group had 4 entities in it when I generated those numbers. There is no contention involved, as the data is user specific and I was the only user with data when I did the test. On Oct 14, 8:31 pm, David Symonds [EMAIL PROTECTED] wrote: On Wed, Oct 15, 2008 at 1:50 PM, Josh Heitzman [EMAIL PROTECTED] wrote: Actually, I'm it take about 1500 mcycle to update one entity and then an about an additional 1000 mcycle per additional entity (each a different kind in this case) that is updated via the same db.put call. Is this in production? What size is the entity? Is it in a large entity group? How much contention do you think is involved? Dave. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Getting 'UnicodeDecodeError'. Please help
It is because there are some illegal string in the string you want to process. So with decode(UTF-8,ignore), you can decode it without errors. I think Dive into Python is a good choice. p.s.I am new to Python, too. And I am a Chinese, so I need to always deal with decode error problems. Because GAE dose not support Chinese well. Nishu ??: Thanks, it worked. At least the application is not raising such errors any more. I am novice as far as Python is concerned so can you please give a short explanation for the solution you provided. With this code what I noticed is that the character which was creating problem was not included in the final result string. So I tried with the following a.decode('utf8','replace') This statement instead of removing the character replaced it with some other character. So please suggest which one should I use, the one with 'ignore' or the one with 'replace' and WHY? Can you also suggest me some good book for learning PYTHON? Thanks once again. Nishant On Oct 14, 4:27 pm, kang [EMAIL PROTECTED] wrote: a.decode('utf8','ignore') On Tue, Oct 14, 2008 at 12:44 PM, Nishu [EMAIL PROTECTED] wrote: Hello, I am trying to develop a screen scraping application using the google Webapp framework. The application parses the html output of some other page to extract the required data and then forms a string out of these data. Sometimes the application works well but at times the application raises the following error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x95 in position 100: ordinal not in range(128) After googling around for some time I tried the following: sys.setdefaultencoding(UTF-8) As a result the default encoding was set to 'UTF-8' but even this did not solve the problem and now the application raised the following error: UnicodeDecodeError: 'utf8' codec can't decode byte.. So please help me solve this problem. Thanking you in advance. Nishant -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How can I get a GAE Account?
我邀请你了。 [EMAIL PROTECTED] 写道: 哎,我最近才学的Python,看了GAE的一些视频之后,对GAE很感兴趣,就是申请不到账号,这棵咋搞哦~~,应该是可以邀请别人的吧? On 10月15日, 下午4时00分, Kang [EMAIL PROTECTED] wrote: 我也不知道怎么给你。。因为我也在中国。。[EMAIL PROTECTED]写道:Why nobody pay attention to me? Is there anyone could send a invitation to me? thanks! On 10月14日, 下午11时22分,"[EMAIL PROTECTED]"[EMAIL PROTECTED]wrote:My country is not in the Supported mobile providers list, but how can I get the Google App Engine Account? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How can I get a GAE Account?
哦,是邀请共同开发啊~,看来没有邀请注册的~ 哎~,失望哦~~~ 还是要谢谢你啊! On 10月15日, 下午6时19分, Kang [EMAIL PROTECTED] wrote: [EMAIL PROTECTED]:哎,我最近才学的Python,看了GAE的一些视频之后,对GAE很感兴趣,就是申请不到账号,这棵咋搞哦~~,应该是可以邀请别人的吧? On 10月15日, 下午4时00分, Kang[EMAIL PROTECTED]wrote:[EMAIL PROTECTED]:Why nobody pay attention to me? Is there anyone could send a invitation to me? thanks! On 10月14日, 下午11时22分,[EMAIL PROTECTED][EMAIL PROTECTED]wrote:My country is not in the Supported mobile providers list, but how can I get the Google App Engine Account? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Modeling mutual references
Maybe: class Book(db.Model): title = db.StringProperty() first = db.ReferenceProperty(Page) class Page(db.Model): text = db.TextProperty() next = db.SelfReferenceProperty() book = db.IntegerPropertyhttp://code.google.com/appengine/docs/datastore/typesandpropertyclasses.html#IntegerProperty (BookID) On Fri, Oct 10, 2008 at 6:53 AM, acuth [EMAIL PROTECTED] wrote: Is it possible to have two models reference each other? I can't get this to work and haven't been able to find this limitation in the documentation. As a simple example, consider: class Book(db.Model): title = db.StringProperty() first = db.ReferenceProperty(Page) class Page(db.Model): text = db.TextProperty() next = db.SelfReferenceProperty() book = db.ReferenceProperty(Book) which generates NameError: name 'Page' is not defined when processing the Book class definition. Is this really a limitation of the underlying data store or is it more related to how models are defined in Python? I'm guessing the solution is to record the 'first page in book' information as a separate class, for example: class FirstPage(db.Model): book = db.ReferenceProperty(Book) first = db.ReferenceProperty(Page) any pointers would be gratefully received, Adrian -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Datastore timeouts
I have a class that holds advanced information for a frame of bowling. It looks like: class Frame(db.Model): version = db.IntegerProperty(default=1) user = db.UserProperty() game = db.ReferenceProperty(Game, required=True) frame_number = db.IntegerProperty(required=True) first_count = db.IntegerProperty(required=True) second_count = db.IntegerProperty() total_count = db.IntegerProperty() score = db.IntegerProperty() ball = db.ReferenceProperty(Ball) stance = db.FloatProperty() target = db.FloatProperty() actual = db.FloatProperty() slide = db.FloatProperty() breakpoint = db.FloatProperty() pocket = db.BooleanProperty() pocket_type = db.StringProperty() notes = db.TextProperty() first_pinfall = db.ListProperty(bool) second_pinfall = db.ListProperty(bool) split = db.BooleanProperty(default=False) Here is the code the takes the form input and updates or creates a new frame. I get datastore timeouts on this rather often, on the frame.put() command. Is there some good way to code this more optimally? Just getting to frame.put() sometimes takes 15000 mcycles() class FrameActions(webapp.RequestHandler): def get(self): self.post() def post(self): user = users.get_current_user() if not user: self.redirect('/unauth.html') action = self.request.get('action') if action==edit: self.edit_frame(user) return else: gameId = self.request.get('game') if gameId: self.redirect(edit-game.html?game=+gameId) return self.redirect(series.html) def edit_frame(self, user): game = model.get_for_user(type=model.Game, id=self.request.get('game'), user=user, allow_public=False) #This is simple dao code if not game: self.redirect(series.html?errMsg=The20game20could20not20be20found) return frame_number = self.request.get('frame_number') if not frame_number: self.redirect(edit-game.html?game=+gameId); return; errors=[] last_frame = game.get_last_frame() # data_store query, orders game.frame_set in reverse and uses get() highest_allowed = 1 if last_frame: highest_allowed = last_frame.frame_number + 1 if frame_number: frame_number = int(frame_number) if frame_number highest_allowed: frame_number = highest_allowed else: frame_number = highest_allowed # check 11th and 12th legality if frame_number == 11 and not game.allow_11th(): # checks that game.frame_set().filter(frame_number =, 10).totalCount == 10 self.redirect(edit-game.html?game=+gameId); return; if frame_number == 12 and not game.allow_11th(): # checks that game.frame_set().filter(frame_number =, 10).firstCount == 10, and the same for frame number 11 self.redirect(edit-game.html?game=+gameId); return; first_pinfall = [] first_count=0 for pin in range(1,11): if self.request.get('f1p'+str(pin)) == down: first_pinfall += [True] first_count+=1 else: first_pinfall += [False] do_second = True if frame_number == 12: do_second = False elif frame_number == 11: tenth = game.frame_set.filter(frame_number =,10).get() do_second = tenth.first_count == 10 if not do_second: second_pinfall = [] second_count=None else: second_pinfall = [] second_count=0 for pin in range(1,11): if self.request.get('f2p'+str(pin)) == down: second_pinfall += [True] if not first_pinfall[pin-1]: second_count+=1 else: second_pinfall += [False] frame = game.frame_set.filter(frame_number =, frame_number).get() if not frame: logging.debug(Creating new frame) frame = model.Frame(user=user,game=game,frame_number=frame_number,first_count=first_count,second_count=second_count) else: logging.debug(Updating existing frame) frame.first_count=first_count frame.second_count=second_count frame.first_pinfall = first_pinfall frame.second_pinfall = second_pinfall frame.ball = model.get_for_user(type = model.Ball, user=user, id=self.request.get('ball'), allow_public=False) if self.request.get('stance'): try: frame.stance = float(self.request.get('stance')) except: errors += [Stance is not a valid board!] else: frame.stance = None if self.request.get('target'): try: frame.target = float(self.request.get('target')) except: errors += [Target is not a valid board!] else: frame.target = None if self.request.get('actual'): try: frame.actual = float(self.request.get('actual')) except: errors += [Actual board hit is not a valid board!] else: frame.actual = None if self.request.get('slide'): try: frame.slide = float(self.request.get('slide')) except: errors +=
[google-appengine] Creating web forms in GAE
Hi, Can anybody say please, what ways exist in GAE environment to create web forms like in GWT widgets library. Is it possible to use tcl\tk from python? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] can I have a primery key of my own?
if i use google datastore api? is it possible to specify my own key field in db.Model? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Gql Issue
class MyBooks(db.Model): bookid=db.IntegerProperty(name='key') author = db.StringProperty(multiline=True) book_name = db.StringProperty(multiline=True) price = db.IntegerProperty() date = db.DateTimeProperty(auto_now_add=True) class Editbook(webapp.RequestHandler): def post(self): book = MyBooks() bid = int(self.request.get('_id')) user = db.GqlQuery(SELECT * FROM MyBooks WHERE author = :1, 'orlly') print user self.redirect('/') In above code if I gave query like SELECT * FROM MyBooks then it is working fine for me. But if I am trying to add WHERE clause like - SELECT * FROM MyBooks WHERE author = :1, 'orlly' it will return NONE Please Help me out!!! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Gql integration issue
Hi, We have tried example given in google app engine where only SELECT query is as an example without WHERE clause, if i used to apply where clause the no record are fetching. Also could you please give us the example of UPDATE,DELETE,SEARCH in our google app engine Thanks in advance. Gampesh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How can I get a GAE Account?
不是邀请注册么? 那各位是怎么注册帐号的?我也是注册不了 On 10月15日, 下午9时00分, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 哦,是邀请共同开发啊~,看来没有邀请注册的~ 哎~,失望哦~~~ 还是要谢谢你啊! On 10月15日, 下午6时19分, Kang [EMAIL PROTECTED] wrote: [EMAIL PROTECTED]:哎,我最近才学的Python,看了GAE的一些视频之后,对GAE很感兴趣,就是申请不到账号,这棵咋搞哦~~,应该是可以邀请别-人的吧? On 10月15日, 下午4时00分, Kang[EMAIL PROTECTED]wrote:[EMAIL PROTECTED]:Why nobody pay attention to me? Is there anyone could send a invitation to me? thanks! On 10月14日, 下午11时22分,[EMAIL PROTECTED][EMAIL PROTECTED]wrote:My country is not in the Supported mobile providers list, but how can I get the Google App Engine Account?- 隐藏被引用文字 - - 显示引用的文字 - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Upload demo to GAE Error, caused by _GetAuthCookie, timed out
Hi, I keep getting the following error while trying to upload GAE demo (guestbook). Here is the stack trace: - C:\Program Files\Google\google_appengineappcfg.py update demos\guestbook\ Email: [EMAIL PROTECTED] Password for [EMAIL PROTECTED]: Scanning files on local disk. Initiating update. Email: [EMAIL PROTECTED] Password for [EMAIL PROTECTED]: 2008-10-15 21:01:09,086 ERROR appcfg.py:1334 An unexpected error occurred. Aborting. Traceback (most recent call last): File C:\Program Files\Google\google_appengine\appcfg.py, line 55, in module execfile(script_path, globals()) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1943, in module main(sys.argv) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1936, in main AppCfgApp(argv).Run() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1521, in Run self.action.function(self) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1733, in Update lambda path: open(os.path.join(basepath, path), rb)) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1313, in DoUpload missing_files = self.Begin() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1174, in Begin version=self.version, payload=self.config.ToYAML()) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 281, in Send self._Authenticate() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 320, in _Authenticate super(HttpRpcServer, self)._Authenticate() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 260, in _Authenticate self._GetAuthCookie(auth_token) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 202, in _GetAuthCookie response = self.opener.open(req) File C:\Python25\lib\urllib2.py, line 381, in open response = self._open(req, data) File C:\Python25\lib\urllib2.py, line 399, in _open '_open', req) File C:\Python25\lib\urllib2.py, line 360, in _call_chain result = func(*args) File C:\Python25\lib\urllib2.py, line 1107, in http_open return self.do_open(httplib.HTTPConnection, req) File C:\Python25\lib\urllib2.py, line 1082, in do_open raise URLError(err) urllib2.URLError: urlopen error (10060, 'Operation timed out') - Any idea is highly appreciated! Thanks! -- Best Regards, Jason Lu --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: can I have a primery key of my own?
And what about key_name in the Model class. http://code.google.com/appengine/docs/datastore/modelclass.html Regards On 15 oct, 08:29, ajaxer [EMAIL PROTECTED] wrote: if i use google datastore api? is it possible to specify my own key field in db.Model? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How can I get a GAE Account?
申诉,写信给google。过两天他们会开通。 2008/10/15 Kang [EMAIL PROTECTED] 我也不知道怎么给你。。因为我也在中国。。 [EMAIL PROTECTED] 写道: Why nobody pay attention to me? Is there anyone could send a invitation to me? thanks! On 10月14日, 下午11时22分, [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: My country is not in the Supported mobile providers list, but how can I get the Google App Engine Account? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Gql integration issue
On Oct 15, 8:28 am, Gampeshwar [EMAIL PROTECTED] wrote: Also could you please give us the example of UPDATE,DELETE,SEARCH in our google app engine There are no such GQL statements, only SELECT. The datastore is not a traditional RDBMS, and GQL is really only provided as a convenience to fetch objects from the datastore using a somewhat familiar idiom. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Gql integration issue
Thanks for the reply Wooble , But if i wanted to do UPDATE, SEARCH and DELETE operation,could you please guide me on this what should i do for that.. Thanks Gampesh On Wed, Oct 15, 2008 at 7:44 PM, Wooble [EMAIL PROTECTED] wrote: On Oct 15, 8:28 am, Gampeshwar [EMAIL PROTECTED] wrote: Also could you please give us the example of UPDATE,DELETE,SEARCH in our google app engine There are no such GQL statements, only SELECT. The datastore is not a traditional RDBMS, and GQL is really only provided as a convenience to fetch objects from the datastore using a somewhat familiar idiom. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Newbie question - Request params available to def post(self)
Ok, that makes sense. I guess that must be the reason why some of the example apps (written by bret taylor) use REquestHandler classes that subclass a BaseRequestHandler class that includes the original request object: def generate(self, template_name, template_values={}): values = { 'request': self.request, 'user': users.GetCurrentUser(), 'login_url': users.CreateLoginURL(self.request.uri), 'logout_url': users.CreateLogoutUrl('http://' + self.request.host + '/logout'), 'application_name': 'Questioneer' } values.update(template_values) directory = os.path.dirname(__file__) path = os.path.join(directory, os.path.join('templates,', template_name)) self.response.out.write(template.render(path, values, debug=_DEBUG)) This seems like a helpful idiom so that all of the original request variables for a get are available to the django template code for use in POST hidden fields. Correct interpretation? On Oct 14, 5:37 pm, kang [EMAIL PROTECTED] wrote: or you can write code like: class Stuff: get(self,favorites): do something here. application = webapp.WSGIApplication( [(r'^/stuff/favorites/(?P(favorites).*)$', Stuff)], debug=True) the url is like : /stuff/favorites/oatmealraisinbranhttp://myapp.com/stuff?favorites=oatmealraisinbran On Tue, Oct 14, 2008 at 11:49 PM, Alex Vartan [EMAIL PROTECTED] wrote: Let's say I redirect a user to the url: myapp.com/stuff?favorites=oatmealraisinbran I generate the page with a def get(self) method in the Stuff RequestHandler class and use self.request.get('favorites'). Then there is a form on the same page (/stuff) which processes some additional input ('morestuff') and supplies me with a few other pieces of data via post. When I process this using a def post(self) in Stuff, I use self.request.get('morestuff'). But can I also access the original 'favorites' in the post method? I can't find any documentation about this but perhaps it's because it's just obvious. I guess the question is does the self.request object get cleared after get(self) finishes generating the page, or are the original query params still available to me when I call self.request.get in the subsequent post method (is the dictionary of key value pairs in the request object replaced, or augmented by post data?) Thanks much, Alex -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 求助关于索引问题 的问题!!!
不明白你为啥要去修改index.yaml文件,这个文件里面保存的是数据索引方案,会由appcfg.py程序自动更新的,一般不需要手工修改。 1.你是否把 # AUTOGENERATED 这行去掉了,导致系统在你创建model时不会自动更新索引,你可以恢复自动索引,或手工添加 - kind: Comment properties: - name: yes direction: desc 2.model只有在创建了实例以后才在控制台可见 3. 应该是表示这个索引从来没有使用过 holeo wrote: ��⣺ ��һ�⣺�ϴ���index.yaml��һ��д�õ� - kind: Comment properties: - name: yes direction: desc console���濴ûˣɣ��صIJ�ѯҲ��ʧ�ܵģ���ʾ��Ҫ��� NeedIndexError: no matching index found. This query needs this index: - kind: Comment properties: - name: yes direction: desc ��ô���£� �ڶ��⣺modelû꣬һ��3��model��ֻ�2ô�أ� ⣺index.yaml�ʲô�� # Unused in query history -- copied from input. - kind: Comment properties: - name: True direction: desc ���Ǹ��ѧ�ߣ�лл��λ���ҽ�㡣� --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Gql integration issue
Thanks for the reply one more thing on this id i used to execute SELECT query then it is working fine but once i gave WHERE clause to the SELECT queary then it wont show any record and not even ERROR. Please help we are new in Google app engine and python as well. Thanks Gampesh On Wed, Oct 15, 2008 at 8:22 PM, José Oliver Segura [EMAIL PROTECTED]wrote: On Wed, Oct 15, 2008 at 4:33 PM, Gampesh [EMAIL PROTECTED] wrote: Thanks for the reply Wooble , But if i wanted to do UPDATE, SEARCH and DELETE operation,could you please guide me on this what should i do for that.. Well, Select is a SEARCH. Update/Delete are not performed by GQL, but invoking them directly in the retrieved (by the Search/Select) entities. You'll probably need to take a look here: http://code.google.com/appengine/docs/datastore/creatinggettinganddeletingdata.html Best, Jose --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 求助关于索引问题 的问题!!!
万分感谢你的帮助! 第一个问题,我没修改过index.yaml,dev模式下查询正常 ,我在index.yaml里面发现存在这个索引 - kind: Comment properties: - name: yes direction: desc 可是上传运行提示需要这个索引,后台也没显示生成??? 第三个问题: - kind: Comment properties: - name: True direction: desc comment这个model里面我没写True这个property,index.yaml它自己生成的,是什么??? On 10月15日, 下午11时15分, chyni [EMAIL PROTECTED] wrote: 不明白你为啥要去修改index.yaml文件,这个文件里面保存的是数据索引方案,会由appcfg.py程序自动更新的,一般不需要手工修改。 1.你是否把 # AUTOGENERATED 这行去掉了,导致系统在你创建model时不会自动更新索引,你可以恢复自动索引,或手工添加 - kind: Comment properties: - name: yes direction: desc 2.model只有在创建了实例以后才在控制台可见 3. 应该是表示这个索引从来没有使用过 holeo wrote: ⣺ һ ⣺ ϴ index.yaml һ д õ - kind: Comment properties: - name: yes direction: desc console 濴û ˣ ɣ صIJ ѯҲ ʧ ܵģ ʾ Ҫ NeedIndexError: no matching index found. This query needs this index: - kind: Comment properties: - name: yes direction: desc ô £ ڶ ⣺modelû ꣬һ 3 model ֻ 2 ô أ ⣺ index.yaml ʲô # Unused in query history -- copied from input. - kind: Comment properties: - name: True direction: desc Ǹ ѧ ߣ лл λ ҽ 㡣 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How can I get a GAE Account?
我也不知道怎么给你。。因为我也在中国。。 [EMAIL PROTECTED] 写道: Why nobody pay attention to me? Is there anyone could send a invitation to me? thanks! On 10月14日, 下午11时22分, "[EMAIL PROTECTED]" [EMAIL PROTECTED] wrote: My country is not in the Supported mobile providers list, but how can I get the Google App Engine Account? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Gql integration issue
On Wed, Oct 15, 2008 at 5:21 PM, Gampesh [EMAIL PROTECTED] wrote: Thanks for the reply one more thing on this id i used to execute SELECT query then it is working fine but once i gave WHERE clause to the SELECT queary then it wont show any record and not even ERROR. Maybe you don't have any entity in the datastore that matches the Where criteria... You can check it by using the Datastore Viewer in your admin console. Beside that, pasting the lines of code that are not working could help Best, Jose --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Static files not cached with GAE
What makes you think it is not cached? The headers seem to be set appropriately: HTTP/1.1 200 OK DateWed, 15 Oct 2008 17:03:35 GMT Expires Sun, 19 Oct 2008 22:03:35 GMT Cache-Control public, max-age=363600 Content-Typetext/plain Content-Encodinggzip Server Google Frontend Content-Length 849 I've tried with Firefox 3.0.3 and it seems to cache it just fine! -Mahmoud On Oct 15, 8:38 am, noamway [EMAIL PROTECTED] wrote: Hi all, I'm building my first application with GAE and I got a problem with caching static files. For example this is a file in my app:http://1.latest.6645.appspot.com/stylesheets/noam.txt You can see that the file don't cached by the browsers. This is my app.yaml: -- application: 6645 version: 1 runtime: python api_version: 1 default_expiration: 4d 5h handlers: - url: /stylesheets static_dir: stylesheets expiration: 4d 5h - url: /(.*\.(gif|png|jpg)) static_files: static/\1 upload: static/(.*\.(gif|png|jpg)) - url: /.* script: 6645.py -- What I have done wrong? how can cached static files? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Modeling mutual references
Using multiple files for dbModel subclass definitions during development runs into the GAE/python doesn't reload what hasn't changed problem. If db.Model A is defined in fileA, db.Model B is defined in fileB and B has a db.ReferenceProperty to A, B's definition will generate errors when you change fileB and don't restart the development server. Why? Because B's db.ReferenceProperty to A actually modifies A, and that modification looks for conflicting modifications and can't distinguish a conflicting modification from B's redefinition. (Since fileA hasn't changed, fileA won't be reloaded so A's previous definition will still be around.) BTW, Python doesn't import classes. The import statement executes files and makes available a cached copy of the values computed during the execution of said files. The from form of the import statement has some special risks and from {file} import * is typically more trouble than it is worth. For how fileA imports fileB and fileB imports fileA works, consult a Python reference. It can be used to do certain things but not others, and how it works depends on which file is imported first by some other file. If both fileA and fileB are imported by other files, first in the development environment depends on which of them has changed. If your application imports those other files depending on the request, first also depends on request order. (No, import and class definitions aren't special - they're just statements that get executed.) In general, you'll be happier if you avoid fileA imports fileB and fileB imports fileA. It doesn't work like other languages that you've used before. And, you were likely doing it in those other languages to do something that is best done some other way in Python. Organize your inter and intra file dependencies in a DAG. Use separate files for separatable concepts. If two concepts are mutually dependent, they're probably not separable. Concepts aren't classes. On Oct 14, 8:31 am, Dado [EMAIL PROTECTED] wrote: I am having the same problem when defining a join model between two models... because they depend on each other, but in my case is a problem related to how Python imports classes (I am using import to pull in models definitions that are in different files). Does the code that you posted all reside in one file? Regardless, Python (I think, but don't trust me on that) loads class and module definitions as it reads (or import) the file, which means that when it first encounters Book (with a Page ref in it) it doesn't know what Page is. I haven't yet found a solution to this... please let me know if you do. On Oct 10, 1:06 pm, Andy Freeman [EMAIL PROTECTED] wrote: Yes, but then the db.ReferenceProperty won't verify that it's being pointed to the right kind of thing. On Oct 9, 4:40 pm, yejun [EMAIL PROTECTED] wrote: You don't have to give class for ReferenceProperty. first = db.ReferenceProperty() On Oct 9, 6:53 pm, acuth [EMAIL PROTECTED] wrote: Is it possible to have two models reference each other? I can't get this to work and haven't been able to find this limitation in the documentation. As a simple example, consider: class Book(db.Model): title = db.StringProperty() first = db.ReferenceProperty(Page) class Page(db.Model): text = db.TextProperty() next = db.SelfReferenceProperty() book = db.ReferenceProperty(Book) which generates NameError: name 'Page' is not defined when processing the Book class definition. Is this really a limitation of the underlying data store or is it more related to how models are defined in Python? I'm guessing the solution is to record the 'first page in book' information as a separate class, for example: class FirstPage(db.Model): book = db.ReferenceProperty(Book) first = db.ReferenceProperty(Page) any pointers would be gratefully received, Adrian- Hide quoted text - - Show quoted text -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How to access Google Cache?
Thanks. My intention is to be able to use an intelligent agent to examine other websites' pages - and then flagging pages that contain something important (words, patterns, etc.) On Oct 15, 2:42 am, Sal [EMAIL PROTECTED] wrote: It's not very clear (at least to me) what you're trying to do. If you have objects that are being pulled from the datastore, then you should definitely use the memcache API as previously mentioned where appropriate. However, if you're trying to get a link to a Google Cached Page, the Search AJAX API exposes a cacheUrl property that you can use in the JSON response. On Oct 14, 8:14 am, Vacilando [EMAIL PROTECTED] wrote: Hi, In an application I build I sometimes need to check on a page, but it is enough for me (and presumably much faster) if I could read its latest copy from Google Cache. Is there a way to fetcha page from Google Cache programmatically? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Is it possible to use Google Apps APIs in Google App Engine
Hi All I'm a newbie. Is it possible to use Google Apps APIs in Google App Engine? This is what the Google Apps APIs says: http://code.google.com/apis/gdata/articles/python_client_lib.html#library Thank you. Gui Installing the Google Data Library Download the Google data Python library if you haven't done so. Look for the latest version on the Python project's downloads page. After downloading the library, unpack it using unzip or tar zxvf depending on the type of download you chose. Now you are ready to install the library modules so that they can be imported into Python. There are several ways you can do this: * If you have the ability to install packages for all users to access, you can run ./setup.py install from the unpacked archive's main directory. * If you want to install these modules for use in your home directory, you can run ./setup.py install --home=your home directory. * In some cases, you want to avoid installing the modules altogether. To do that, modify your PYTHONPATH environment variable to include a directory which contains the gdata and atom directories for the Google data Python client library. For instructions on modifying your PYTHONPATH, see the Appendix at the end of this article. * One final option that I'll mention, is copying the gdata and atom directories from the src directory into whatever directory you are in when you execute python. Python will look in the current directory when you do an import, but I don't recommend this method unless you are creating something quick and simple. Once you've installed the Google data library, you're ready to take the library for a test drive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Modeling mutual references
The problem really has nothing to do with how import works. It's an execution order problem. Short version: yes, the problem is that Page doesn't exist when Book is defined. However, it has nothing to do with imports. Long version: Import reads and executes statements from a file and makes the names defined by executing those statements available. Python's class definitions are actually executable statements. (The organization of http://docs.python.org/reference/ reflects this reality.) A Python class statement executes some other statements in a context, some of which produce executable objects, applies some transformations to produce a class object, and binds that object to a variable, creating that variable if necessary. Python's executable objects can contain references to undefined things. However, some of the db.Model transformations for db.ReferenceProperties depend on the specified reference_class (also a db.Model) having gone through that process previously. On Oct 15, 8:00 am, Dado [EMAIL PROTECTED] wrote: Thanx for the clarification. I knew Python doesn't import like other languages, and it is probably a more advanced solution. But doing it the simpler way (Ruby?) allows for better file organization (for my taste), with one file per model. I solved my problem by importing the join model inside methods that use it, but it feels like a non- efficient hack to me. One question though. Is it right that the example shown in the first post doesn't work because, the way Python imports, Page doesn't yet exists when referenced by Book? Dado On Oct 15, 5:47 am, Andy Freeman [EMAIL PROTECTED] wrote: Using multiple files for dbModel subclass definitions during development runs into the GAE/python doesn't reload what hasn't changed problem. If db.Model A is defined in fileA, db.Model B is defined in fileB and B has a db.ReferenceProperty to A, B's definition will generate errors when you change fileB and don't restart the development server. Why? Because B's db.ReferenceProperty to A actually modifies A, and that modification looks for conflicting modifications and can't distinguish a conflicting modification from B's redefinition. (Since fileA hasn't changed, fileA won't be reloaded so A's previous definition will still be around.) BTW, Python doesn't import classes. The import statement executes files and makes available a cached copy of the values computed during the execution of said files. The from form of the import statement has some special risks and from {file} import * is typically more trouble than it is worth. For how fileA imports fileB and fileB imports fileA works, consult a Python reference. It can be used to do certain things but not others, and how it works depends on which file is imported first by some other file. If both fileA and fileB are imported by other files, first in the development environment depends on which of them has changed. If your application imports those other files depending on the request, first also depends on request order. (No, import and class definitions aren't special - they're just statements that get executed.) In general, you'll be happier if you avoid fileA imports fileB and fileB imports fileA. It doesn't work like other languages that you've used before. And, you were likely doing it in those other languages to do something that is best done some other way in Python. Organize your inter and intra file dependencies in a DAG. Use separate files for separatable concepts. If two concepts are mutually dependent, they're probably not separable. Concepts aren't classes. On Oct 14, 8:31 am, Dado [EMAIL PROTECTED] wrote: I am having the same problem when defining a join model between two models... because they depend on each other, but in my case is a problem related to how Python imports classes (I am using import to pull in models definitions that are in different files). Does the code that you posted all reside in one file? Regardless, Python (I think, but don't trust me on that) loads class and module definitions as it reads (or import) the file, which means that when it first encounters Book (with a Page ref in it) it doesn't know what Page is. I haven't yet found a solution to this... please let me know if you do. On Oct 10, 1:06 pm, Andy Freeman [EMAIL PROTECTED] wrote: Yes, but then the db.ReferenceProperty won't verify that it's being pointed to the right kind of thing. On Oct 9, 4:40 pm, yejun [EMAIL PROTECTED] wrote: You don't have to give class for ReferenceProperty. first = db.ReferenceProperty() On Oct 9, 6:53 pm, acuth [EMAIL PROTECTED] wrote: Is it possible to have two models reference each other? I can't get this to work and haven't been able to find this limitation in the documentation. As a simple example, consider: class Book(db.Model):
[google-appengine] Re: Frames
http://www.w3schools.com/tags/tag_frameset.asp On Oct 15, 8:44 pm, Nora [EMAIL PROTECTED] wrote: Hello, I know my question sounds stupid but I am unable to move on with my work until this problem is sorted out. I need to create 2 frames in my web page. I used the frameset tag. I can display the google appengine website but am unable to display my website in the frame. I need to display utf-8 data. I tried the empty web page first but it didn't work !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Frameset//EN http://www.w3.org/TR/xhtml4/DTD/xhtml4-frameset.dtd; html head titleHello /title /head body h1Hello /h1 /body /html Any suggestions on what is the problem? Thank you very much, Nora --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Frameset
http://www.w3schools.com/tags/tag_frameset.asp On Oct 15, 8:37 pm, Noorhan Abbas [EMAIL PROTECTED] wrote: Hello, Did anybody use frames in Google Appengine before? It is a stupid question but I can display the Google App Engine page and I am unable to display my page in the frame!!! Can anybody help me please, Thanks, Nora. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] 'Google App Engine for Dummies' - references and stuff to support GAE
I have been working on a site to help developers, and newcomers, find documentation and other information about the App Engine. It's called 'Google App Engine for Dummies', and it's here: http://gae4dummies.appspot.com/ I think it now has most of the knowledge that this dummy acquired, but since this dummy still has a lot to learn, there are many areas that could use some extra material - and I hope you people with more in-depth experience in, say, Django or Ajax or Eclipse, can make some suggestions. And there are probably many nuggets of mis-information, so I hope you guys can find most of them and suggest some corrections. Feel free, of course, either to respond here on this list or to leave comments on the site itself. And I hope you're at least slightly amused by the silly jokes. Also, has anyone had enough experience with a rating system, like the one behind the 'stars' in Google Groups, to tell me how reliable the ratings can be? I want people to help set the 'credibility' of the links on my site, but I think I need an algorithm sophisticated enough to give more weight to ratings given by experienced developers and less, or none, to beginners or trolls. Has anyone tried to do this? Thanks, Gary Davis --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: key_name length limits?
Hi Andy, I believe there is a limit on key names of 500 bytes, but I can't seem to find it in the documentation. I think the question I have is there a reason you are not using entity groups? When using entity groups you can use Key.from_path() to construct key objects from the ancestor path: http://code.google.com/appengine/docs/datastore/keyclass.html#Key_from_path This way you don't need to build up longer and longer key names. -Marzia On Wed, Oct 15, 2008 at 2:03 PM, Andy Freeman [EMAIL PROTECTED] wrote: I'd like to construct a key_name (for get_or_insert) by concatenating the name() s of a couple of db.Key s. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Is it possible to use Google Apps APIs in Google App Engine
Yes, it's possible to use Gdata API's (including Google Apps) on Google App Engine. Just take a look at the following article: http://code.google.com/appengine/articles/gdata.html On Oct 15, 10:35 am, cm_gui [EMAIL PROTECTED] wrote: Hi All I'm a newbie. Is it possible to use Google Apps APIs in Google App Engine? This is what the Google Apps APIs says:http://code.google.com/apis/gdata/articles/python_client_lib.html#lib... Thank you. Gui Installing the Google Data Library Download the Google data Python library if you haven't done so. Look for the latest version on the Python project's downloads page. After downloading the library, unpack it using unzip or tar zxvf depending on the type of download you chose. Now you are ready to install the library modules so that they can be imported into Python. There are several ways you can do this: * If you have the ability to install packages for all users to access, you can run ./setup.py install from the unpacked archive's main directory. * If you want to install these modules for use in your home directory, you can run ./setup.py install --home=your home directory. * In some cases, you want to avoid installing the modules altogether. To do that, modify your PYTHONPATH environment variable to include a directory which contains the gdata and atom directories for the Google data Python client library. For instructions on modifying your PYTHONPATH, see the Appendix at the end of this article. * One final option that I'll mention, is copying the gdata and atom directories from the src directory into whatever directory you are in when you execute python. Python will look in the current directory when you do an import, but I don't recommend this method unless you are creating something quick and simple. Once you've installed the Google data library, you're ready to take the library for a test drive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Is it possible to use Google Apps APIs in Google App Engine
Thank you Sam. On Oct 15, 3:02 pm, Sam G [EMAIL PROTECTED] wrote: Yes, it's possible to use Gdata API's (including Google Apps) on Google App Engine. Just take a look at the following article:http://code.google.com/appengine/articles/gdata.html On Oct 15, 10:35 am, cm_gui [EMAIL PROTECTED] wrote: Hi All I'm a newbie. Is it possible to use Google Apps APIs in Google App Engine? This is what the Google Apps APIs says:http://code.google.com/apis/gdata/articles/python_client_lib.html#lib... Thank you. Gui Installing the Google Data Library Download the Google data Python library if you haven't done so. Look for the latest version on the Python project's downloads page. After downloading the library, unpack it using unzip or tar zxvf depending on the type of download you chose. Now you are ready to install the library modules so that they can be imported into Python. There are several ways you can do this: * If you have the ability to install packages for all users to access, you can run ./setup.py install from the unpacked archive's main directory. * If you want to install these modules for use in your home directory, you can run ./setup.py install --home=your home directory. * In some cases, you want to avoid installing the modules altogether. To do that, modify your PYTHONPATH environment variable to include a directory which contains the gdata and atom directories for the Google data Python client library. For instructions on modifying your PYTHONPATH, see the Appendix at the end of this article. * One final option that I'll mention, is copying the gdata and atom directories from the src directory into whatever directory you are in when you execute python. Python will look in the current directory when you do an import, but I don't recommend this method unless you are creating something quick and simple. Once you've installed the Google data library, you're ready to take the library for a test drive. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How to change Authentication Options after application has been uploaded
Thank you all. Register a new app and waste one slot sigh... On Oct 10, 4:34 pm, Jon McAlister [EMAIL PROTECTED] wrote: Correct, you will need to register a new app. On Oct 8, 9:24 pm, pr3d4t0r [EMAIL PROTECTED] wrote: On Oct 8, 9:14 pm, cm_gui [EMAIL PROTECTED] wrote: During the uploading, I forgot to restrict authentication to my Google Apps domain. After uploading, I went to Application Settings, but it seems that there is no way to edit the Authentication Options anymore. Unfortunately there is no way of doing that at this time. Some discussions have hinted that it may change in the future, but this is it for now. Cheers, pr3d4t0rhttp://www.istheserverup.comhttp://www.teslatestament.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Newbie question - Request params available to def post(self)
I am new to Python and GAE. I just give you the way I solved the GET/parameters problems:-)I think I need to read some example codes~ But I don't think your interpretation is correct. It's not a Request/parameters problem. It's a Get/parameter problem. Usually we can see url like /book?id=11. We use get method to visit that page to watch a book whose id is 11. You can not get any parameter by using request.get(id). So I use /book/11 and application = webapp.WSGIApplication( [(r'^/book/(?P(bookid)$d+)$', Book)], debug=True) to get the bookid, and give it to Book.Get(self, bookid) function. On Wed, Oct 15, 2008 at 10:49 PM, Alex Vartan [EMAIL PROTECTED] wrote: Ok, that makes sense. I guess that must be the reason why some of the example apps (written by bret taylor) use REquestHandler classes that subclass a BaseRequestHandler class that includes the original request object: def generate(self, template_name, template_values={}): values = { 'request': self.request, 'user': users.GetCurrentUser(), 'login_url': users.CreateLoginURL(self.request.uri), 'logout_url': users.CreateLogoutUrl('http://' + self.request.host + '/logout'), 'application_name': 'Questioneer' } values.update(template_values) directory = os.path.dirname(__file__) path = os.path.join(directory, os.path.join('templates,', template_name)) self.response.out.write(template.render(path, values, debug=_DEBUG)) This seems like a helpful idiom so that all of the original request variables for a get are available to the django template code for use in POST hidden fields. Correct interpretation? On Oct 14, 5:37 pm, kang [EMAIL PROTECTED] wrote: or you can write code like: class Stuff: get(self,favorites): do something here. application = webapp.WSGIApplication( [(r'^/stuff/favorites/(?P(favorites).*)$', Stuff)], debug=True) the url is like : /stuff/favorites/oatmealraisinbran http://myapp.com/stuff?favorites=oatmealraisinbran On Tue, Oct 14, 2008 at 11:49 PM, Alex Vartan [EMAIL PROTECTED] wrote: Let's say I redirect a user to the url: myapp.com/stuff?favorites=oatmealraisinbran I generate the page with a def get(self) method in the Stuff RequestHandler class and use self.request.get('favorites'). Then there is a form on the same page (/stuff) which processes some additional input ('morestuff') and supplies me with a few other pieces of data via post. When I process this using a def post(self) in Stuff, I use self.request.get('morestuff'). But can I also access the original 'favorites' in the post method? I can't find any documentation about this but perhaps it's because it's just obvious. I guess the question is does the self.request object get cleared after get(self) finishes generating the page, or are the original query params still available to me when I call self.request.get in the subsequent post method (is the dictionary of key value pairs in the request object replaced, or augmented by post data?) Thanks much, Alex -- Stay hungry,Stay foolish. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Upload demo to GAE Error, caused by _GetAuthCookie, timed out
you can ping appspot.com and give us the result. On Wed, Oct 15, 2008 at 9:15 PM, Chao Loo [EMAIL PROTECTED] wrote: Hi, I keep getting the following error while trying to upload GAE demo (guestbook). Here is the stack trace: - C:\Program Files\Google\google_appengineappcfg.py update demos\guestbook\ Email: [EMAIL PROTECTED] Password for [EMAIL PROTECTED]: Scanning files on local disk. Initiating update. Email: [EMAIL PROTECTED] Password for [EMAIL PROTECTED]: 2008-10-15 21:01:09,086 ERROR appcfg.py:1334 An unexpected error occurred. Aborting. Traceback (most recent call last): File C:\Program Files\Google\google_appengine\appcfg.py, line 55, in module execfile(script_path, globals()) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1943, in module main(sys.argv) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1936, in main AppCfgApp(argv).Run() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1521, in Run self.action.function(self) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1733, in Update lambda path: open(os.path.join(basepath, path), rb)) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1313, in DoUpload missing_files = self.Begin() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 1174, in Begin version=self.version, payload=self.config.ToYAML()) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 281, in Send self._Authenticate() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 320, in _Authenticate super(HttpRpcServer, self)._Authenticate() File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 260, in _Authenticate self._GetAuthCookie(auth_token) File C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py, line 202, in _GetAuthCookie response = self.opener.open(req) File C:\Python25\lib\urllib2.py, line 381, in open response = self._open(req, data) File C:\Python25\lib\urllib2.py, line 399, in _open '_open', req) File C:\Python25\lib\urllib2.py, line 360, in _call_chain result = func(*args) File C:\Python25\lib\urllib2.py, line 1107, in http_open return self.do_open(httplib.HTTPConnection, req) File C:\Python25\lib\urllib2.py, line 1082, in do_open raise URLError(err) urllib2.URLError: urlopen error (10060, 'Operation timed out') - Any idea is highly appreciated! Thanks! -- Best Regards, Jason Lu -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Filtering Doesn't Work.
I've tried a few different methods between Foo = Posts().all Foo.filter( column =, value ), gql and a handful of other methods. No matter what I do, I don't seem to get this work work. [code] class EntryHandler(webapp.RequestHandler): def get(self): perm_link_key = utils.get_uri_info(self.request.path) Entry = db.Query(Entries).filter('PermLink =', perm_link_key).get() if Entry: self.response.out.write(I tried to get this title post: + Entry.Title) else: self.response.out.write(Error: 404) [/code] I've double and tripple checked that utils.get_uri_info is working correctly. When you go to /entry//MM/DD/post-title it returns /MM/DD/post-title, PermLink is correctly set when looking at the Data Viewer in the Dashboard, but no object is returned. :( Model: [code] class Entries(db.Model): Title= db.TextProperty(required=True) Body = db.TextProperty(required=True) Created = db.DateTimeProperty(auto_now_add=True) Author = db.TextProperty(required=True, default=Anonymous) DelKey = db.TextProperty(required=True) AuthorIP = db.TextProperty(required=True) Date = db.TextProperty(required=True) PermLink = db.TextProperty(required=True) [/code] Storing The Data: [code] def post(self): delete_key = utils.make_delete_key(self.request.remote_addr) (month,day,year) = utils.get_mdy() perm_url = str(year) + / + str(month) + / + str(day) + / + utils.make_safe_url(self.request.get('title')) entry_body = markup( self.request.get('body') ) Entry = Entries( Body = entry_body, Title= cgi.escape(self.request.get('title')), Author = cgi.escape(self.request.get('name')), DelKey = delete_key, AuthorIP = self.request.remote_addr, Date = time.asctime() + + time.tzname[0], PermLink = perm_url) Entry.put() [/code] make_safe_url [code] def make_safe_url( string ): string = string.lower() string = re.sub(r'[^a-z0-9\s]', '', string ) string = re.sub(r'\s+', '-', string) return string [/code] index.yaml [code] indexes: - kind: Entries properties: - name: PermLink - name: Created [/code] Anyone see what I'm doing wrong? Anyone know what I'm doing wrong? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: Creating web forms in GAE
Thanks, David! I thought that my first attempt to ask question have failed. And what do you think about Java in GAE ? Davide Rognoni wrote: web forms with widgets in Django http://docs.djangoproject.com/en/dev/ref/forms/widgets/ On Oct 15, 3:38�pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Can anybody say please, what ways exist in GAE environment to create web forms like in GWT widgets library. Is it possible to use tcl\tk from python? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: How can I get a GAE Account?
申诉成功了,哈哈 剩下的时间就是好好学习python了 On 10月16日, 上午8时58分, kang [EMAIL PROTECTED] wrote: 我是在没有手机验证的时候就注册了的~ 现在做了一个 http:luck.appspot.com 2008/10/15 robbie [EMAIL PROTECTED] 不是邀请注册么? 那各位是怎么注册帐号的?我也是注册不了 On 10月15日, 下午9时00分, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 哦,是邀请共同开发啊~,看来没有邀请注册的~ 哎~,失望哦~~~ 还是要谢谢你啊! On 10月15日, 下午6时19分, Kang [EMAIL PROTECTED] wrote: [EMAIL PROTECTED]:哎,我最近才学的Python,看了GAE的一些视频之后,对GAE很感兴趣,就是申请不到账号,这棵咋搞哦~~,应该是可以邀请别-人的吧? On 10月15日, 下午4时00分, Kang[EMAIL PROTECTED]wrote:我也不知道怎么给你。。因为我也在中国。。 [EMAIL PROTECTED]:Why nobody pay attention to me? Is there anyone could send a invitation to me? thanks! On 10月14日, 下午11时22分, [EMAIL PROTECTED][EMAIL PROTECTED]wrote:My country is not in the Supported mobile providers list, but how can I get the Google App Engine Account?- 隐藏被引用文字 - - 显示引用的文字 - -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: key_name length limits?
I'm not using entity groups (in this case) because the entity/db.Model instance that I'm constructing doesn't have a reasonable ancestor. There will be too many of them to put under any of the db.Model instances that I'm using to build the key_name, let alone to put under a single root. The db.Model instance that I'm creating will not be used to create other keys. The other db.Model instances whose Keys() I want to use to create the key_name are likewise either root entities or at a very short depth in an entity dag. I'd assumed that the length of a db.Model instance's db.Key().name() was a constant plus a linear function of the depth the entity in its entity group. If my assumption is true, the key_names that I'm planning to construct will have bounded length. If the db.Key() s constructed by the dev environment are the same length as those in the production environment, I should be able to figure out whether said bounded length is less than the max length of a key_name. On Oct 15, 2:19 pm, Marzia Niccolai [EMAIL PROTECTED] wrote: Hi Andy, I believe there is a limit on key names of 500 bytes, but I can't seem to find it in the documentation. I think the question I have is there a reason you are not using entity groups? When using entity groups you can use Key.from_path() to construct key objects from the ancestor path:http://code.google.com/appengine/docs/datastore/keyclass.html#Key_fro... This way you don't need to build up longer and longer key names. -Marzia On Wed, Oct 15, 2008 at 2:03 PM, Andy Freeman [EMAIL PROTECTED] wrote: I'd like to construct a key_name (for get_or_insert) by concatenating the name() s of a couple of db.Key s.- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] 754 mcycles to update an entity (sole in group) with one integer property
As we didn't see anyone from the GAE team confirm or deny that the excessive mcycle consumption for doing an entity update was due to the number of properties on the entity (see this thread http://groups.google.com/group/google-appengine/browse_thread/thread/2901a4ddd1f671d9 ) I decided to do a little experiment. Follows are the average mcycle consumptions (on GAE not locally) to update 4 different types of entities. Each entity has no parent and or children (i.e. its the one and only entity in its group). There was no contention as these entities were created solely for this test. 754 - one IntegerProperty 864 - One each of IntegerProperty, DateTimeProperty, FloatProperty, and StringProperty 718 - one StringListProperty with no elements 2141 - one StringListProperty with 40 elements each with 14 characters. Has anyone else done a similar experiment? If so did you get similar 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 1000 mcycles to update a single entity
Opened http://code.google.com/p/googleappengine/issues/detail?id=786 regarding this issue. On Oct 15, 12:25 am, Josh Heitzman [EMAIL PROTECTED] wrote: There are no indexes in index.yaml for these entity kinds and not very many of the properties are being changed at one time (no idea if that matters or not). If updating the implicit indexes is the majority of the cost of doing these updates, then I definitely agree that either-- 1) an attribute for disabling the implicit indexing of properties should be added, or 2) native serialization needs to be provided as part of the runtime so we can quickly (de)serialize our data (from)into a blob. On Oct 15, 12:04 am, djidjadji [EMAIL PROTECTED] wrote: For this entity at least 44 (10+1+2+15+1+15) index updates have to be done in 16 different index tables (10+1+2+1+1+1). Every attribute has its implicit index and you get an implicit index for the 'product' of the property lists. Not to mention the index tables mentioned in the index.yaml file that this entity uses. It can grow big when you have the ListProperties used in the index.yaml file, 15 extra updates for every mention of the string list property. I'm sure not every property of an entity is used in a query to retrieve objects. To reduce the number of index updates it could be useful to have a non-index version of every property type. Just like we have for the StringProperty. The TextProperty does not have an index to be updated. A possible syntax to tell AppEngine NOT to create and update an index for a property would be to add an attribute to the Property constructor. The default value of the attribute is True. def MyModel(db.Model): id = db.IntegerProperty(required=True) num1 = db.IntegerProperty(need_index=False) This would also help not to often hit the entity-index-update-limit ('exploding' index). Are the index updates counted in the mcycles used? 2008/10/15 Josh Heitzman [EMAIL PROTECTED]: Regarding the first question, those mcycle numbers are from logs on GAE, not from local profiling. But if you mean are lots of people using, no. I was the only user with any data when I did the test. Regarding the second question, the entities are not what I would consider large. For example, one has 10 integer properties, 1 string property, 2 datetime properties, one string list property (15 strings with none more 30 characters long), and one int list property (only 1 value at the moment). The entity group had 4 entities in it when I generated those numbers. There is no contention involved, as the data is user specific and I was the only user with data when I did the test. On Oct 14, 8:31 pm, David Symonds [EMAIL PROTECTED] wrote: On Wed, Oct 15, 2008 at 1:50 PM, Josh Heitzman [EMAIL PROTECTED] wrote: Actually, I'm it take about 1500 mcycle to update one entity and then an about an additional 1000 mcycle per additional entity (each a different kind in this case) that is updated via the same db.put call. Is this in production? What size is the entity? Is it in a large entity group? How much contention do you think is involved? Dave. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---
[google-appengine] Re: 754 mcycles to update an entity (sole in group) with one integer property
Oh, and: 756 - one StringListProperty with 1 element with 490 characters. So each of the three trials had just one property was under 800 mcycles regardless of the size of the property. On Oct 15, 9:17 pm, Josh Heitzman [EMAIL PROTECTED] wrote: As we didn't see anyone from the GAE team confirm or deny that the excessive mcycle consumption for doing an entity update was due to the number of properties on the entity (see this threadhttp://groups.google.com/group/google-appengine/browse_thread/thread/... ) I decided to do a little experiment. Follows are the average mcycle consumptions (on GAE not locally) to update 4 different types of entities. Each entity has no parent and or children (i.e. its the one and only entity in its group). There was no contention as these entities were created solely for this test. 754 - one IntegerProperty 864 - One each of IntegerProperty, DateTimeProperty, FloatProperty, and StringProperty 718 - one StringListProperty with no elements 2141 - one StringListProperty with 40 elements each with 14 characters. Has anyone else done a similar experiment? If so did you get similar 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~--~~~~--~~--~--~---