class business(models.Model):
name=models.CharField(max_length=40, blank=True, null=True)
class phone(models.Model):
business=models.ForeignKey(business, verbose_name='Business',blank=False)
phone=models.CharField(max_length=40, blank=True, null=True)
in the admin.py
class businessAdmin(admin.ModelAdmin):
model=business
search_fields = phone__phone
How do we make this search work fine ? Ie, bring me all companies that possess the phone number entered by the User in the search of the form (Admin). ?