Is there a way to search on the Foreign Key's __str__ representation
in admin views? I have the FK listed in the search_fields but it fails
to find it.
First, you probably want to be implementing __unicode__ methods for your models, not __str__. See: http://docs.djangoproject.com/en/dev/ref/unicode/#choosing-between-str-and-unicode
Second, what is this method returning? If it is essentially a field from the model, then yes, you can search on that in admin. See: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields
Karen
http://tracey.org/kmt/
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment