IBM / page-lab

PageLab enables web performance, accessibility, SEO, etc testing at scale.
Apache License 2.0
19 stars 10 forks source link

Models and API that enable dynamic url filtering #36

Closed daviddahl closed 5 years ago

daviddahl commented 5 years ago

...based on self-service user input that is persisted globally in the database This is working. ~No tests. DO NOT MERGE:)~

This is for #28

daviddahl commented 5 years ago

so the way this works is like so:

In [1]: from report.models import *                                                                             

In [2]: filter = UrlFilter.objects.all()[0]                                                                     

In [3]: filter.run_query()                                                                                      
{'url_paths__path': 'longer', 'url_paths__sequence': 3}
Out[3]: <UrlQueryset [<Url: https://txt.ist/this/is/a/longer/path/and/stuff/proof.json?foo=bar&baz=bore&whoop=azz#fraggy>]>

We can create the UrlFilters in the admin UI for now - but we need to make a UI for it - should not be difficult at all.

The beauty here is now users can create their own sets of urls based on a very fast query of related data to the url.

daviddahl commented 5 years ago

@ecumike I added minimal tests: https://github.com/IBM/page-lab/pull/36/files#diff-6987c66d1bf14362d0b44549634fafa9