def group_id_exists(group_id, context):
 model = context['model']
 session = context['session']
 result = session.query(model.Group).get(group_id)
 if (not result):
  raise Invalid(('%s: %s' % (_('Not found'), _('Group'))))
 return group_id

def group_id_exists ( group_id , context ) : model = context [ 'model' ] session = context [ 'session' ] result = session . query ( model . Group ) . get ( group_id ) if ( not result ) : raise Invalid ( ( '%s: %s' % ( _ ( 'Not found' ) , _ ( 'Group' ) ) ) ) return group_id
raises invalid if the given group_id does not exist in the model given in the context .