Commit Graph

14 Commits

Author SHA1 Message Date
Meh Mbeh Ida Delphine
2314fb2811 Add SPDX license headers to layerindex-web source files
Added SPDX identifiers to all .py files except those in migrations directory.

Fixes: [YOCTO #13527]

Signed-off-by: Meh Mbeh Ida Delphine <idadelm@gmail.com>
Signed-off-by: Paul Eggleton <bluelightning@bluelightning.org>
2021-04-21 08:22:51 +12:00
Paul Eggleton
ee1ff214a0 API: fix recipes API performance regression
Adding these extra child items to the standard "recipes" viewset (which
we did recently in 684a06a383) means that
some current usage is impractical due to the size of the returned list
of items. Instead, create a recipesExtended viewset, move the new child
items to that and add pagination to avoid result size issues.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-09-16 17:14:25 +12:00
Paul Eggleton
01b1b030a0 API: add BBAppend and IncFile objects to REST API
These are a little less useful than the other items but if we want to be
able to create a clone of a layer index then we need them.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-08-05 16:17:58 +12:00
Paul Eggleton
684a06a383 API: add sources, patches, dependencies to recipes
We're tracking these items for each recipe, so they should be
accessible via the API as well.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-08-05 16:17:13 +12:00
Paul Eggleton
f6ab721ea0 restviews: add additional layer view with extra nested fields
It was a bit awkward to query layers externally - you had to do multiple
queries and you couldn't get the YP Compatible version info at all. Add
an additional LayerBranch-based view that exposes the branch name,
layer fields, YP Compatible Version and active maintainer information
with just one call.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-02-07 11:27:48 +13:00
Paul Eggleton
0059431309 restviews: add required field definitions
Django REST Framework now requires a field specification for every
ModelSerializer, so specify '__all__' to retain the current behaviour.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-02-07 11:27:23 +13:00
Paul Eggleton
c01b4120bf restviews: add access to layer maintainers and notes via REST API
Layer maintainer and layer note information wasn't available through the
REST API since it wasn't needed for Toaster, but for other uses it is
useful.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-02-07 11:27:14 +13:00
Paul Eggleton
4736d14327 restviews: explicitly use ReadOnlyModelViewSet
The entire API is meant to be read-only, so we should be using this
class instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-02-07 11:27:11 +13:00
Amanda Brindle
78c2561181 templates/layerindex/classes.html: Add bbclass search
Add another tab to search for classes.

Fixes [YOCTO #11207]

Signed-off by: Amanda Brindle <amanda.r.brindle@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-11-07 16:54:46 +13:00
Paul Eggleton
51614fe5a0 layerindex: add "No update" status to LayerItem
Add a status for a layer indicating it should not be updated. I don't
expect this to be widely used (and is only settable from the admin
interface) but would be useful if you have a legacy sub-layer that you
want to prevent from being visible on certain branches - it will prevent
the update script from doing anything with the layer and thus avoid
branch records from being auto-created on branches where you've deleted
it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-03-14 15:19:53 +13:00
Paul Eggleton
fd5111a2ac restviews: hide unpublished layers
Layers that aren't published shouldn't be visible via the API. (We don't
need to apply that filter to recipes, machines or distros though since a
layer's content won't automatically be indexed unless it has been
published).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-18 10:04:10 +13:00
Liam R. Howlett
31c85196d0 layerindex: Add distro to web interface and model
Add the distros to the index.  This looks a lot like the machines
and allows users to search for a particular distro.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>

Added associated migration.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-10-18 16:42:15 +13:00
Paul Eggleton
82c632ca2d Upgrade to Django 1.6+
I'd like to be upgrading to 1.8 but that causes problems with South, and
we're not quite ready to dispense with our existing migrations yet.

Part of the implementation for [YOCTO #9620].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-12 11:33:08 +12:00
Alexandru DAMIAN
1c9d6be527 expose REST API for layerindex
This patch enables a read-only REST API for the layerindex
application using Django REST Framework.

The objects of types Branch, LayerBranch and LayerItem are
exposed to queries so that the layerindex application can
function as a Layer Source in Toaster.

The library dependencies are documented in the requirements.txt
file.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
2014-09-24 11:32:34 +01:00