Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

9 lines (7 sloc) 0.35 kb
from django.http import HttpResponse
from django.core import serializers
from models import SubCategory
def subcategory(request, category_id):
queryset = SubCategory.objects.filter(category=category_id)
content = serializers.serialize('json', queryset, fields=('pk','name'))
return HttpResponse(content, content_type='application/json')
Jump to Line
Something went wrong with that request. Please try again.