我必须在没有作曲家配置的symphony 2上工作,但在reposytory中使用文件夹vendor/*.
我想重新安装composer并为现有包生成配置.可能吗?
谢谢!
我有两个 django 模型
class ModelA(models.Model):
title = models.CharField(..., db_column='title')
text_a = models.CharField(..., db_column='text_a')
other_column = models.CharField(/*...*/ db_column='other_column_a')
class ModelB(models.Model):
title = models.CharField(..., db_column='title')
text_a = models.CharField(..., db_column='text_b')
other_column = None
Run Code Online (Sandbox Code Playgroud)
然后我想使用合并该模型的两个查询集union
ModelA.objects.all().union(ModelB.objects.all())
Run Code Online (Sandbox Code Playgroud)
但在查询中我看到
(SELECT
`model_a`.`title`,
`model_a`.`text_a`,
`model_a`.`other_column`
FROM `model_a`)
UNION
(SELECT
`model_b`.`title`,
`model_b`.`text_b`
FROM `model_b`)
Run Code Online (Sandbox Code Playgroud)
当然我有例外The used SELECT statements have a different number of columns。
如何创建别名和假列以使用联合查询?