#12862: Feature Request: Allow model @property methods to be serialized.
---------------------------+------------------------------------------------
 Reporter:  orokusaki      |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.1       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 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().

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12862>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to