Example #1
0
def get_group_filtered(request):
    form = GroupForm(request.GET or None)
    if form.is_valid():
        queryset = form.as_query()
    else:
        queryset = Group.objects.all()
        queryset.order_by("-timestamp")

    return form, queryset
Example #2
0
def get_group_filtered(request):
    form = GroupForm(request.GET or None)
    if form.is_valid():
        queryset = form.as_query()
    else:
        queryset = db.Query(Group)
        queryset.order("-timestamp")

    return form, queryset