> def to_JSON(self):
> returnDict = {}
> for member in filter(someMethod, inspect.getmembers(self)):
> returnDict[member[0]] = member[1]
> return json.dumps(returnDict)
By the way you don't need filter here. The getmembers() function has a
filter functions. It's cal
On Thu, Jul 15, 2010 at 12:37 PM, Sparky wrote:
> Hello Python community!
>
> I am building a JSON-RPC web application that uses quite a few models.
> I would like to return JSON encoded object information and I need a
> system to indicate which properties should be returned when the object
> is t
On Jul 15, 2:26 pm, John Krukoff wrote:
> On Thu, 2010-07-15 at 12:37 -0700, Sparky wrote:
>
>
>
> > the above is a good "pythonic" way to solve this problem? I am using
> > 2.6.
>
> Hopefully a helpful correction, but if you're running on google app
> engine, you're using python 2.5 on the googl
On Thu, 2010-07-15 at 12:37 -0700, Sparky wrote:
> the above is a good "pythonic" way to solve this problem? I am using
> 2.6.
Hopefully a helpful correction, but if you're running on google app
engine, you're using python 2.5 on the google side irrespective of what
you're running for development
Hello Python community!
I am building a JSON-RPC web application that uses quite a few models.
I would like to return JSON encoded object information and I need a
system to indicate which properties should be returned when the object
is translated to a JSON encoded string. Unfortunately, this
appl