我有以下2种型号: class Job(models.Model):
title = models.CharField(_('title'), max_length=50)
description = models.TextField(_('description'))
category = models.ForeignKey(JobCategory, related
检查查询是否返回任何结果的推荐方法是什么? 例子: orgs = Organisation.objects.filter(name__iexact = 'Fjuk inc')
# If any results
# Do this with the results without querying again.
# Else, do something else...
我想有这个检
鉴于型号选择所有对象: class Profile(models.Model):
user = models.ForeignKey(User, unique=True)
class Thingie(models.Model):
children = models.ManyToManyField('self', blank=True, symmetrical=False)