예제 #1
0
 def get_product_count(self, merchant_id, work_service=None):
     '''
     todo:获取商户作品数量
     :param type:
     :param id:
     :return:
     '''
     my_key = 'product_count_' + str(merchant_id)
     count = self.mcache.get(my_key)
     if not count:
         if work_service is None:
             work_service = WorkServices()
         work_service.set_db(self.db)
         query = work_service.query_work(merchant_id=merchant_id)
         count = query.count()
         self.mcache.set(my_key, count)
     return count
예제 #2
0
파일: home.py 프로젝트: cash2one/gongzhuhao
#encoding:utf-8
__author__ = 'binpo'
from common.base import BaseApiHandler
from common.cache_base import WebCacheHandler
from services.series.series_services import SeriesServices
from services.home.home_service import HomeService
from services.company.company_services import CompanyServices
from services.work.work_services import WorkServices
from services.topics.topic_services import TopicServices
import time
import sys

series_service = SeriesServices()
company_service = CompanyServices()
work_service = WorkServices()
topic_service = TopicServices()
home_service = HomeService()


class UserIndexHandler(BaseApiHandler):

    #@login_control()
    def get(self, *args, **kwargs):
        self.echo('views/account/index.html')


class TopicIndexHandler(BaseApiHandler):
    def get(self, *args, **kwargs):
        self.redirect('/topic')

예제 #3
0
#encoding:utf-8
__author__ = 'binpo'
from common.base import BaseApiHandler
from common.cache_base import WebCacheHandler
from services.company.company_services import CompanyServices
from services.work.work_services import WorkServices
from services.series.series_services import SeriesServices
from services.company.location_service import LocationServices
from conf.merchant import _STYLE
from conf.work_conf import _QUERY_PRICE, PAGE_SIZE
import sys

product_service = WorkServices()
company_service = CompanyServices()

series_service = SeriesServices()

SERIES_PAGE_NUM = 18


class MerchantHandler(BaseApiHandler):
    def get(self, merchant_id, **kwargs):
        pass


class MerchantProducts(BaseApiHandler):
    def get(self, merchant_id, **kwargs):
        products = product_service.query_works(merchant_id)
        self.echo('')