Hi,

i want to have the same model-field 2x in the query result.

The model.py is:
class Measurand(models.Model):
    """
    A Model for measurement data
    """
    entry = models.ForeignKey(Entry)
    avg_value = models.FloatField(help_text='the average measurement
value', db_index=True, blank=True, null=True)
    def __unicode__(self):
        return 'Measurand:' + str(self.avg_value)


My raw-sql looks like:
cursor = connection.cursor()
        cursor.execute(""" SELECT speed.avg_value, dir.avg_value
                       FROM data_measurand AS speed LEFT JOIN
                       data_measurand AS dir
                       ON speed.entry_id=dir.entry_id;
                       """, locals() )
        row = cursor.fetchall()


How can i do this with the django-orm?




--

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


Reply via email to