Beispiel #1
0
    def absolute_name(self):
        """Get the absolute name of ``self``.

        Returns:
            str: the absolute name.
        """
        if self.is_root() or self.parent.is_root():
            return utils.slugify(self.name)
        return ':'.join([self.parent.absolute_name, utils.slugify(self.name)])
Beispiel #2
0
    def absolute_name(self):
        """Get the absolute name of ``self``.

        Returns:
            str: the absolute name.
        """
        if self.is_root() or self.parent.is_root():
            return utils.slugify(self.name)
        return ':'.join([self.parent.absolute_name, utils.slugify(self.name)])
Beispiel #3
0
 def __init__(self, name=None, url=None, items=None):
     self.items = []
     if items is not None:
         self.register_items(items)
     if name is not None:
         self.name = name
     if url is not None:
         self.url = url
     else:
         self.url = utils.slugify(self.name)
Beispiel #4
0
 def __init__(self, name=None, url=None, items=None):
     self.items = []
     if items is not None:
         self.register_items(items)
     if name is not None:
         self.name = name
     if url is not None:
         self.url = url
     else:
         self.url = utils.slugify(self.name)
Beispiel #5
0
 def create_blueprint(self,
                      template_folder='templates/foundation',
                      static_folder='static/foundation',
                      static_url_path='crud/static'):
     blueprint = Blueprint(
         utils.slugify(self.name), __name__,
         url_prefix=utils.concat_urls(self.url),
         template_folder=template_folder,
         static_folder=static_folder,
         static_url_path=static_url_path,
     )
     self.set_urls(blueprint)
     return blueprint
Beispiel #6
0
 def create_blueprint(self,
                      template_folder='templates/foundation',
                      static_folder='static/foundation',
                      static_url_path='crud/static'):
     blueprint = Blueprint(
         utils.slugify(self.name),
         __name__,
         url_prefix=utils.concat_urls(self.url),
         template_folder=template_folder,
         static_folder=static_folder,
         static_url_path=static_url_path,
     )
     self.set_urls(blueprint)
     return blueprint
Beispiel #7
0
 def _component_name(self, component):
     return ':'.join([
         self.absolute_name,
         utils.slugify(component.role.name),
         component.__name__.lower(),
     ])
Beispiel #8
0
 def _component_name(self, component):
     return ':'.join([
         self.absolute_name,
         utils.slugify(component.role.name),
         component.__name__.lower(),
     ])