newComp = Composer.new(name = 'Hugo Wolf', country = 'Austria')
# 0.5.x looks just like PyDO, 0.6 (in the repository) changes it to: newComp = Composer(name='Hugo Wolf', country='Austria')
to create a new record
for field in newComp.keys(): ... to print or otherwise all the fields in a record
# I haven't made a good introspection mechanism, so it ends up being: for colSpec in newComp._columns: # colSpec has a bunch of structure, again which isn't well defined
newComp['name'] = 'Johann Strauss' to change a field
newComp.name = 'Johann Strauss'
newComp.delete() to delete a record
newComp.destroySelf()
Composer.getUnique(name = 'Max Reger') to get one record
# To declare that names are unique, the definition looks something like: class Composer(SQLObject): name = StringCol(alternateID=True)
# Then:
Composer.byName('Max Reger')rows = Composer.getSome(country = 'Austria') for r in rows: ... to get a group of rows and process them
rows = Composer.selectBy(country='Austria') # or more generally: rows = Composer.select(Composer.q.country == 'Austria') for r in rows: ...
-- Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
