diff options
author | Liam R. Howlett <Liam.Howlett@WindRiver.com> | 2016-10-04 14:00:20 -0400 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-10-18 16:42:15 +1300 |
commit | 31c85196d05392726afaed622b46b13210e5912b (patch) | |
tree | 5cc4f950ff2f41f535f7eceef913765c1221c12c /layerindex/models.py | |
parent | 4f0be8a7d03124aa834431e301a2f54abf05cd61 (diff) | |
download | openembedded-core-contrib-31c85196d05392726afaed622b46b13210e5912b.tar.gz |
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>
Diffstat (limited to 'layerindex/models.py')
-rw-r--r-- | layerindex/models.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/layerindex/models.py b/layerindex/models.py index 3fd16d43d3..2343ba7b04 100644 --- a/layerindex/models.py +++ b/layerindex/models.py @@ -361,6 +361,20 @@ class Machine(models.Model): def __str__(self): return '%s (%s)' % (self.name, self.layerbranch.layer.name) +class Distro(models.Model): + layerbranch = models.ForeignKey(LayerBranch) + name = models.CharField(max_length=255) + description = models.CharField(max_length=255) + + updated = models.DateTimeField(auto_now=True) + + def vcs_web_url(self): + url = self.layerbranch.file_url(os.path.join('conf/distro/%s.conf' % self.name)) + return url or '' + + def __str__(self): + return '%s (%s)' % (self.name, self.layerbranch.layer.name) + class BBAppend(models.Model): layerbranch = models.ForeignKey(LayerBranch) |