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

Configurable admin base URL

parent 989ac1c8
- Core - Core
- Pregenerate URLs for menu - Pregenerate URLs for menu
- Override base URL (/admin/)
- Model Admin - Model Admin
- Ability to sort by fields that are not visible? - Ability to sort by fields that are not visible?
- SQLA Model Admin - SQLA Model Admin
- Validation of the joins in the query - Validation of the joins in the query
- Automatic joined load for foreign keys - Automatic joined load for foreign keys
- Automatic PK detection
- Filtering - Filtering
- Many2Many editing - Many2Many editing
- File admin - File admin
......
...@@ -97,7 +97,8 @@ class BaseView(object): ...@@ -97,7 +97,8 @@ class BaseView(object):
`url` `url`
Base URL. If provided, affects how URLs are generated. For example, if url parameter 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 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.name = name
self.category = category self.category = category
...@@ -123,6 +124,9 @@ class BaseView(object): ...@@ -123,6 +124,9 @@ class BaseView(object):
# If url is not provided, generate it from endpoint name # If url is not provided, generate it from endpoint name
if self.url is None: if self.url is None:
self.url = '%s/%s' % (self.admin.url, self.endpoint) 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 name is not povided, use capitalized endpoint name
if self.name is None: 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