I need a page slug for the cars in my car shop,
instead having http://.../default/car/2,
I want http://..../default/car/carbrand-carmodel-caryear-id

so I defined a table:

db.define_table('car'
                         Field('brand', db.brand),
                         Field('model'),
                         Field('year','integer'),
                         Field('slug')
                         )

but I do not want the user to fill the "slug" field, so I have to define
default value to the slug field, concatenating 'brand' + 'model' + 'year' +
'slug' joining with a '-',
eg:
id = 2
brand = 'Toyota'
model = 'Corolla'
year = '2010'
slug = 'toyota-corolla-2010-2'

how can I get this to be automaticaly filled when inserting? (just like a
trigger)

Reply via email to