# -*- coding: utf-8 -*-

from __future__ import division

from django.conf import settings
from django_logit import logit
from django_response import response

from mch.models import SlideInfo


@logit
def slides(request):
    brand_id = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_ID)

    slides = SlideInfo.objects.filter(brand_id=brand_id)
    slides = [s.data for s in slides]

    return response(data={
        'slides': slides,
    })
