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


from gm_dataquery.dataquery import DataBuilder, DataSQLQuery
from gm_dataquery.db import DB

from api.models import College


class CollegeDB(DataBuilder):

    def getval_city_name(self, obj):
        return obj.city.name


@DB
class CollegeDQ(DataSQLQuery):
    model = College
    data_model = CollegeDB
    distinct = True
