# Path: app/blog_lab/cbv/src/dss/Serializer.py
# def serializer(data, datetime_format='timestamp', output_type='raw', include_attr=None, exclude_attr=None,
#                foreign=False, many=False, **kwargs):
#     foreign = remove_check(**kwargs) or foreign
#     time_func = TimeFormatFactory.get_time_func(datetime_format)
#     result = _data_convert(data, time_func, foreign, many, include_attr, exclude_attr)
#     return _output_convert(output_type, result)
# 
# Path: app/blog_lab/cbv/src/dss/TimeFormatFactory.py
# class TimeFormatFactory(object):
#     def __init__(self):
#         super(TimeFormatFactory, self).__init__()
# 
#     @staticmethod
#     def datetime_to_string(datetime_time, time_format='%Y-%m-%d %H:%M:%S'):
#         if datetime_time.tzinfo is None:
#             return datetime_time.strftime(time_format)
#         datetime_time = datetime_time.astimezone(timezone.get_current_timezone())
#         return datetime_time.strftime(time_format)
# 
#     @staticmethod
#     def datetime_to_timestamp(datetime_time):
#         if datetime_time.tzinfo is None:
#             return time.mktime(datetime_time.timetuple())
#         datetime_time = datetime_time.astimezone(timezone.get_current_timezone())
#         return time.mktime(datetime_time.timetuple())
# 
#     @staticmethod
#     def get_time_func(func_type='string', time_format='%Y-%m-%d %H:%M:%S'):
#         if func_type == 'string':
#             return partial(TimeFormatFactory.datetime_to_string, time_format=time_format)
#         elif func_type == 'timestamp':
#             return TimeFormatFactory.datetime_to_timestamp
#         else:
#             return partial(TimeFormatFactory.datetime_to_string, time_format=time_format)


import datetime
import json
from django.core.paginator import EmptyPage
from .Serializer import serializer
from .TimeFormatFactory import TimeFormatFactory
    from django.http import HttpResponse
# coding: utf-8

from __future__ import unicode_literals
from __future__ import absolute_import




try:
except ImportError:
    raise RuntimeError('django is required in django simple serializer')


class JsonResponseMixin(object):
    datetime_type = 'string'
    foreign = False
    many = False
    include_attr = None
    exclude_attr = None

    def time_format(self, time_obj):

# Path: app/blog_lab/cbv/src/dss/Serializer.py
# def serializer(data, datetime_format='timestamp', output_type='raw', include_attr=None, exclude_attr=None,
#                foreign=False, many=False, **kwargs):
#     foreign = remove_check(**kwargs) or foreign
#     time_func = TimeFormatFactory.get_time_func(datetime_format)
#     result = _data_convert(data, time_func, foreign, many, include_attr, exclude_attr)
#     return _output_convert(output_type, result)
# 
# Path: app/blog_lab/cbv/src/dss/TimeFormatFactory.py
# class TimeFormatFactory(object):
#     def __init__(self):
#         super(TimeFormatFactory, self).__init__()
# 
#     @staticmethod
#     def datetime_to_string(datetime_time, time_format='%Y-%m-%d %H:%M:%S'):
#         if datetime_time.tzinfo is None:
#             return datetime_time.strftime(time_format)
#         datetime_time = datetime_time.astimezone(timezone.get_current_timezone())
#         return datetime_time.strftime(time_format)
# 
#     @staticmethod
#     def datetime_to_timestamp(datetime_time):
#         if datetime_time.tzinfo is None:
#             return time.mktime(datetime_time.timetuple())
#         datetime_time = datetime_time.astimezone(timezone.get_current_timezone())
#         return time.mktime(datetime_time.timetuple())
# 
#     @staticmethod
#     def get_time_func(func_type='string', time_format='%Y-%m-%d %H:%M:%S'):
#         if func_type == 'string':
#             return partial(TimeFormatFactory.datetime_to_string, time_format=time_format)
#         elif func_type == 'timestamp':
#             return TimeFormatFactory.datetime_to_timestamp
#         else:
#             return partial(TimeFormatFactory.datetime_to_string, time_format=time_format)


# Path: app/blog_lab/cbv/src/dss/Mixin.py
import datetime
import json
from django.core.paginator import EmptyPage
from .Serializer import serializer
from .TimeFormatFactory import TimeFormatFactory
    from django.http import HttpResponse

# coding: utf-8

from __future__ import unicode_literals
from __future__ import absolute_import




try:
except ImportError:
    raise RuntimeError('django is required in django simple serializer')


class JsonResponseMixin(object):
    datetime_type = 'string'
    foreign = False
    many = False
    include_attr = None
    exclude_attr = None

    def time_format(self, time_obj):

        time_func = TimeFormatFactory.get_time_func(self.datetime_type)