Commit 74a9b6a6 authored by Serge S. Koval's avatar Serge S. Koval

Configurable admin base URL

parent 989ac1c8
- Core
- Pregenerate URLs for menu
- Override base URL (/admin/)
- Model Admin
- Ability to sort by fields that are not visible?
- SQLA Model Admin
- Validation of the joins in the query
- Automatic joined load for foreign keys
- Automatic PK detection
- Filtering
- Many2Many editing
- File admin
......
......@@ -97,7 +97,8 @@ class BaseView(object):
`url`
Base URL. If provided, affects how URLs are generated. For example, if url parameter
equals to "test", resulting URL will look like "/admin/test/". If not provided, will
use endpoint as a base url.
use endpoint as a base url. However, if URL starts with '/', absolute path is assumed
and '/admin/' prefix won't be applied.
"""
self.name = name
self.category = category
......@@ -123,6 +124,9 @@ class BaseView(object):
# If url is not provided, generate it from endpoint name
if self.url is None:
self.url = '%s/%s' % (self.admin.url, self.endpoint)
else:
if not self.url.startswith('/'):
self.url = '%s/%s' % (self.admin.url, self.url)
# If name is not povided, use capitalized endpoint name
if self.name is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment