We add Django commands for the manage.py to manage the database content. The two commands added are: * buildslist - produces a list of current builds * builddelete - deletes a build and all associated data from the database (Bitbake rev: e9a8c32512bb270cda3dee4a3ed5fd22204c24bc) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14 lines
385 B
Python
14 lines
385 B
Python
from django.core.management.base import NoArgsCommand, CommandError
|
|
from orm.models import Build
|
|
import os
|
|
|
|
|
|
|
|
class Command(NoArgsCommand):
|
|
args = ""
|
|
help = "Lists current builds"
|
|
|
|
def handle_noargs(self,**options):
|
|
for b in Build.objects.all():
|
|
print "%d: %s %s %s" % (b.pk, b.machine, b.distro, ",".join([x.target for x in b.target_set.all()]))
|