ERP5 KM

GuidelinesForUrlGeneration

How URL should be generated on ERP5

URL always needs an action name or method name

Because of string operations on URLs, ERP5 must always append an action name or a method name in every URL. For instance, when ERP5 gets a URL string "/erp5/person_module/view" and traverse an object, ERP5 needs to use this kind of statement:

path = url.split('/')[:-1] # path == ['erp5', 'person_module']

If you pass "/erp5/person_module" which shows up the same interface instead, the statement fails:

path = url.split('/')[:-1] # path == ['erp5']

Generally, this does not happen frequently, but not easy to fix at the same time. So when you make an URL, you must make sure that the URL ends with a method name instead of an object name. Note that you may not omit a method name if it is something else than view, thus it is better to stick to appending a method name all the time, if you have to select including a method name or not.

GuidelinesForUrlGeneration (last edited 2008-01-03 13:48:10 by localhost)

Page
  • Immutable Page
  • Info
  • Attachments
User
Learn about new ERP5 releases,technical articles, events and more.

Subscribe to the monthly ERP5 Newsletter!