четверг, 5 июля 2012 г., 20:40:00 UTC+7 пользователь Tomas Neme написал:
>
> I might not be understanding this fully, but what about
> A.objects.filter(type__mnemo__startswith="type1")?
>
> Wouldn't it create INNER JOIN query on a_type table? AFAIR it would and
it's a bit overhead.
But surely
Hello, community!
Have anyone tried this:
class AType(models.Model):
#cut
mnemo = models.CharField(u'Mnemocode', max_length=31, null=True,
unique=True)
class A(models.Model):
#cut
type = models.ForeignKey(AType, 'mnemo', verbose_name=u'A Type',
null=True)
class B(models.Model):
2 matches
Mail list logo