I'm using python 2.4 and django 1.2.4 with MySQL 5.0 FWIW
I have the following models (code deleted to simplify)
class Message(models.Model):
facility= models.CharField(max_length=2, null=True, blank=True)
msgtype = models.CharField(max_length=3)
class Pv(models.Model):
On Thu, Oct 23, 2008 at 11:21 AM, AndyB <[EMAIL PROTECTED]> wrote:
>
> Apologies for not using DPaste. I thought the snippets were small
> enough. And I thought my question was cleared than it turned out to
> be!
>
I wasn't saying what you posted would have been better at dpaste.com, what
you
Apologies for not using DPaste. I thought the snippets were small
enough. And I thought my question was cleared than it turned out to
be!
To clarify (where someobject_set is a related-object queryset):
someobject_set.all().query.as_sql()
someobject_set.select_related().query.as_sql()
Both show
On Thu, Oct 23, 2008 at 10:44 AM, AndyB <[EMAIL PROTECTED]> wrote:
>
> >>> p.residentialunitmix_set.all().query.as_sql()
>
> (u'SELECT `tbl_ResidentialUnitMix`.`id`,
> `tbl_ResidentialUnitMix`.`Planning-id`,
> `tbl_ResidentialUnitMix`.`quantity`,
> `tbl_ResidentialUnitMix`.`Bedrooms`,
>>> p.residentialunitmix_set.all().query.as_sql()
(u'SELECT `tbl_ResidentialUnitMix`.`id`,
`tbl_ResidentialUnitMix`.`Planning-id`,
`tbl_ResidentialUnitMix`.`quantity`,
`tbl_ResidentialUnitMix`.`Bedrooms`, `tbl_ResidentialUnitMix`.`Type`,
`tbl_ResidentialUnitMix`.`Tenure` FROM
5 matches
Mail list logo