Luis P. Mendes wrote:
>As _django models_:
>class Servico(meta.Model):
>~ codigo = meta.TextField(maxlength=4)
>~ nome = meta.CharField(maxlength=80)
>
>~ def __repr__(self):
>~ return self.nome
>
>class Cadastro(meta.Model):
>~ serv_clientes = meta.ForeignKey(Servico)
>~ nome = meta.CharField(maxlength=200)
>~ (...)
>~ def __repr__(self):
>~ return self.nome
>
>when I try:
>lista_sps = cadastros.get_list(servicos__id__exact=2)
>
>
If I remeber correctly you should refer to related models with names of
ForeignKey fields:
lista_sps = cadastros.get_list(serv_clientes__id__exact=2)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---