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

from django.db.models import Q
from gm_dataquery.dataquery import DataBuilder, DataSQLQuery
from gm_dataquery.db import DB

from community.models import TopicSticky


class TopicStickyDB(DataBuilder):
    def getval_topic__created_time(self, obj):
        return str(obj.topic.created_time)


@DB
class TopicStickyDQ(DataSQLQuery):
        model = TopicSticky
        data_model = TopicStickyDB
