On 10 November 2015 at 12:39, Michael Wood <[email protected]> wrote:
> A projects builds should be counted apart from those which are currently in > progress. > I've submitted this and the other patches to bitbake-devel (I couldn't find any trace of the cover letter to respond to). I will add these patches to toaster-next shortly. Elliot > > Signed-off-by: Michael Wood <[email protected]> > --- > bitbake/lib/toaster/orm/models.py | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/bitbake/lib/toaster/orm/models.py > b/bitbake/lib/toaster/orm/models.py > index 3832905..0ac94b9 100644 > --- a/bitbake/lib/toaster/orm/models.py > +++ b/bitbake/lib/toaster/orm/models.py > @@ -130,13 +130,12 @@ class Project(models.Model): > try: > return self.projectvariable_set.get(name="MACHINE").value > except (ProjectVariable.DoesNotExist,IndexError): > - return( "None" ); > + return None; > > def get_number_of_builds(self): > - try: > - return len(Build.objects.filter( project = self.id )) > - except (Build.DoesNotExist,IndexError): > - return( 0 ) > + """Return the number of builds which have ended""" > + > + return > self.build_set.filter(~Q(outcome=Build.IN_PROGRESS)).count() > > def get_last_build_id(self): > try: > -- > 2.5.0 > > -- > _______________________________________________ > toaster mailing list > [email protected] > https://lists.yoctoproject.org/listinfo/toaster > -- Elliot Smith Software Engineer Intel Open Source Technology Centre
-- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
