I do the same thing that you want. Here is how I would do it:
class WebAppPages(SQLObject):
class sqlmeta:
style=Style(longID=True)
idName = 'pageID'
url = StringCol()
pageName = StringCol()
post = IntCol()
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
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---