Hello All,
I am new to programming so apologize if this is an incredibly stupid question, but I have installed watson to my project however the search results are not displaying quite like I thought they would.
I have two models, a manufacturer and supplier. The manufacturer has just mfr name and part number. This mfr part number can be associated with many different supplier numbers as many suppliers use their own numbers to represent the mfr number. So I would like the search results to display all the suppliers information that carry that mfr part number, whether the user searches the mfr part or a given supplier number.
However that does not happen, if I type in the mfr number just one result is displayed which is the mfr number. If I type a supplier number only that specific supplier number is displayed. How do I set it up so if I search on either supplier or mfr number all the associated supplier numbers grouped to that one mfr number is displayed in the results? Is there a setting in Watson I need to adjust, or do I have my models setup incorrectly? Thanks in advance for any help.
Here is how I set up the models:
from django.db import models
class Parts(models.Model):
mfr_name = models.CharField(max_length=200, null=True)
mfr_part = models.CharField(max_length=30, null=True)
def __unicode__(self):
return self.mfr_part
class Supplier(models.Model):
sup_name = models.CharField(max_length=50)
sup_part = models.CharField(max_length=30)
part_desc = models.CharField(max_length=200)
part_price = models.CharField(max_length=6, null=True)
my_price = models.CharField(max_length=6, null=True)
part_qty = models.IntegerField(null=True)
part_img = models.ImageField(upload_to=None, height_field=None, width_field=None, max_length=400, null=True)
url = models.URLField()
Parts = models.ForeignKey('Parts')
def __unicode__(self):
return self.sup_part