#16421: Serializing TimeField throws Attribute Error
-------------------------------------+-------------------------------------
               Reporter:             |          Owner:  nobody
  silent1mezzo                       |         Status:  closed
                   Type:  Bug        |      Component:  Database layer
              Milestone:             |  (models, ORM)
                Version:  1.3        |       Severity:  Normal
             Resolution:             |       Keywords:
  worksforme                         |      Has patch:  1
           Triage Stage:             |    Needs tests:  0
  Unreviewed                         |  Easy pickings:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * status:  new => closed
 * needs_docs:   => 0
 * resolution:   => worksforme
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 I can't reproduce. I've written a test case, which I'm attaching to this
 ticket. I later noticed that the serialization of `TimeField`s is already
 tested by the `serializers_regress` tests.

 Also, I believe you patch is wrong:
 - `val` is supposed to be a time object or `None`, not a string; if the
 function is called with a string, the error must be fixed in the caller,
 or further up the stack.
 - when `val` is a time object, the function returns a string; but with you
 patch, when `val` is a string, you're returning a time object. I don't
 understand this at all.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16421#comment:1>
Django <https://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-updates@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