#3661: Serializers shoud have a option for serializing model properties
--------------------------------------------------+-------------------------
Reporter: Øyvind Saltvik <[EMAIL PROTECTED]> | Owner:
jacob
Status: closed | Component:
Serialization
Version: SVN | Resolution:
wontfix
Keywords: | Stage:
Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
--------------------------------------------------+-------------------------
Changes (by russellm):
* status: new => closed
* resolution: => wontfix
Comment:
I'm afraid I don't see the benefit of what you are proposing. The
serialization framework exists for the easy serialization of Django
DB-backed objects - not for the arbitrary serialization of _any_
object, and derived properties like the ones you are highlighting as
examples don't add anything to the serialized representation of a
DB-backed object.
For the use-case you describe - XMLRPC and similar calls - you need to
adhere to a specific API. It would expect it to be very unusual for
the requirements of an RPC API to match the serialization strategy of
a Django object. For these problems, you need to serialize a very
specific set of object-related information (not the object itself) in
a very specific format; the better approach in this cases would be to
construct a dictionary that explicitly contains the data you want, and
use the SimpleJSON/PyYAML/XML libraries natively to serialize the
dictionary into the desired format.
--
Ticket URL: <http://code.djangoproject.com/ticket/3661#comment:5>
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
-~----------~----~----~----~------~----~------~--~---