Hello,

I think the best why to explain my question is with an example. I have
a model T60CursoAdmin and a query string "a21__a21_ano" that I can use
to search with like this:

T60CursoAdmin.objects.filter(a21__a21_ano=2008)

The models look like this:

class T60Curso(models.Model):
    a21 = models.ForeignKey(T21Turma,verbose_name="Turma")
    ex = models.CharField()

class T21Turma(models.Model):
    a21_ano = models.IntegerField("Ano")

My question is how, can I can get a reference to the 'a21_ano' field
that this filter is referencing? If the filter didn't span through the
foreign key, I could just do:

T60Curso._meta.get_field("ex")

but this doesn't work:

T60Curso._meta.get_field("a21__a21_ano")

Thanks for any and all help.

Cheers,
Bem
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to