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

from __future__ import division

from mch.models import BrandInfo, DistributorInfo, ModelInfo
from utils.error.response_utils import response


def brands_list(request):
    brands = BrandInfo.objects.filter(status=True)
    brands = [brand.data for brand in brands]

    return response(200, data={
        'brands': brands,
    })


def models_list(request):
    models = ModelInfo.objects.filter(status=True)
    models = [model.data for model in models]

    return response(200, data={
        'models': models,
    })


def distributors_list(request):
    distributors = DistributorInfo.objects.filter(status=True)
    distributors = [distributor.data for distributor in distributors]

    return response(200, data={
        'distributors': distributors,
    })
