Kevin Dangoor wrote:
Django has a slug field with is similar.

From the site:

SlugField

   "Slug" is a newspaper term. A slug is a short label for something,
containing only letters, numbers, underscores or hyphens. They're
generally used in URLs.

(http://www.djangoproject.com/documentation/model_api/)

I believe it has some built in validation to make sure it complies with
that definition.

This might be a useful addition to TurboGears, whether or not it makes
it into SQLObject directly.

Just a thought.  Django has some good ideas.  We can learn from it.


Absolutely. I'm not sure how easy this would be to do with SQLObject
0.7 (or when Ian plans 0.8), but this does seem like a generally
useful construct.

Django's slugs are basically implemented on the client side via the admin screen (from what I can tell), they aren't particularly tied to the model. They are mostly like alternateID=true. So there's nothing special SQLObject has to do to support that. But CatWalk would have to pay attention to populate_from.

For slugs to be generated automatically when an instance was created requires the events (or hardcoding slug functionality, but that'd be silly).

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org

Reply via email to