On Sun, 2007-10-07 at 20:02 +0400, Ivan Sagalaev wrote:
> Malcolm Tredinnick wrote:
> > As soon as
> > you start to move to situations where your publically exposed resources
> > don't map more or less one-to-one onto models, things become a lot
> > trickier and we haven't quite solved that
> 
> Weren't custom descendants of the Resource class designed for this? I 
> even thought they would be the more common application 
> django-rest-interface since you can automatically map models to 
> resources only in simple cases.

Yes, that's the idea and it mostly works pretty well. I agree that
that's the more general case, too -- model mapping is a special case of
that. The main difficulty is automatically creating the correct URLS,
particularly reverse URL mapping.

The Resource class is quite as independent from everything as we would
have liked. I say "we" here because towards the end of the SoC period,
Andreas and I spent quite a long time trying to loosen a few of the
couplings between output classes and the representation classes --
Collection and Responder, in particular -- and we both felt it wasn't as
neat as it could be, but we couldn't see how to improve it. That's
probably still work in progress.

My own mental measuring stick during the whole project was to imagine a
case where I was implementing Atom Publishing and using many models to
represent what became a single article resource in the public interface
(I have images, text, metadata, possibly a model with links in it for
validation in the future, etc). You can fit this into Resource
subclasses, but the amount of work you end up doing never really
convinced me that the framework was helping me here. It felt like the
same amount of work as if I did it from scratch, so where was the clear
win in using the framework for this case and did it even feel wrong not
to use it? Again, this isn't a mark against Andreas work, but was more a
case of me trying to test the boundaries.

I should talk to Andreas about posting some of the discussions we had
and where we left of on the wiki and creating a project mailing list so
that other people can get in on the fun here.

Cheers,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to