#1049: custom manipulators don't work with generic views due to lack of
flatten_data
-----------------------------------+----------------------------------------
   Reporter:  [EMAIL PROTECTED]  |                Owner:  adrian       
     Status:  reopened             |            Component:  Documentation
    Version:                       |           Resolution:               
   Keywords:                       |                Stage:  Accepted     
  Has_patch:  0                    |           Needs_docs:  0            
Needs_tests:  0                    |   Needs_better_patch:  0            
-----------------------------------+----------------------------------------
Changes (by Michael Radziej <[EMAIL PROTECTED]>):

  * component:  Metasystem => Documentation

Comment:

 I don't see the issue. You simply define your {{{flatten_data}}} method
 for your custom manipulator. Perhaps this should be documented (but it's a
 bit late). Here's a simple example:
 
 {{{
     def flatten_data(self):
         obj = self.original_object
         return dict(
             name = obj.name,
             hardware_id = obj.hardware_id,
             ip = obj.ip and obj.ip.ipaddr_display(),
             ...
             )
 
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/1049#comment:3>
Django Code <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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to