Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/313.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python django select查询--如何实现?_Python_Mysql_Database_Django - Fatal编程技术网

Python django select查询--如何实现?

Python django select查询--如何实现?,python,mysql,database,django,Python,Mysql,Database,Django,这是我的数据库模式。正如您所看到的,每个内容都有一个分数。 我如何做到这一点: 从内容分数为1的内容中选择全部?Content.objects.filterscore\u real\u分数=1Content.objects.filterscore\u real\u分数=1 class Content(models.Model): .....stuff here class Score(models.Model): content = models.OneToOneField(C

这是我的数据库模式。正如您所看到的,每个内容都有一个分数。 我如何做到这一点:

从内容分数为1的内容中选择全部?

Content.objects.filterscore\u real\u分数=1

Content.objects.filterscore\u real\u分数=1

class Content(models.Model):
    .....stuff here

class Score(models.Model):
    content = models.OneToOneField(Content, primary_key=True)
    real_score = models.IntegerField(default=0)