#5574: FileField not properly serializing to XML
---------------------------------------------------------------+------------
   Reporter:  Chris Henderson <[EMAIL PROTECTED]>  |                Owner:  
nobody       
     Status:  reopened                                         |            
Component:  Serialization
    Version:  SVN                                              |           
Resolution:               
   Keywords:  FileField, xml, serialization                    |                
Stage:  Unreviewed   
  Has_patch:  1                                                |           
Needs_docs:  0            
Needs_tests:  0                                                |   
Needs_better_patch:  0            
---------------------------------------------------------------+------------
Changes (by anonymous):

  * status:  closed => reopened
  * resolution:  worksforme =>

Comment:

 The issue isn't on serializing, but on trying to reload the info.

 The serializer code calls {{{get_fieldname_url}}} instead of just
 outputting the database value:

 {{{
         elif isinstance(field, models.FileField):
             value = getattr(obj, "get_%s_url" % field.name, lambda:
 None)()
 }}}

 So when you read it back in, it's got the wrong value - in his example,
 while the field originally held {{{"avatars/system/001.gif"}}}, the
 serializers output {{{"/site_media/avatars/system/001.gif"}}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5574#comment:2>
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