diff options
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py | 27 | ||||
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 5 |
2 files changed, 32 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py b/bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py new file mode 100644 index 0000000000..194c897bdf --- /dev/null +++ b/bitbake/lib/toaster/orm/migrations/0002_auto_20151223_1528.py | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | from __future__ import unicode_literals | ||
| 3 | |||
| 4 | from django.db import migrations, models | ||
| 5 | |||
| 6 | |||
| 7 | class Migration(migrations.Migration): | ||
| 8 | |||
| 9 | dependencies = [ | ||
| 10 | ('orm', '0001_initial'), | ||
| 11 | ] | ||
| 12 | |||
| 13 | operations = [ | ||
| 14 | migrations.CreateModel( | ||
| 15 | name='Provides', | ||
| 16 | fields=[ | ||
| 17 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
| 18 | ('name', models.CharField(max_length=100)), | ||
| 19 | ('recipe', models.ForeignKey(to='orm.Recipe')), | ||
| 20 | ], | ||
| 21 | ), | ||
| 22 | migrations.AddField( | ||
| 23 | model_name='recipe_dependency', | ||
| 24 | name='via', | ||
| 25 | field=models.ForeignKey(null=True, default=None, to='orm.Provides'), | ||
| 26 | ), | ||
| 27 | ] | ||
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 6e87c54476..e4ab0bbc49 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -733,6 +733,10 @@ class Recipe_DependencyManager(models.Manager): | |||
| 733 | def get_queryset(self): | 733 | def get_queryset(self): |
| 734 | return super(Recipe_DependencyManager, self).get_queryset().exclude(recipe_id = F('depends_on__id')) | 734 | return super(Recipe_DependencyManager, self).get_queryset().exclude(recipe_id = F('depends_on__id')) |
| 735 | 735 | ||
| 736 | class Provides(models.Model): | ||
| 737 | name = models.CharField(max_length=100) | ||
| 738 | recipe = models.ForeignKey(Recipe) | ||
| 739 | |||
| 736 | class Recipe_Dependency(models.Model): | 740 | class Recipe_Dependency(models.Model): |
| 737 | TYPE_DEPENDS = 0 | 741 | TYPE_DEPENDS = 0 |
| 738 | TYPE_RDEPENDS = 1 | 742 | TYPE_RDEPENDS = 1 |
| @@ -743,6 +747,7 @@ class Recipe_Dependency(models.Model): | |||
| 743 | ) | 747 | ) |
| 744 | recipe = models.ForeignKey(Recipe, related_name='r_dependencies_recipe') | 748 | recipe = models.ForeignKey(Recipe, related_name='r_dependencies_recipe') |
| 745 | depends_on = models.ForeignKey(Recipe, related_name='r_dependencies_depends') | 749 | depends_on = models.ForeignKey(Recipe, related_name='r_dependencies_depends') |
| 750 | via = models.ForeignKey(Provides, null=True, default=None) | ||
| 746 | dep_type = models.IntegerField(choices=DEPENDS_TYPE) | 751 | dep_type = models.IntegerField(choices=DEPENDS_TYPE) |
| 747 | objects = Recipe_DependencyManager() | 752 | objects = Recipe_DependencyManager() |
| 748 | 753 | ||
