<s> from stream_framework . serializers . aggregated_activity_serializer import AggregatedActivitySerializer <EOL> from stream_framework . utils . five import long_t <EOL> import pickle <EOL> class CassandraAggregatedActivitySerializer ( AggregatedActivitySerializer ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , model , * args , ** kwargs ) : <EOL> AggregatedActivitySerializer . __init__ ( self , * args , ** kwargs ) <EOL> self . model = model <EOL> def dumps ( self , aggregated ) : <EOL> activities = pickle . dumps ( aggregated . activities ) <EOL> model_instance = self . model ( <EOL> activity_id = long_t ( aggregated . serialization_id ) , <EOL> activities = activities , <EOL> group = aggregated . group , <EOL> created_at = aggregated . created_at , <EOL> updated_at = aggregated . updated_at <EOL> ) <EOL> return model_instance <EOL> def loads ( self , serialized_aggregated ) : <EOL> activities = pickle . loads ( serialized_aggregated [ '<STR_LIT>' ] ) <EOL> aggregated = self . aggregated_activity_class ( <EOL> group = serialized_aggregated [ '<STR_LIT>' ] , <EOL> activities = activities , <EOL> created_at = serialized_aggregated [ '<STR_LIT>' ] , <EOL> updated_at = serialized_aggregated [ '<STR_LIT>' ] , <EOL> ) <EOL> return aggregated </s>
