SMERSH009 wrote: > Hi All, > When this code gets executed from my model.py file, it causes 2 > problems for me. > > class WebAppPages(SQLObject): > pageID = IntCol() > url = StringCol() > pageName = StringCol() > post = IntCol() > > here is what the output looks like: > D:\Temp\1Python\WebappsPy\WebAppTesting1>tg-admin sql sql > Using database URI mysql://root:[EMAIL PROTECTED]/test > CREATE TABLE web_app_pages ( > id INT PRIMARY KEY AUTO_INCREMENT, > page_id INT, > url TEXT, > page_name TEXT, > post INT > ); > > The first issue is that I do not want this column created at all: > id INT PRIMARY KEY AUTO_INCREMENT, > > instead, I want the column pageID to be my primary key by default. Is > there a way to declare this beforehand? > > > The second, but not as vital issue, is that capital letters in the > names get changed to underscores. > So for example pageID = IntCol() gets created as page_id INT > > Much thanks for the assistance. > Sam
Sam, Run, don't walk, and get the book, the TurboGears book. Both these questions are explained elsewhere too, but these are clearly laid out in the book. Short answer: you need to understand sqlmeta (a metadata class). It's well covered in Chaps 10, 11, 12 of the book. Paul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

