aha....
Great, exelent!
and now the question is:
can I get a model instance from a dict without pick the database?
class Entry(models.Model):
e1 = models.x()
e2 = models.x()
e3 = models.y()
def crazymethod(self):
return "blah blah %s" % self.e2
>>> qsv = Entry.objects.values('e1', 'e2')
>>> EntryObject = Entry.somemetohd(qsv[0])
>>>
????
On 8/30/07, James Bennett <[EMAIL PROTECTED]> wrote:
>
> On 8/29/07, Diego pylorca <[EMAIL PROTECTED]> wrote:
> > ok, but this not return a querySet, return a dictionary :S
>
> Read the documentation more carefully. Specifically:
>
> > Returns a ValuesQuerySet -- a QuerySet that evaluates to a list
> > of dictionaries instead of model-instance objects.
>
> And:
>
> > Finally, note a ValuesQuerySet is a subclass of QuerySet, so it has all
> > methods of QuerySet. You can call filter() on it, or order_by(), or
> > whatever.
>
>
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."
>
> >
>
--
Diego F. Toritto.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---