On 2/8/07, Michael Radziej <[EMAIL PROTECTED]> wrote:
>
> Sergey Kirillov:
> > I'm using this function to load Django objects using custom sql
> >
> >     obj_list = klass._default_manager.in_bulk(oid_list)
>
> But that's two queries. I think that there should be a way to do it
> with one query.

You don't need to do a second query as long as the original SQL query
starts with 'SELECT * from table' - if this is the case, the oid_list
and obj_list statements can be replaced with:

obj_list = [klass(*row) for row in cur.fetchall())]

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to