On Thu, Jul 20, 2006 at 01:30:59PM -0700, Derek wrote:
> Another somewhat silly question, anyone know of a way I can add
> attributes to columns that were autogenerated by using fromDatabase=True ?
>
> class News(SQLObject):
> _connection = conn
> _connection.debug = True
> class sqlmeta:
> fromDatabase = True
> idName = 'NID'
> style = FOMStyle()
>
> body.prettyName = 'Post Body'
> subject.prettyName = 'Subject'
>
> body.prettyName and subject.prettyName both generate an error (because
> body isn't actually defined anywhere).
You have to wait until SQLObject metaclass creates the class and fetches
the columns:
class News(SQLObject):
_connection = conn
_connection.debug = True
class sqlmeta:
fromDatabase = True
idName = 'NID'
style = FOMStyle()
News.body.prettyName = 'Post Body'
News.subject.prettyName = 'Subject'
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss