<s> from rest_framework . serializers import ModelSerializer , DateField <EOL> from rest_pandas import PandasUnstackedSerializer <EOL> from . models import TimeSeries , MultiTimeSeries , ComplexTimeSeries <EOL> from rest_pandas import USE_LIST_SERIALIZERS <EOL> if not USE_LIST_SERIALIZERS : <EOL> class DateField ( DateField ) : <EOL> def to_native ( self , date ) : <EOL> return str ( date ) <EOL> class TimeSeriesSerializer ( ModelSerializer ) : <EOL> class Meta : <EOL> model = TimeSeries <EOL> class MultiTimeSeriesSerializer ( ModelSerializer ) : <EOL> class Meta : <EOL> model = MultiTimeSeries <EOL> exclude = [ '<STR_LIT:id>' ] <EOL> pandas_index = [ '<STR_LIT:date>' ] <EOL> pandas_unstacked_header = [ '<STR_LIT>' ] <EOL> pandas_scatter_coord = [ '<STR_LIT>' ] <EOL> pandas_boxplot_group = '<STR_LIT>' <EOL> pandas_boxplot_date = '<STR_LIT:date>' <EOL> class ComplexTimeSeriesSerializer ( ModelSerializer ) : <EOL> date = DateField ( ) <EOL> class Meta : <EOL> model = ComplexTimeSeries <EOL> exclude = [ '<STR_LIT:id>' ] <EOL> pandas_index = [ '<STR_LIT:date>' , '<STR_LIT:type>' ] <EOL> pandas_unstacked_header = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class ComplexScatterSerializer ( ComplexTimeSeriesSerializer ) : <EOL> class Meta ( ComplexTimeSeriesSerializer . Meta ) : <EOL> exclude = [ '<STR_LIT:id>' , '<STR_LIT>' ] <EOL> pandas_scatter_coord = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> pandas_scatter_header = [ '<STR_LIT>' ] <EOL> class ComplexBoxplotSerializer ( ComplexTimeSeriesSerializer ) : <EOL> class Meta ( ComplexTimeSeriesSerializer . Meta ) : <EOL> exclude = [ '<STR_LIT:id>' , '<STR_LIT>' , '<STR_LIT:type>' ] <EOL> pandas_boxplot_group = '<STR_LIT>' <EOL> pandas_boxplot_date = '<STR_LIT:date>' <EOL> pandas_boxplot_header = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> if USE_LIST_SERIALIZERS : <EOL> class NotUnstackableSerializer ( ModelSerializer ) : <EOL> class Meta : <EOL> model = MultiTimeSeries <EOL> list_serializer_class = PandasUnstackedSerializer <EOL> pandas_index = [ '<STR_LIT>' ] <EOL> else : <EOL> class NotUnstackableSerializer ( ModelSerializer , PandasUnstackedSerializer ) : <EOL> class Meta : <EOL> model = MultiTimeSeries <EOL> pandas_index = [ '<STR_LIT>' ] </s>
