mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-03-26 01:40:25 +00:00
16 lines
504 B
Python
16 lines
504 B
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
import json
|
|
from django.views.generic import FormView
|
|
from django.http import HttpResponse
|
|
|
|
|
|
class TemplateFormView(FormView):
|
|
template_name = 'form.html'
|
|
|
|
|
|
def heavy_data(request):
|
|
numbers = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five']
|
|
results = [{'id': index, 'text': value} for (index, value) in enumerate(numbers)]
|
|
return HttpResponse(json.dumps({'err': 'nil', 'results': results}), content_type='application/json')
|