Bob Ippolito wrote:
I'd personally tend towards something simpler, and enforce unique
titles... either automatically by adding predicable garbage to the end,
or by validating edits/creates to make sure they have a unique title.
It would be quite reasonable in the SQLObject trunk to create a column
that worked like:
class Article(SQLObject):
title = StringCol()
linkTitle = LinkTitle('title')
a = Article(title='foo bar')
a.linkTitle == 'foo-bar'
Article.byLinkTitle('foo-bar') == a
Basically you'd just be listening for create events, and generate the
actual link title at that time, making the title safe and then appending
stuff to make it unique (if necessary). I think this would be quite
useful for web apps. This example of a column tracking last-modified is
similar in mechanism:
http://xentac.net/~jchu/blog/technology/sqlobject-event-fu
--
Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org