Karen Tracey wrote: > On 12/3/07, Robin Becker <[EMAIL PROTECTED]> wrote: >> >> I have a simple model with a foreign key relation >> >> class A(models.Model): >> id = models.CharField('ABCDEFG', .....) > > > Do you really have an explicit field named 'id'? Do you also include > primary_key=True over in that '....' part? Otherwise it seems you'd get a > conflict between your explicitly id field and Django's auto-generated one.
id has primary_key=True > > class B(models.Model): >> def __str__(self): >> return self.name >> >> class Admin: >> list_display = ('name',) >> list_display_links = ('name',) >> ordering = ('a', 'name') >> search_fields = ('a__id','name') >> >> a = models.ForeignKey(A, num_in_admin=3) >> name = models.CharField(maxlength=255, core=True ) >> >........ > > > the 'a__id' syntax is correct. I don't quite understand what "seems to > locate some rows, but the listing page doesn't display." means. How can you > tell what it found if the listing page doesn't display? What displays > instead of the listing page -- an error, a blank page, a > never-finishes-loading page...? Well I see the search box, and when I enter the id of a known A and hit the go button The page that returns has "23 results (6380 total)" beside the go button and in the body of the page I see 23 as however there's no other text in the page. I expected to see the rows that were found. After testing with different data I believe it's just one of my data rows that's vanishing. > > For a simple example from my own models that works for me, I have (from a > legacy database so the names don't quite match what you'd expect for a > Django app): > ....... > Karen ........... -- Robin Becker --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---