Hello Oleg and others, 

But if I use 'id' instead of 'title_id' I get: 

File 
"/diska/data/workspace/PyXtern/Bibliothek/eggs/SQLObject-0.10.4-py2.5.egg/sqlobject/main.py",
 line 1203, in __init__ 
File 
"/diska/data/workspace/PyXtern/Bibliothek/eggs/SQLObject-0.10.4-py2.5.egg/sqlobject/main.py",
 line 1237, in _create 
TypeError: titles() did not get expected keyword argument 'title_id' 

I hope it helps if I use dots to preserve the indentation: 
======================================= 
from.sqlobject.import.* 

class.titles(.SQLObject.): 

....title_id = IntCol() 
....title = StringCol() 

....class.sqlmeta: 
........print.'class.sqlmeta' 
........idName = 'title_id' 
........lazyUpdate = False 
======================================= 
second class to insert a row: 
======================================= 
from sqlobject import * 
import titles 

class InsertNewTitle: 

....def makeNewBook( self ): 
........sybURI = "sybase://my_user_id:my_passw...@dbserver//library_info" 
........konnection = connectionForURI(sybURI) 
........konnection.debug = True 
........konnection.autoCommit = True 
........sqlhub.processConnection = konnection 

........newKey = 1237 
........newTitle = "Mystery Book" 
........book_b = titles.titles(id=newKey, title=newTitle) 

........print 'for ID %d the title is %s' % (book_b.id, book_b.title) 
........return None 

if __name__ == "__main__": 
....instantiatedObject = InsertNewTitle() 
....instantiatedObject.makeNewBook() 
========================================= 
I also tried mixing various combinations of 
'id' and 'title_id' in the two locations 
but an error always results, with no 
indication what it really wants. 

Thanks very much, 
....WZ 

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to