Beispiel #1
0
def render_tag_widget(group, tag):
    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'unique_tags': list(group.get_unique_tags(tag)[:10]),
        'group': group,
    }
Beispiel #2
0
def render_tag_widget(group, tag):
    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'unique_tags': list(group.get_unique_tags(tag)[:10]),
        'group': group,
    }
Beispiel #3
0
def render_tag_widget(group, tag):
    return {
        "title": tag.replace("_", " ").title(),
        "tag_name": tag,
        "unique_tags": list(group.get_unique_tags(tag)[:10]),
        "group": group,
    }
Beispiel #4
0
def render_tag_widget(group, tag):
    cutoff = timezone.now() - timedelta(days=7)

    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'group': group,
    }
Beispiel #5
0
def render_tag_widget(group, tag):
    cutoff = timezone.now() - timedelta(days=7)

    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'group': group,
    }
def render_tag_widget(group, tag):
    total = GroupTagValue.objects.filter(
        group=group,
        key=tag,
    ).aggregate(t=Sum('times_seen'))['t'] or 0

    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'unique_tags': list(group.get_unique_tags(tag)[:10]),
        'total_count': total,
        'group': group,
    }
Beispiel #7
0
def render_tag_widget(group, tag):
    cutoff = timezone.now() - timedelta(days=7)

    total = (
        GroupTagValue.objects.filter(group=group, key=tag, last_seen__gte=cutoff).aggregate(t=Sum("times_seen"))["t"]
        or 0
    )

    return {
        "title": tag.replace("_", " ").title(),
        "tag_name": tag,
        "unique_tags": list(group.get_unique_tags(tag, cutoff)[:10]),
        "total_count": total,
        "group": group,
    }
Beispiel #8
0
def render_tag_widget(group, tag):
    cutoff = timezone.now() - timedelta(days=7)

    total = GroupTagValue.objects.filter(
        group=group,
        key=tag,
        last_seen__gte=cutoff,
    ).aggregate(t=Sum('times_seen'))['t'] or 0

    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'unique_tags': list(group.get_unique_tags(tag, cutoff)[:10]),
        'total_count': total,
        'group': group,
    }
Beispiel #9
0
def render_tag_widget(group, tag):
    cutoff = timezone.now() - timedelta(days=7)

    total = GroupTagValue.objects.filter(
        group=group,
        key=tag,
        last_seen__gte=cutoff,
    ).aggregate(t=Sum('times_seen'))['t'] or 0

    return {
        'title': tag.replace('_', ' ').title(),
        'tag_name': tag,
        'unique_tags': list(group.get_unique_tags(tag, cutoff)[:10]),
        'total_count': total,
        'group': group,
    }
Beispiel #10
0
def render_tag_widget(group, tag):
    cutoff = timezone.now() - timedelta(days=7)

    return {"title": tag.replace("_", " ").title(), "tag_name": tag, "group": group}