def convert_group_name_or_id_to_id(group_name_or_id, context):
 session = context['session']
 result = session.query(model.Group).filter_by(id=group_name_or_id).first()
 if (not result):
  result = session.query(model.Group).filter_by(name=group_name_or_id).first()
 if (not result):
  raise df.Invalid(('%s: %s' % (_('Not found'), _('Group'))))
 return result.id

def convert_group_name_or_id_to_id ( group_name_or_id , context ) : session = context [ 'session' ] result = session . query ( model . Group ) . filter_by ( id = group_name_or_id ) . first ( ) if ( not result ) : result = session . query ( model . Group ) . filter_by ( name = group_name_or_id ) . first ( ) if ( not result ) : raise df . Invalid ( ( '%s: %s' % ( _ ( 'Not found' ) , _ ( 'Group' ) ) ) ) return result . id
return the group id for the given group name or id .