You probably want a) and b) and the same time. The issue is whether you use the id for searching or the slug. I do not think there is a difference in speed (if you make an index for the slug) but you will run into problems that two users may have the same first and last name and therefore the same slug.
On Wednesday, 14 August 2013 09:28:40 UTC-5, lesssugar wrote: > > Thanks, Massimo. One question more. What would be more efficient / faster > / better: > > a) rewrite the URL with routes.py > b) use IS_SLUG.urlify() to store the username (first_name+'-'+last_name) > in the db as a computed field to generate user profile's URL > > ? > > On Monday, August 12, 2013 9:14:09 AM UTC+2, Massimo Di Pierro wrote: >> >> I would use something like >> >> http://..../<id>/<name> >> >> where name is the IS_SLUG.urlify(user._first_name+'-'+user.last_name) and >> you can use <id> for a quick user lookup without worries about naming >> conflicts. >> >> On Sunday, 11 August 2013 21:35:47 UTC+2, lesssugar wrote: >>> >>> I need to create user profile URL based on user's name and last name, >>> replacing all the special characters (like Latin letters) with the allowed >>> ones. How do I achieve this with routes.py? Can't find a straight answer on >>> this subject in the book nor on the forum. >>> >> -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

