Hi Elias,
As we develop our AppEngine apps, we are abstracting some of the code
that we are using to work with JSON. This might help. We are still
work from the JSON loads
Your model classes will need to subclass JSONSerializableModel
from django.utils import simplejson
class JSONSerializableModel(db.Model):
def from_json(self):
pass
def to_json(self):
jsonify_props = { }
for property_name, property_type in
self.properties().iteritems():
jsonify_props[property_name] = getattr(self,
property_name)
return simplejson.dumps(jsonify_props)
On Sat, Nov 21, 2009 at 11:49 PM, Elias <[email protected]> wrote:
> Hi,
>
> for my JavaScript frontend I need to print the gqlquery data as JSON
> strings.
> For that purpose I used this class:
> http://code.google.com/p/google-app-engine-samples/source/browse/trunk/geochat/json.py?r=55
>
> which works really great!
>
> But it prints out ALL the data every time. Most of the data I don't
> even need in the frontend like updated_at and the whole user
> information per element.
>
> Is there any possibility to reduce the data the GqlQuery loads?
>
>
> Regards
>
> Elias
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> 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=.
>
>
>
--
"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
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.