Changes between Initial Version and Version 1 of Ticket #12559


Ignore:
Timestamp:
Jan 9, 2010, 9:04:47 AM (15 years ago)
Author:
Alex Gaynor
Comment:

Fixed formatting, please use preview.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12559 – Description

    initial v1  
    22
    33My simplified model is
    4 
     4{{{
    55class Sticker(models.model):
    66    telephones = models.ManyToManyField("account.Telephone")
    7 
     7}}}
    88
    99when i run
     10{{{
    1011sticker = Sticker.object.get(pk=1)
    1112sticker.telephones.all()
    12 
     13}}}
    1314Django generated sql is:
     15{{{
    1416u'SELECT `account_telephone`.`id`, `account_telephone`.`tel_city`, `account_telephone`.`tel_number`, `account_telephone`.`profile_id` FROM `account_telephone` INNER JOIN `service_sticker_telephones` ON (`account_telephone`.`id` = `service_sticker_telephones`.`account.telephone_id`) WHERE `service_sticker_telephones`.`sticker_id` = 1'
    15 
     17}}}
    1618The wrong thing is service_sticker_telephones`.`account.telephone_id` , it should be service_sticker_telephones`.`telephone_id`, but somehow the application name was added.  Even more interesting is that in my model i have another M2M field that works well.
    1719
Back to Top