Skip to content

Instantly share code, notes, and snippets.

@brechin
Created September 21, 2018 14:56
Show Gist options
  • Save brechin/7a1d27c2cb18b001262f720110adafa0 to your computer and use it in GitHub Desktop.
Save brechin/7a1d27c2cb18b001262f720110adafa0 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.http import JsonResponse
from .filters import MyFilter
def model_list(request):
filter = MyFilter(request.GET)
return JsonResponse([m for m in filter.qs.values('id', 'base', 'count', 'doubled')], safe=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment