API
sqlalchemy_nav.Base
class sqlalchemy_nav.Base(template, label=None, href=None, *args, **kwargs) [source]
All SQLAlchemy-Nav mixins inherit from this base.
| Parameters: | template : str
Relative path to the html template file. Users should not pass this argument; it is passed automatically by mixins. label : str
Label (text) of the first
Hyperref of the first |
|---|---|
| Attributes: | id : int
Model identifier. index : int
Order of the model in its parent's list. e.g. the 0th The body of the object. This is converted to html when the object is rendered. a : bs4.Tag
First
Text of
Hyperref of |
Methods
is_active(self) [source]
| Returns: | is_active : bool
Indicates that the object's href is active. |
|---|
render(self, body=None) [source]
Prepares a bs4.BeautifulSoup object for rendering into html.
| Parameters: | body : sqlalchemy_mutablesoup.MutableSoup or None, default=None
Object to render. If |
|---|---|
| Returns: | body : sqlalchemy_mutablesoup.MutableSoup
Prepared for rendering into html. |
sqlalchemy_nav.NavbarMixin
class sqlalchemy_nav.NavbarMixin(name=None, *args, **kwargs) [source]
Navigation bar mixin.
| Parameters: | name : str
Name of the navigation bar. This facilitates finding the navigation bar when querying the database. *args, **kwargs :
Additional arguments and keyword arguments are passed to |
|---|---|
| Attributes: | name : str
Set from the
List of |
sqlalchemy_nav.NavitemMixin
class sqlalchemy_nav.NavitemMixin(navbar=None, dropdown=False, *args, **kwargs) [source]
Navigation item mixin.
| Parameters: | navbar : sqlalchemy_nav.NavbarMixin or None, default=None
Navigation bar with which this navigation item is associated. dropdown : bool, default=FalseIndicates that this navitem will contain dropdown items. *args, **kwargs :
Additional arguments and keyword arguments are passed to |
|---|---|
| Attributes: | navbar : sqlalchemy_nav.NavbarMixin or None
Set from the
List of |
sqlalchemy_nav.DropdownitemMixin
class sqlalchemy_nav.DropdownitemMixin(navitem=None, *args, **kwargs) [source]
Dropdown item mixin.
| Parameters: | navitem : sqlalchemy_nav.NavitemMixin or None, default=None
Navigation item with which this dropdown item is associated. *args, **kwargs :
Additional arguments and keyword arguments are passed to |
|---|---|
| Attributes: | navitem : sqlalchemy_nav.NavitemMixin or None
Set from the |