On Sat, Feb 7, 2009 at 5:05 AM, Ben Gerdemann <gerd...@gmail.com> wrote: > > 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")
get_field() only works on the local model, so you're going to need to split the string on '__', and walk the model definitions yourself. When you find a ForeignKey, you can get the model on the other end, which gives you another _meta object, which you can call get_field() on, and so on. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---