On Sun, Jan 3, 2010 at 7:34 PM, Alex Gaynor <[email protected]> wrote:
>
> What if we had some sort of wrapper class for objs, it could overide
> __getattribute__ to return either an attr if it's an obj, or a
> subscript if it's a datadict.  it seems to me this would solve both
> concerns?

I was thinking along similar lines, but with __getitem__ instead,
basically just using a dict interface wrapping a model object, but
that hides the model's methods. Honza makes a good point that those
would be good to have access to. I feel a lot more comfortable
treating a model like a dict than vice-versa, although that's
admittedly rather arbitrary.

Joseph

--

You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en.


Reply via email to