Commit Graph

6 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
095f4acd6f Replace usage of model._meta.get_all_field_names()
This is deprecated in Django 1.8, removed in later Django releases.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-04-24 10:15:47 +12:00
Paul Eggleton
a0396ebec7 Handle __isnull in API query filtering
If you query on a boolean field you can use the string "False" to match
False in the database; however if you try the same with __isnull then
the query will match every record which is obviously undesirable. If
__isnull is being used, then convert the value to a boolean so that the
query works properly.

An example of this type of query:

  http://127.0.0.1:8000/layerindex/api/layerBranches/?filter=yp_compatible_version__isnull:false

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-02-05 10:58:37 +13:00
Paul Eggleton
44386eea41 querysethelper: fix searching
Don't assume that every model will have a "search_allowed_fields"
attribute - if it doesn't, default to all CharFields in the model. This
fixes searching via the REST API.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-10-31 09:58:30 +13:00
Paul Eggleton
1d76228675 Use functools.reduce instead of reduce
This is apparently required in Python 3.3+, although I have been unable
to verify this locally.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-07-04 09:51:21 +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