Search Results

Search found 1 results on 1 pages for 'ashchristopher'.

Page 1/1 | 1 

  • Serialize the @property methods in a Python class.

    - by ashchristopher
    Is there a way to have any @property definitions passed through to a json serializer when serializing a Django model class? example: class FooBar(object.Model) name = models.CharField(...) @property def foo(self): return "My name is %s" %self.name Want to serialize to: [{ 'name' : 'Test User', 'foo' : 'My name is Test User', },]

    Read the article

1