@@ -42,18 +42,18 @@ def format_keys(obj, format_type=None):
4242
4343 :format_type: Either 'camelize' or 'underscore'
4444 """
45- if ( getattr (settings , 'REST_EMBER_FORMAT_KEYS' , False )
46- and format_type in ('camelize' , 'underscore' )) :
45+ if getattr (settings , 'REST_EMBER_FORMAT_KEYS' , False )\
46+ and format_type in ('camelize' , 'underscore' ):
4747
4848 if isinstance (obj , dict ):
4949 formatted = {}
5050 for key , value in obj .items ():
5151 if format_type == 'camelize' :
52- ( formatted [inflection .camelize (key , False )]
53- = format_keys (value , format_type ))
52+ formatted [inflection .camelize (key , False )]\
53+ = format_keys (value , format_type )
5454 elif format_type == 'underscore' :
55- ( formatted [inflection .underscore (key )]
56- = format_keys (value , format_type ))
55+ formatted [inflection .underscore (key )]\
56+ = format_keys (value , format_type )
5757 return formatted
5858 if isinstance (obj , list ):
5959 return [format_keys (item , format_type ) for item in obj ]
@@ -69,7 +69,7 @@ def format_resource_name(obj, name):
6969 """
7070 if (getattr (settings , 'REST_EMBER_PLURALIZE_KEYS' , False )
7171 and isinstance (obj , list )):
72-
72+
7373 return inflection .pluralize (name ) if len (obj ) > 1 else name
7474 else :
7575 return name
0 commit comments