Package ais :: Module sqlhelp :: Class select
[hide private]
[frames] | no frames]

Class select

source code

Construct an sql select query

Sometimes it just gets ugly having all that comma and WHERE AND logic in there. This code takes care of that

Instance Methods [hide private]
  __init__(self)
  setorderby(self, field, desc=False)
Make the returned rows come in some order
  addfield(self, fieldname)
Add a field name to return
  addwhere(self, boolTest)
Add expressions to chain together with ANDs
  addfrom(self, tableName)
Which tables the query will pull from
  setlimit(self, numOfItems)
Set the maximum number of items to return
  __str__(self)
Return the query as a string

Method Details [hide private]

__init__(self)
(Constructor)

source code 
None

setorderby(self, field, desc=False)

source code 
Make the returned rows come in some order

addfield(self, fieldname)

source code 
Add a field name to return

addwhere(self, boolTest)

source code 
Add expressions to chain together with ANDs

addfrom(self, tableName)

source code 
Which tables the query will pull from

setlimit(self, numOfItems)

source code 
Set the maximum number of items to return

__str__(self)
(Informal representation operator)

source code 
Return the query as a string