logo

Personal tools
Vasudeva Documentation Archetypes Tips Auto-generating ids from titles
Document Actions

Auto-generating ids from titles

It's easy to have AT automatically generate an id from an object's title

When creating a new object the auto-generated ids are NOT something you want to appear in a url. Many times you want the id to be a normalized version of the title. For example, if a book title is "Songs of the Soul", you want the id to be "songs-of-the-soul".

Fortunately the AT authors realized this and made it easy to do beginning with AT 1.3.4. You only need one line of code in your content type class definition:

 class vsLibraryBook(BaseFolder):

    _at_rename_after_creation = True

That's all there is to it.

page created by admin last modified 2005-08-26 00:33