bip package

Subpackages

Submodules

bip.app module

bip.app.configure_app(app: Application) None

Load application configuration.

Parametry:
  • app (Application) – application object

  • env (Optional[str]) – environment name (may be None)

bip.app.configure_blueprints(app: Application) None

Register (mount) blueprint objects.

Parametry:

app (Application) – application object

bip.app.configure_database(_app: Application) None

Configure application database connectivity.

Parametry:

app (Application) – application object

bip.app.configure_error_handlers(app: Application) None

Configure global error handlers.

Parametry:

app (Application) – application object

bip.app.configure_extensions(app: Application) None

Register and configure framework extensions.

Parametry:

app (Application) – application object

bip.app.configure_hooks(app: Application) None

Set up application lifetime hooks.

Parametry:

app (Application) – application object

bip.app.configure_logging() None

Configure application logging on prod.

This configuration is overwritten if running under Gunicorn.

bip.app.configure_logging_handler(app: Application) None

Bind application logging to Gunicorn handler.

This is done only in production and only if Gunicorn logger has any handlers defined.

Parametry:

app (Application) – application object

bip.app.configure_templating(app: Application) None

Configure template system extensions.

Parametry:

app (Application) – application object

bip.app.make_app() Application

Application object factory.

Parametry:

env (Optional[str], optional) – environment name, defaults to None

Zwraca:

application object

Typ zwracany:

Application

bip.config module

bip.config_test module

bip.display module

class bip.display.ColumnOverride(title, datatype, align)

Klasy bazowe: tuple

Create new instance of ColumnOverride(title, datatype, align)

property align

Alias for field number 2

property datatype

Alias for field number 1

property title

Alias for field number 0

class bip.display.DisplayMeta(klass: ~bip.models.Model, columns: ~typing.List[str], overrides: ~typing.Mapping[str, ~bip.display.ColumnOverride] = <factory>)

Klasy bazowe: object

Tabular object display metadata.

cli_list_columns(overrides: Mapping[str, ColumnOverride]) List[ColSpec]

Generate list of column specifications for displaying in CLI.

Parametry:

overrides (Mapping[str, ColumnOverride]) – column param override information

Zwraca:

list of column specifications

Typ zwracany:

List[ColSpec]

columns: List[str]
klass: Model
overrides: Mapping[str, ColumnOverride]

bip.ext module

bip.models module

class bip.models.Attachment(*args, **kwargs)

Klasy bazowe: Model

DoesNotExist

alias of AttachmentDoesNotExist

created = <DateTimeField: Attachment.created>
description = <TextField: Attachment.description>
description_html = <TextField: Attachment.description_html>
property file_save_as: str
file_size = <IntegerField: Attachment.file_size>
file_type = <CharField: Attachment.file_type>
filename = <CharField: Attachment.filename>
page = <ForeignKeyField: Attachment.page>
page_id = <ForeignKeyField: Attachment.page>
pk = <AutoField: Attachment.pk>
title = <CharField: Attachment.title>
class bip.models.Change

Klasy bazowe: object

created = 1
deleted = 3
updated = 2
class bip.models.ChangeRecord(*args, **kwargs)

Klasy bazowe: Model

DoesNotExist

alias of ChangeRecordDoesNotExist

classmethod log_change(page: Page, change_type: Change, user: User, description: str) ChangeRecord
change_dt = <DateTimeField: ChangeRecord.change_dt>
change_type = <IntegerField: ChangeRecord.change_type>
property change_type_name
description = <TextField: ChangeRecord.description>
page = <ForeignKeyField: ChangeRecord.page>
page_id = <ForeignKeyField: ChangeRecord.page>
pk = <AutoField: ChangeRecord.pk>
user = <ForeignKeyField: ChangeRecord.user>
user_id = <ForeignKeyField: ChangeRecord.user>
class bip.models.Label(*args, **kwargs)

Klasy bazowe: Model

DoesNotExist

alias of LabelDoesNotExist

description = <TextField: Label.description>
description_html = <TextField: Label.description_html>
name = <CharField: Label.name>
pagelabel_set
pk = <AutoField: Label.pk>
slug = <CharField: Label.slug>
class bip.models.Model(*args, **kwargs)

Klasy bazowe: Model

DoesNotExist

alias of ModelDoesNotExist

id = <AutoField: Model.id>
class bip.models.Page(*args, **kwargs)

Klasy bazowe: Model

DoesNotExist

alias of PageDoesNotExist

labels(order=None)
active = <BooleanField: Page.active>
attachments
changes
created = <DateTimeField: Page.created>
created_by = <ForeignKeyField: Page.created_by>
created_by_id = <ForeignKeyField: Page.created_by>
description = <TextField: Page.description>
main = <BooleanField: Page.main>
order = <IntegerField: Page.order>
pagelabel_set
pk = <AutoField: Page.pk>
slug = <CharField: Page.slug>
text = <TextField: Page.text>
text_html = <TextField: Page.text_html>
title = <CharField: Page.title>
updated = <DateTimeField: Page.updated>
updated_by = <ForeignKeyField: Page.updated_by>
updated_by_id = <ForeignKeyField: Page.updated_by>
class bip.models.PageLabel(*args, **kwargs)

Klasy bazowe: Model

DoesNotExist

alias of PageLabelDoesNotExist

label = <ForeignKeyField: PageLabel.label>
label_id = <ForeignKeyField: PageLabel.label>
page = <ForeignKeyField: PageLabel.page>
page_id = <ForeignKeyField: PageLabel.page>
pk = <AutoField: PageLabel.pk>
class bip.models.User(*args, **kwargs)

Klasy bazowe: Model, UserMixin

DoesNotExist

alias of UserDoesNotExist

check_password(password: str) bool
get_id() str
is_active() bool
set_password(password: str)
active = <BooleanField: User.active>
admin = <BooleanField: User.admin>
changes
created = <DateTimeField: User.created>
email = <CharField: User.email>
name = <CharField: User.name>
pages_created
pages_updated
password = <TextField: User.password>
pk = <AutoField: User.pk>
bip.models.check_password_hash(stored: str, password: str) bool
bip.models.generate_password_hash(password: str) str
bip.models.get_db_driver()
bip.models.setup_db_collation(database)

bip.search module

bip.search.search_results(query: str, sections: Optional[List[str]] = None) Mapping[str, ModelSelect]

Extremely simple content search entrypoint.

Search is performed against provided sections or all sections if not provided (Pages, Labels, Attachments). Returned results are partitioned by data type. Pages are returned ordered by modification date, labels by name, attachments by creation date.

Search fields:

  • pages: title and text

  • labels: name

  • attachments: title and description

Parametry:
  • query (str) – search query

  • sections (Optional[List[str]], optional) – where to search, defaults to None

Zwraca:

search result partitioned by data type

Typ zwracany:

Mapping[str, ModelSelect]

bip.wsgi module