On Thu, Feb 24, 2011 at 10:24 PM, Vivek Narayanan <m...@vivekn.co.cc> wrote:
> Hi,
>
> I am Vivek Narayanan, an undergrad student at IIT, Varanasi in India
> and am interested in participating in this year's SoC

Hi Vivek, and thanks for your interest in the GSoC!

> Problem
> ------------
> Django provides a serialization framework that is very useful for
> loading and saving fixtures, but not very flexible if one wants to
> provide an API for a Django application or use a serialization format
> different from what is defined by Django. Also the current handling of
> foreign keys and many to many relationships is not really useful
> outside the context of fixtures.
>
> Solution
> ------------
> I propose a class based Serializer, extending/refactoring the current
> base class which would be entirely configurable by the user. I would
> also like to provide some configurations for XML and JSON/YAML, that
> can serve as building blocks for writing other serializers. The class
> would have the following configurable options:
>
> • A basic structure, markup or template representing each field an
> object and also representing the object.
>
> • An external wrapping structure, a structure for an array, delimiters
> and assignment symbols.
>
> • Arbitrary level of nesting depth, Which fields of related models are
> to be represented? etc. This nesting can be handled by recursion. The
> data about related models can be extracted in the start_object or
> end_object methods.
>
> • Choosing which datatypes to dump as is, which ones to convert to
> something else. The user can provide a mapping between types in the
> form of a dict and conversion functions when needed.
>
> • Adding metadata about each field, like data-type or content-length;
> this can be represented as additional attributes in a tag in XML or
> arrays in a key-value representation. This can be done by adding some
> class methods.
>
> • The level of indentation.
>
> The idea is to store them as a python list or list of dicts till the
> final 'dumping' stage. This way we can still use existing libraries
> like SimpleXML, SimpleJSON etc. This 'dumping' method would be
> overrideable. The user would have to choose between using a standard
> library and specifying a format. I would also like to add a couple of
> features:
>
> • An exclude argument, which would be a list of fields to exclude from
> the model, this would also contain the fields to exclude in related
> models. I would like to extend the fields argument in the same way.
>
> • An extras argument, which would allow properties and data returned
> by some methods to be serialized.
>
> While this is by no means a complete proposal, I was looking for some
> feedback on the idea and would be happy to incorporate your
> suggestions.

My feedback at this point is that you've been very verbose, but not
especially clear. You've covered a lot of ground here, which shows
you're aware of the broad problems that exist -- but you haven't
really provided enough detail for us to work out if you're on the
right track.

Of course, this is your first post on the topic, so this may have been
intentional -- i.e., use this post as a 'taster' for the broad issues,
which you refine later. However, if you want to get accepted as a SoC
participant, we're going to need to have a very clear idea of what it
is that you're going to implement. History has shown us that students
that begin the SoC with a vague description don't end the SoC with a
completed project.

The suggestion I have made in the past is this: As a proof of concept,
show how you would define Django's existing serialization format using
your definition language. This will be a requirement of the final
deliverable anyway, so you might as well show how it can be done.

Once you've done that, provide a couple of other examples -- showing
both the definition, and the resulting output. The more examples you
provide of specific edge cases, the better we will be able to
understand your proposal.

Yours,
Russ Magee %-)

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

Reply via email to