<s> from rest_framework import serializers <EOL> from main . models import Station <EOL> from restapi . utils import ( <EOL> dromeda_to_underscore , <EOL> underscore_to_dromeda , <EOL> ) <EOL> class AbstractDromedaSerializer ( serializers . ModelSerializer ) : <EOL> """<STR_LIT>""" <EOL> def to_internal_value ( self , data ) : <EOL> for key in list ( data . keys ( ) ) : <EOL> data [ dromeda_to_underscore ( key ) ] = data . pop ( key ) <EOL> return super ( ) . to_internal_value ( data ) <EOL> def to_representation ( self , obj ) : <EOL> data = super ( ) . to_representation ( obj ) <EOL> for key in list ( data . keys ( ) ) : <EOL> data [ underscore_to_dromeda ( key ) ] = data . pop ( key ) <EOL> return data <EOL> class StationSerializer ( AbstractDromedaSerializer ) : <EOL> class Meta : <EOL> model = Station </s>
