Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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.