Example #1
0
def get_date_count(date=None, user=1):
    if not date:
        date = timezone.localtime(timezone.now()).date()

    return functions.get_all_review(user=functions.get_user(user))\
        .annotate(date=TruncDate('review_time'))\
        .filter(date=date).count()
Example #2
0
def get_date(date=None, user=1):
    if not date:
        date = timezone.localtime(timezone.now()).date()

    return functions.get_all_review(user=functions.get_user(user))\
        .annotate(date=TruncDate('review_time'))\
        .filter(date=date)\
        .annotate(hour=TruncHour('review_time'))\
        .values("hour")\
        .annotate(count=Count('id'))\
        .order_by("hour")
Example #3
0
def get_count(user=1):
    return functions.get_all_review(user=functions.get_user(user))\
        .annotate(date=TruncDate('first_time'))\
        .values("date")\
        .annotate(count=Count('id'))\
        .order_by("-date")
Example #4
0
def get_error(error, user=1):

    return functions.get_all_review(user=functions.get_user(user))\
        .filter(error=error)\
        .order_by("review_time")
Example #5
0
def get_error_count(user=1):

    return functions.get_all_review(user=functions.get_user(user))\
        .values("error")\
        .annotate(count=Count('error'))\
        .order_by("-error")
Example #6
0
def get_level(level, user=1):

    return functions.get_all_review(user=functions.get_user(user))\
        .filter(level=level)\
        .order_by("review_time")
Example #7
0
def get_level_count(user=1):

    return functions.get_all_review(user=functions.get_user(user))\
        .values("level")\
        .annotate(count=Count('level'))\
        .order_by("-level")
Example #8
0
def get_review_count(user):
    return functions.get_all_review(user=functions.get_user(user)).count()