Ejemplo n.º 1
0
def logPoints( related_object, points_claimed, points_total ):
    today = date.today()
    # logger.info("%s %d %f" % (related_object, points_claimed, points_total) )
    try:
        log = related_object.points_log.get( date=today )
        log.points_claimed=points_claimed
        log.points_total=points_total
        log.save()
        # logger.debug("logPoints found a previous record.")
    except PointsLog.DoesNotExist:
        log = PointsLog( points_claimed=points_claimed, points_total=points_total, related_object=related_object)
        log.save()
Ejemplo n.º 2
0
def logPoints(related_object, points_claimed, points_total):
    today = date.today()
    # logger.info("%s %d %f" % (related_object, points_claimed, points_total) )
    try:
        log = related_object.points_log.get(date=today)
        log.points_claimed = points_claimed
        log.points_total = points_total
        log.save()
        # logger.debug("logPoints found a previous record.")
    except:
        log = PointsLog(points_claimed=points_claimed,
                        points_total=points_total,
                        related_object=related_object)
        log.save()
Ejemplo n.º 3
0
def logPoints(related_object, points_claimed, points_total):
    today = date.today()
    try:
        log = related_object.points_log.get(date=today)
        log.points_claimed = points_claimed
        log.points_total = points_total
        log.save()
        logger.debug("logPoints found a previous record.")
    except PointsLog.DoesNotExist:
        log = PointsLog(points_claimed=points_claimed,
                        points_total=points_total,
                        related_object=related_object)
        log.save()
        logger.debug("logPoints created a new record.")
Ejemplo n.º 4
0
def calculateProject( project ):
    stories = project.stories.all();
    points = calculatePoints( stories )
    total_project_points = points[0]
    log = PointsLog( points_claimed=points[1], points_total=points[0], related_object=project)

    log.save();
    today = date.today()
    yesterday = today - timedelta( days=1 )
    tomorrow = today +  timedelta( days=1 )
    points_total = 0

    calculateProjectVelocity( project , total_project_points)

    for iteration in project.iterations.filter( start_date__lte=tomorrow, end_date__gte=yesterday):
        if( iteration != project.get_default_iteration() ):
            points = calculatePoints( iteration.stories.all() );
            if points[0] > 0:  # only logging active iterations with stuff in them

                log = PointsLog( points_claimed=points[1], points_total=points[0], related_object=iteration)
                log.save();