* Re: [layerindex-web][PATCH 1/2] views.py: Redirect to recipe details for single results
[not found] ` <1484777982-7168-2-git-send-email-jose.a.lamego@linux.intel.com>
@ 2017-03-13 20:35 ` Jose Lamego
2017-03-14 2:22 ` Paul Eggleton
0 siblings, 1 reply; 7+ messages in thread
From: Jose Lamego @ 2017-03-13 20:35 UTC (permalink / raw)
To: yocto; +Cc: paul.eggleton, Alex Franco
[-- Attachment #1.1: Type: text/plain, Size: 1443 bytes --]
Ping.
On 01/18/2017 04:19 PM, Jose Lamego wrote:
> From: Alex Franco <alejandro.franco@linux.intel.com>
>
> When a recipe search returns only one result, clicking the single
> result at the results view is still required to view further
> recipe detail.
>
> This change automatically redirects to the recipe details view
> when the recipe search returns a single result.
>
> [YOCTO #6618]
>
> Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
> ---
> layerindex/views.py | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/layerindex/views.py b/layerindex/views.py
> index 0f73e93..03fadbb 100644
> --- a/layerindex/views.py
> +++ b/layerindex/views.py
> @@ -372,6 +372,14 @@ class RecipeSearchView(ListView):
> context_object_name = 'recipe_list'
> paginate_by = 50
>
> + def render_to_response(self, context, **kwargs):
> + if len(self.object_list) == 1:
> + return HttpResponseRedirect("/layerindex/recipe/%s/"
> + % self.object_list[0].id)
> + else:
> + return super(ListView, self).render_to_response(context,
> + **kwargs)
> +
> def get_queryset(self):
> _check_url_branch(self.kwargs)
> query_string = self.request.GET.get('q', '')
>
--
Jose Lamego | OTC Embedded Platforms & Tools | GDC
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search
[not found] ` <1484777982-7168-3-git-send-email-jose.a.lamego@linux.intel.com>
@ 2017-03-13 20:35 ` Jose Lamego
2017-03-14 2:01 ` Paul Eggleton
0 siblings, 1 reply; 7+ messages in thread
From: Jose Lamego @ 2017-03-13 20:35 UTC (permalink / raw)
To: yocto; +Cc: paul.eggleton, Alex Franco
[-- Attachment #1.1: Type: text/plain, Size: 1308 bytes --]
Ping.
On 01/18/2017 04:19 PM, Jose Lamego wrote:
> From: Alex Franco <alejandro.franco@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@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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search
2017-03-13 20:35 ` [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search Jose Lamego
@ 2017-03-14 2:01 ` Paul Eggleton
2017-04-03 19:41 ` Jose Lamego
0 siblings, 1 reply; 7+ messages in thread
From: Paul Eggleton @ 2017-03-14 2:01 UTC (permalink / raw)
To: Jose Lamego; +Cc: yocto
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.
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@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@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)
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [layerindex-web][PATCH 1/2] views.py: Redirect to recipe details for single results
2017-03-13 20:35 ` [layerindex-web][PATCH 1/2] views.py: Redirect to recipe details for single results Jose Lamego
@ 2017-03-14 2:22 ` Paul Eggleton
0 siblings, 0 replies; 7+ messages in thread
From: Paul Eggleton @ 2017-03-14 2:22 UTC (permalink / raw)
To: Jose Lamego; +Cc: yocto
This should be using a reverse() call instead of a hardcoded URL path suffix.
However, since that was a trivial fix I've done that and merged it - it'll
appear in the layer index once we do the next upgrade (fairly soon).
Cheers,
Paul
On Tuesday, 14 March 2017 9:35:16 AM NZDT Jose Lamego wrote:
> Ping.
>
> On 01/18/2017 04:19 PM, Jose Lamego wrote:
> > From: Alex Franco <alejandro.franco@linux.intel.com>
> >
> > When a recipe search returns only one result, clicking the single
> > result at the results view is still required to view further
> > recipe detail.
> >
> > This change automatically redirects to the recipe details view
> > when the recipe search returns a single result.
> >
> > [YOCTO #6618]
> >
> > Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
> > ---
> >
> > layerindex/views.py | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/layerindex/views.py b/layerindex/views.py
> > index 0f73e93..03fadbb 100644
> > --- a/layerindex/views.py
> > +++ b/layerindex/views.py
> >
> > @@ -372,6 +372,14 @@ class RecipeSearchView(ListView):
> > context_object_name = 'recipe_list'
> > paginate_by = 50
> >
> > + def render_to_response(self, context, **kwargs):
> > + if len(self.object_list) == 1:
> > + return HttpResponseRedirect("/layerindex/recipe/%s/"
> > + % self.object_list[0].id)
> > + else:
> > + return super(ListView, self).render_to_response(context,
> > + **kwargs)
> > +
> >
> > def get_queryset(self):
> > _check_url_branch(self.kwargs)
> > query_string = self.request.GET.get('q', '')
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search
2017-03-14 2:01 ` Paul Eggleton
@ 2017-04-03 19:41 ` Jose Lamego
0 siblings, 0 replies; 7+ messages in thread
From: Jose Lamego @ 2017-04-03 19:41 UTC (permalink / raw)
To: Paul Eggleton; +Cc: yocto
[-- Attachment #1.1: Type: text/plain, Size: 1941 bytes --]
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@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@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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search
2017-01-18 22:31 ` [layerindex-web][PATCH 2/2] views.py: Consider layer name in " Jose Lamego
@ 2017-01-24 18:47 ` Jose Lamego
0 siblings, 0 replies; 7+ messages in thread
From: Jose Lamego @ 2017-01-24 18:47 UTC (permalink / raw)
To: yocto
ping
On 01/18/2017 04:31 PM, Jose Lamego wrote:
> From: Alex Franco <alejandro.franco@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@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search
2017-01-18 22:31 [layerindex-web][PATCH 0/2] Improvements to " Jose Lamego
@ 2017-01-18 22:31 ` Jose Lamego
2017-01-24 18:47 ` Jose Lamego
0 siblings, 1 reply; 7+ messages in thread
From: Jose Lamego @ 2017-01-18 22:31 UTC (permalink / raw)
To: yocto; +Cc: Alex Franco
From: Alex Franco <alejandro.franco@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@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)
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-04-03 19:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1484777982-7168-1-git-send-email-jose.a.lamego@linux.intel.com>
[not found] ` <1484777982-7168-2-git-send-email-jose.a.lamego@linux.intel.com>
2017-03-13 20:35 ` [layerindex-web][PATCH 1/2] views.py: Redirect to recipe details for single results Jose Lamego
2017-03-14 2:22 ` Paul Eggleton
[not found] ` <1484777982-7168-3-git-send-email-jose.a.lamego@linux.intel.com>
2017-03-13 20:35 ` [layerindex-web][PATCH 2/2] views.py: Consider layer name in recipe search Jose Lamego
2017-03-14 2:01 ` Paul Eggleton
2017-04-03 19:41 ` Jose Lamego
2017-01-18 22:31 [layerindex-web][PATCH 0/2] Improvements to " Jose Lamego
2017-01-18 22:31 ` [layerindex-web][PATCH 2/2] views.py: Consider layer name in " Jose Lamego
2017-01-24 18:47 ` Jose Lamego
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.