Feature Request: Allow model @property methods to be serialized.
|Reported by:||Oroku Saki||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Let's say I have this class:
class Cart(models.Model): account = models.ForeignKey(Account) @property def total(self): total = 0 for item in self.item_set: total += item.price return total
Obviously if I were to serialize this model, I would want the total to be serialized. I wouldn't mind having to include it in fields=() argument of serialize().