I built a very simple recipe thingy for my mom last night, with the
recipe model shown below. The problem is that if I include recipe (a
TextField) in the search_fields, the search does nothing. Just
returns the default change_list view. If I take it out, everything
works fine. Any ideas? Thanks!
class Recipe(models.Model):
category = models.ManyToManyField(Category)
title = models.CharField(maxlength=200)
author = models.CharField(maxlength=100, null=True,
blank=True)
image_url = models.URLField(null=True, blank=True)
recipe = models.TextField()
notes = models.TextField(null=True, blank=True)
prep_time = models.CharField(maxlength=30, null=True,
blank=True)
inactive_prep_time = models.CharField(maxlength=30, null=True,
blank=True)
cook_time = models.CharField(maxlength=30, null=True,
blank=True)
yields = models.CharField(maxlength=50, null=True,
blank=True)
associated_recipe = models.ManyToManyField('self', null=True,
blank=True)
def __str__(self):
return self.title
def time(self):
return self.prep_time + self.inactive_prep_time +
self.cook_time
class Admin:
search_fields = ['title', 'recipe']
list_display = ('title', 'author', 'time', 'yields')
list_filter = ('category', 'author')
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---