Hello
I have implemented the search on 2 models in one of my apps Customers (Company and Contacts)
so when users search on search page from result of this app only the see results from those 2 models.
Now in the same project I created another app named vendors and this app has the logic as the Customers however the models have different name V_Company and V_Contact
so since in my apps I have registered the new tables I have defined for this app only :
apps.py
from django.apps import AppConfig
from watson import search as watson
class YourAppConfig(AppConfig):
name = "vendor"
def ready(self):
V_Contacts = self.get_model("V_Contacts")
watson.register(V_Contacts)
V_Company = self.get_model("V_Company")
watson.register(V_Company)
and my _init_.py
default_app_config = 'vendor.apps.YourAppConfig'
My search template form haven't changed
<h1>Vendor Search</h1>
<br>
<div class="row">
<div class="col-sm-4 col-md-4">
<form action="search">
<span class="glyphicon glyphicon-search"></span> <input name="q" value="{{request.GET.q}}">
<input type="submit" class="btn btn-primary btn-primary" value="Search">
</form>
</div>
</div>
And the views are copy paste fro your code
I was expecting that search output will be only for the models I have registered in this app but it looks like it provides all the search results also from the models registered in different app and not searching at all in models registered in this app.
Is it expected behavior or I am not configuring something correctly?