Changes between Initial Version and Version 1 of Ticket #12559
- Timestamp:
- Jan 9, 2010, 9:04:47 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12559 – Description
initial v1 2 2 3 3 My simplified model is 4 4 {{{ 5 5 class Sticker(models.model): 6 6 telephones = models.ManyToManyField("account.Telephone") 7 7 }}} 8 8 9 9 when i run 10 {{{ 10 11 sticker = Sticker.object.get(pk=1) 11 12 sticker.telephones.all() 12 13 }}} 13 14 Django generated sql is: 15 {{{ 14 16 u'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 }}} 16 18 The 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. 17 19