# -*- coding: UTF-8 -*-

from gm_dataquery.dataquery import DataSQLQuery
from gm_dataquery.db import DB
from api.models import PhotoStorage


@DB
class KaDQ(DataSQLQuery):
    model = PhotoStorage

    def create(self, **kwargs):
        img_length = len(kwargs)
        for img in kwargs.get('image'):
            if img:
                PhotoStorage.objects.create(image=img)
        return {'id': img_length}




