I think you are looking to add _get methods maybe.
Do you have a body and subject field in your database? I'm confused where
they are coming from. And what you mean to do with the pretty name stuff.
try adding something like:
class News(SQLObject):
***
_get_body_pretty_name(self):
return 'Post Body'
_get_subject_pretty_name(self):
return 'Subject'
then if you have a news instances you should be able to get
news.subject_pretty_name and get 'Subject'.
I'm not sure if this is what you are looking for. If not please give me
more info.
--
Rick
On Thu, 20 Jul 2006, Derek wrote:
> Hi All,
>
> Another somewhat silly question, anyone know of a way I can add
> attributes to columns that were autogenerated by using fromDatabase=True ?
>
> for example;
>
> 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). I tried overwriting the column
> definitions prior to defining those two (but after sqlmeta) but no luck
> there either. Anyone have any ideas what I should do?
>
>
>
-------------------------------------------------------------------------
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