it looks like the code you have does this:
1. creates a response object
2. populates it with some metadata
3. creates a rows array in the object with the query results
in pylons, you could just do...
@jsonify
def controller_method(self):
rval= {
'page':$page,
'total':$total,
'records':$records,
'rows':[],
}
rows= query:
for row in rows:
rval['rows'].append( whatever )
return rval
which would give (roughly) the same output
the @jsonify decorator does the " $json->encode($responce);" magic
you could also call that on the rval dict (or object) and return a
string.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---