[yocto] [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search

Jose Lamego jose.a.lamego at linux.intel.com
Mon Apr 3 12:41:18 PDT 2017



On 03/13/2017 08:01 PM, Paul Eggleton wrote:
> Hi Jose,
> 
> Sorry for the delay in responding to this.
> 
> I'd prefer if this were implemented like the recently added "inherits:" where 
> we have a special prefix e.g. "layer:" in order to search for things in a 
> particular layer. Then it's much clearer as to what's going on.
> 
I've submitted a new patch following this approach:
https://lists.yoctoproject.org/pipermail/yocto/2017-April/035451.html

> Cheers,
> Paul
> 
> On Tuesday, 14 March 2017 9:35:34 AM NZDT Jose Lamego wrote:
>> Ping.
>>
>> On 01/18/2017 04:19 PM, Jose Lamego wrote:
>>> From: Alex Franco <alejandro.franco at linux.intel.com>
>>>
>>> Recipe search cannot be narrowed to a specific layer, producing
>>> unnecessary results.
>>>
>>> This change allows including a layers name when searching for recipes to
>>> narrow the yielded results by adding a layer name to the
>>> simplesearch.getquery call in the recipe search view.
>>>
>>> [YOCTO #6618]
>>>
>>> Signed-off-by: Jose Lamego <jose.a.lamego at linux.intel.com>
>>> ---
>>>
>>>  layerindex/views.py | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/layerindex/views.py b/layerindex/views.py
>>> index 03fadbb..5db6fbc 100644
>>> --- a/layerindex/views.py
>>> +++ b/layerindex/views.py
>>>
>>> @@ -406,7 +406,8 @@ class RecipeSearchView(ListView):
>>>              qs0 = init_qs.filter(pn=query_string).order_by(*order_by)
>>>              qs0 = recipes_preferred_count(qs0)
>>>
>>> -            entry_query = simplesearch.get_query(query_string, ['pn'])
>>> +            entry_query = simplesearch.get_query(
>>> +                query_string, ['pn', 'layerbranch__layer__name'])
>>>
>>>              qs1 = init_qs.filter(entry_query).order_by(*order_by)
>>>              qs1 = recipes_preferred_count(qs1)
> 
> 

-- 
Jose Lamego | OTC Embedded Platforms & Tools | GDC

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170403/a4d8bcce/attachment.pgp>


More information about the yocto mailing list