Django
This commit is contained in:
13
apps/charts/views.py
Normal file
13
apps/charts/views.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.shortcuts import render
|
||||
from django.core import serializers
|
||||
from apps.pages.models import *
|
||||
|
||||
# Create your views here.
|
||||
|
||||
def index(request):
|
||||
products = serializers.serialize('json', Product.objects.all())
|
||||
context = {
|
||||
'segment': 'charts',
|
||||
'products': products
|
||||
}
|
||||
return render(request, 'charts/index.html', context)
|
||||
Reference in New Issue
Block a user