Ignore:
Timestamp:
Oct 3, 2008, 7:26:43 PM (16 years ago)
Author:
broder
Message:

Update web code to for SQLAlchemy 0.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/validation.py

    r1001 r1013  
    6464            self.vmtype = validVmType(vmtype)
    6565        if cdrom is not None:
    66             if not CDROM.get(cdrom):
     66            if not CDROM.query().get(cdrom):
    6767                raise CodeError("Invalid cdrom type '%s'" % cdrom)
    6868            self.cdrom = cdrom
    6969        if autoinstall is not None:
    70             self.autoinstall = Autoinstall.get(autoinstall)
     70            self.autoinstall = Autoinstall.query().get(autoinstall)
    7171
    7272
     
    184184    if vm_type is None:
    185185        return None
    186     t = Type.get(vm_type)
     186    t = Type.query().get(vm_type)
    187187    if t is None:
    188188        raise CodeError("Invalid vm type '%s'"  % vm_type)
     
    201201    except ValueError:
    202202        raise InvalidInput('machine_id', machine_id, "Must be an integer.")
    203     machine = Machine.get(machine_id)
     203    machine = Machine.query().get(machine_id)
    204204    if exists and machine is None:
    205205        raise InvalidInput('machine_id', machine_id, "Does not exist.")
     
    271271    if machine is not None and name == machine.name:
    272272        return None
    273     if not Machine.query().filter_by(name=name):
     273    if not Machine.query().filter_by(name=name).count():
    274274        if not validMachineName(name):
    275275            raise InvalidInput('name', name, 'You must provide a machine name.  Max 63 chars, alnum plus \'-\', does not begin or end with \'-\'.')
Note: See TracChangeset for help on using the changeset viewer.