I'd like to present my concept for partial models, which would be an attempt to replace the use of .values() returning a dictionary (although .values() still has uses if you dont actually want an instance). Keep in mind, the way I'm presenting this would keep #17 working :)
values, values_tuple, and partial models, in my opinion, should all be replaced with one method call (what if theres a values_list or values_set, seems ugly). This would become a new values method: values(results=[object|tuple|dict]) or something similar Upon returning the object, you would get proxies, which held a model instance in it. The proxy itself, would allow you to override any field (e.g. this would be useful for .extra(select)), but any fields which aren't set could be passed back to the model (so you could override a foreignkey, without affecting the model instance, and thus not affecting #17). When the proxy is instanced, we would identify which fields are currently available, and map those in. We would also similarly make sure all fields are identifyable. We would then (possibly, didn't think this through) add proxy attributes for each field/relation that isn't available in the dataset, and set this as a LazyLookup. Upon calling this attribute, it would do an SQL query for this single attribute, and throw a warn() signal to make the developer aware (as you most likely don't want to do this). The biggest thing about this for me, is I don't want to return dictionaries or tuples, but I want to optimize my SQL usage. I don't need to return an article's body just to show headlines, but I do want to be able to call get_absolute_url, for example. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
