def get_pk_columns(cls):
 retval = []
 for (k, v) in cls.get_flat_type_info(cls).items():
  if ((v.Attributes.sqla_column_args is not None) and v.Attributes.sqla_column_args[(-1)].get('primary_key', False)):
   retval.append((k, v))
 return (tuple(retval) if (len(retval) > 0) else None)

def get_pk_columns ( cls ) : retval = [ ] for ( k , v ) in cls . get_flat_type_info ( cls ) . items ( ) : if ( ( v . Attributes . sqla_column_args is not None ) and v . Attributes . sqla_column_args [ ( - 1 ) ] . get ( 'primary_key' , False ) ) : retval . append ( ( k , v ) ) return ( tuple ( retval ) if ( len ( retval ) > 0 ) else None )
return primary key fields of a spyne object .