diff options
| author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-11-24 12:52:49 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-28 14:02:58 +0000 |
| commit | 4c82dfbb70477c3b48327f235de62ec7ce203c11 (patch) | |
| tree | 363a4ab8cf66ee88ec82fbafaa701282426f052a /bitbake/lib/toaster/orm/models.py | |
| parent | 152e2d9cc533c70cf3172c165d00ee177fb4aa78 (diff) | |
| download | poky-4c82dfbb70477c3b48327f235de62ec7ce203c11.tar.gz | |
bitbake: toastergui: update layer search criteria
In order to accomodate the designs around imported layer,
we add a "project" field for in the layer versions.
The field must be set if and only if the layer is manually
imported in the project. This will prevent information leakage
between different projects.
The views have been updated to perform relevant layer queries
in a single location.
(Bitbake rev: e1f7ec868b0702dfd27d5708581c134aaa6f4ae8)
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 99cc695012..364b215814 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -843,6 +843,8 @@ class Layer_Version(models.Model): | |||
| 843 | dirpath = models.CharField(max_length=255, null = True, default = None) # LayerBranch.vcs_subdir | 843 | dirpath = models.CharField(max_length=255, null = True, default = None) # LayerBranch.vcs_subdir |
| 844 | priority = models.IntegerField(default = 0) # if -1, this is a default layer | 844 | priority = models.IntegerField(default = 0) # if -1, this is a default layer |
| 845 | 845 | ||
| 846 | project = models.ForeignKey('Project', null = True, default = None) # Set if this layer is project-specific; always set for imported layers, and project-set branches | ||
| 847 | |||
| 846 | # code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ | 848 | # code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ |
| 847 | def _handle_url_path(self, base_url, path): | 849 | def _handle_url_path(self, base_url, path): |
| 848 | import re | 850 | import re |
| @@ -902,7 +904,7 @@ class Layer_Version(models.Model): | |||
| 902 | return sorted( | 904 | return sorted( |
| 903 | Layer_Version.objects.filter( layer__name = self.layer.name, up_branch__name = self.up_branch.name ), | 905 | Layer_Version.objects.filter( layer__name = self.layer.name, up_branch__name = self.up_branch.name ), |
| 904 | key = lambda x: _get_ls_priority(x.layer_source), | 906 | key = lambda x: _get_ls_priority(x.layer_source), |
| 905 | reverse = False) | 907 | reverse = True) |
| 906 | 908 | ||
| 907 | 909 | ||
| 908 | def __unicode__(self): | 910 | def __unicode__(self): |
