Started work on implementing blueprint based template loading

This commit is contained in:
Armin Ronacher 2011-03-19 03:28:39 +01:00
parent 1446614915
commit a06cd0a644
4 changed files with 93 additions and 22 deletions

View file

@ -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