[google-appengine] Re: About expando properties

2011-07-14 Thread Geoffrey Spear
On Jul 14, 9:36 am, someone1 wrote: > Using the simplejson class resulted in code significantly slower > (15-20x slower). However, using the built-in json class in Python 2.7 > resulted in code slightly faster than repr() (3-5x faster). > > With the upcoming support for 2.7, I'd suggest keeping

[google-appengine] Re: About expando properties

2011-07-14 Thread someone1
While this seems to be the case in Python 2.5 (without a built-in json class), it isn't true in Python 2.7 (from my tests at least): import string, random, profile, json #import simplejson as json def randomString(length): return ''.join(random.choice(string.ascii_uppercase +

Re: [google-appengine] Re: About expando properties

2011-07-13 Thread keakon lolicon
There is an _unindexed_properties private property of model class: class A(db.Expando): pass A._unindexed_properties = frozenset(['prop']) a = A() a.prop = 1 # it's not indexed a.put() -- keakon My blog(Chinese): www.keakon.net Blog source code: https://bitbucket.org/keakon/doodle/

[google-appengine] Re: About expando properties

2011-07-13 Thread Pol
Very interesting, thanks for sharing. If you just need a simple dictionary-like storage, why not just repr() and eval() - wouldn't that be even faster? On Jul 13, 8:05 am, someone1 wrote: > I just looked into this myself. Best bet is to use a Text or Blob > property to store in a JSON format: >

[google-appengine] Re: About expando properties

2011-07-13 Thread Jay Young
Instead of setting an expando property to the property's value, can you set it to an instance of a Property class? To modify the example in the documentation: class Song(db.Expando): title = db.StringProperty() crazy = Song(title='Crazy like a diamond', author=db.StringPropert

[google-appengine] Re: About expando properties

2011-07-13 Thread someone1
I just looked into this myself. Best bet is to use a Text or Blob property to store in a JSON format: http://kovshenin.com/archives/pickle-vs-json-which-is-faster/ I did many tests with 250-500 expando properties and the results were horrendous. From digging around I didn't find a way to disable

[google-appengine] Re: About expando properties

2011-07-12 Thread Max
1) text property? not familer with Python, I believe there is a better answer 2) max 5000 indexes are allowed to build on single entity 3) you can try to save all properties (those don't require index) into one single json / xml text property -- You received this message because you are subsc