假设我有以下两个模型
func updateAngle(from triangle: CGPoint, to ball: CGPoint) {
let deltaX = ball.x - triangle.x
let deltaY = ball.y - triangle.y
let angle = atan2(deltaY, deltaX)
triangle.zRotation = angle - 90 * degreesToRadians
}
现在我想找到所有的群组,它们在translatefoo_set中有一个TranslatedFoo,其中一个查询中包含language_code ='x'和country ='y' 。是否存在如下情况:
Group(Model):
attribute = CharField()
TranslatedFoo(Model):
language = ForeignKey(Language)
country = ForeignKey(Country)
group = ForeignKey(Group)
我知道这不起作用。也许我需要重新考虑我的表格布局
答案 0 :(得分:3)
正确的查询不包含create unique index idx_customer_name_2 on customer_name(first_name, last_name);
create unique index idx_customer_phone_2 on customer_phone(customer_id, phone_number);
部分:
_set
在this doc page上搜索“反向”了解更多详情。