On Sep 15, 6:22 am, tom <toab...@googlemail.com> wrote:
> Hi Daniel,
>
> i don't want to presentate the data. i want to produce graphs with
> this data. so it's not a presentation problem. i know that i can use
> python to get the data in correct order and style, but it's a huge
> amount of data and python would be very slow for that. so it's better
> when the database does the work.

Fair enough. I suspect this is one of those times when you've gone
beyond what the ORM can do for you, and you need to drop back to SQL.
Luckily this is easy to do:

from django.db import connection
cursor = connection.cursor()
cursor.execute("""SELECT S.value, D.value from data as S left join
data as D on
S.entry_id=D.entry_id;""")
for row in cursor.fetchall():
   # do something with row

--
DR.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to