On 12/4/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > > On 12/5/06, Bret Walker <[EMAIL PROTECTED]> wrote: > > > > Is there a way to search a CharField contained in a ForeignKey? > > Yes. You can traverse any foreign key or m2m relation in Django's query > language. For example: > > Article.objects.filter(author__firstname='Bret') > > would retrieve all article objects that have a related author with a first > name of 'Bret'. The double underscore notation is used to describe how you > want to traverse relations; the underlying table joins (if required) will be > automatically constructed by Django. > > More detail here: > http://www.djangoproject.com/documentation/db_api/ > > Yours, > Russ Magee %-) >
Thanks, Russ. I realized that I left out one important part of my question. a CharField contained in a ForeignKey *from the admin interface*? I'm not quite sure how I'd use the code given in the API documentation to achieve this. Thanks, Bret --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---