Is it possible to reverse a complex sql query (consisting of joins and group by) to reach its Django source?
By source, I mean the model that might have triggered the query?
For example, consider the models:
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length=200)
votes = models.IntegerField(default=0)
A query that uses group by and left outer join on these models is fired. Can I trace it back?