def get_model_field_name(field):
 field = slugify(field)
 field = field.replace('-', '_')
 field = field.replace(':', '_')
 if (field in ('id',)):
  field += '_'
 if (field.upper() in PG_RESERVED_KEYWORDS):
  field += '_'
 if (field[(-1):] == '_'):
  field += 'field'
 try:
  int(field)
  float(field)
  field = ('_%s' % field)
 except ValueError:
  pass
 return field

def get_model_field_name ( field ) : field = slugify ( field ) field = field . replace ( '-' , '_' ) field = field . replace ( ':' , '_' ) if ( field in ( 'id' , ) ) : field += '_' if ( field . upper ( ) in PG_RESERVED_KEYWORDS ) : field += '_' if ( field [ ( - 1 ) : ] == '_' ) : field += 'field' try : int ( field ) float ( field ) field = ( '_%s' % field ) except ValueError : pass return field
get the field name usable without quotes .