>
> It's rather hard to speculate without some specifics.  search_fields
> worksforme just fine.  What's your model look like?  What are you putting in
> search_fields? What do you enter in the search box and what entries are
> returned that seem like they should not be there?
>
> Karen

Below is a model. All of my models are constructed in a similar
fashion. I search for first names that I know exist, nothing. I search
for last names that I know exist and nothing. If I search for
'mark' (at least 5 in my db) the console says this:

[27/Oct/2007 21:55:39] "GET /admin/cases/person/?q=mark HTTP/1.1" 302
0

But it returns me to:

http://localhost:8000/admin/cases/person/?e=1

with every Person in the db shown. I've tried it with '=first_name'
also.

============= THE MODEL ==============

class Person(models.Model):
    """This is a person. I suppose that is obvious, because the class
name is 'person'?"""

    user            = models.ForeignKey(User, related_name = 'person',
unique=True,
                                        blank = True, null = True)
    group           = models.ForeignKey(Group, null = True)
    salutation      = models.CharField(maxlength = 5, blank = True,
null = True)
    first_name      = models.CharField(maxlength = 20, null = True)
    middle_name     = models.CharField(maxlength = 20, null = True,
blank = True)
    last_name       = models.CharField(maxlength = 20, null = True)
    firm            = models.ForeignKey(Firm, blank = True, null =
True, related_name = 'people')
    location        = models.ForeignKey('Location',
related_name='people', null = True, blank = True)

    class Admin:
        js = ['tiny_mce/tiny_mce.js', 'js/textareas.js']
        list_display    = ('last_name', 'first_name', 'firm',)
        list_filter     = ('group', 'firm',)
        ordering        = ('-last_name',)
        search_fields   = ('first_name', 'last_name', 'firm')
        list_select_related = True
    class Meta:
        verbose_name_plural = "People"
    def __unicode__(self):
        return '%s %s' % (self.first_name, self.last_name)


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to