Re: ForeignKey on CharField and char operations

2012-07-05 Thread Tomas Neme
> Wouldn't it create INNER JOIN query on a_type table? AFAIR it would and it's > a bit overhead. > But surely it is a better solution than mine one, thanks for that. Well, in that case, I think your problem is that your AType PK isn't the mnemo field, but some integer field, so type_id is integer,

Re: ForeignKey on CharField and char operations

2012-07-05 Thread Serg Shtripling
четверг, 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

Re: ForeignKey on CharField and char operations

2012-07-05 Thread Tomas Neme
I might not be understanding this fully, but what about A.objects.filter(type__mnemo__startswith="type1")? On Thu, Jul 5, 2012 at 7:51 AM, Serg Shtripling wrote: > Hello, community! > Have anyone tried this: > class AType(models.Model): > #cut > mnemo = models.CharField(u'Mnemocode', max_