Started work on implementing blueprint based template loading
This commit is contained in:
parent
1446614915
commit
a06cd0a644
4 changed files with 93 additions and 22 deletions
|
|
@ -62,9 +62,17 @@ class Request(RequestBase):
|
|||
@property
|
||||
def module(self):
|
||||
"""The name of the current module"""
|
||||
if self.url_rule and '.' in self.url_rule.endpoint:
|
||||
if self.url_rule and \
|
||||
':' not in self.url_rule.endpoint and \
|
||||
'.' in self.url_rule.endpoint:
|
||||
return self.url_rule.endpoint.rsplit('.', 1)[0]
|
||||
|
||||
@property
|
||||
def blueprint(self):
|
||||
"""The name of the current blueprint"""
|
||||
if self.url_rule and ':' in self.url_rule.endpoint:
|
||||
return self.url_rule.endpoint.split(':', 1)[0]
|
||||
|
||||
@cached_property
|
||||
def json(self):
|
||||
"""If the mimetype is `application/json` this will contain the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue