bip.admin package

Submodules

bip.admin.forms module

class bip.admin.forms.AttachmentCreateForm(*args, **kwargs)

Klasy bazowe: BaseForm

Parametry:
  • formdata – Input data coming from the client, usually request.form or equivalent. Should provide a „multi dict” interface to get a list of values for a given key, such as what Werkzeug, Django, and WebOb provide.

  • obj – Take existing data from attributes on this object matching form field attributes. Only used if formdata is not passed.

  • prefix – If provided, all fields will have their name prefixed with the value. This is for distinguishing multiple forms on a single page. This only affects the HTML name for matching input data, not the Python name for matching existing data.

  • data – Take existing data from keys in this dict matching form field attributes. obj takes precedence if it also has a matching attribute. Only used if formdata is not passed.

  • meta – A dict of attributes to override on this form’s meta instance.

  • extra_filters – A dict mapping field attribute names to lists of extra filter functions to run. Extra filters run after filters passed when creating the field. If the form has filter_<fieldname>, it is the last extra filter.

  • kwargs – Merged with data to allow passing existing data as parameters. Overwrites any duplicate keys in data. Only used if formdata is not passed.

save(page: Page) Attachment
description = <UnboundField(TextAreaField, ('opis',), {})>
file = <UnboundField(FileField, ('plik załącznika',), {'validators': [<flask_wtf.file.FileRequired object>]})>
op = <UnboundField(HiddenField, (), {'default': 'add'})>
title = <UnboundField(StringField, ('tytuł',), {})>
class bip.admin.forms.AttachmentForm(*args, **kwargs)

Klasy bazowe: ObjectForm

Parametry:
  • formdata – Input data coming from the client, usually request.form or equivalent. Should provide a „multi dict” interface to get a list of values for a given key, such as what Werkzeug, Django, and WebOb provide.

  • obj – Take existing data from attributes on this object matching form field attributes. Only used if formdata is not passed.

  • prefix – If provided, all fields will have their name prefixed with the value. This is for distinguishing multiple forms on a single page. This only affects the HTML name for matching input data, not the Python name for matching existing data.

  • data – Take existing data from keys in this dict matching form field attributes. obj takes precedence if it also has a matching attribute. Only used if formdata is not passed.

  • meta – A dict of attributes to override on this form’s meta instance.

  • extra_filters – A dict mapping field attribute names to lists of extra filter functions to run. Extra filters run after filters passed when creating the field. If the form has filter_<fieldname>, it is the last extra filter.

  • kwargs – Merged with data to allow passing existing data as parameters. Overwrites any duplicate keys in data. Only used if formdata is not passed.

save(obj: Attachment) Attachment
description = <UnboundField(TextAreaField, ('opis',), {})>
title = <UnboundField(StringField, ('tytuł',), {})>
class bip.admin.forms.LabelForm(*args, **kwargs)

Klasy bazowe: ObjectForm

Parametry:
  • formdata – Input data coming from the client, usually request.form or equivalent. Should provide a „multi dict” interface to get a list of values for a given key, such as what Werkzeug, Django, and WebOb provide.

  • obj – Take existing data from attributes on this object matching form field attributes. Only used if formdata is not passed.

  • prefix – If provided, all fields will have their name prefixed with the value. This is for distinguishing multiple forms on a single page. This only affects the HTML name for matching input data, not the Python name for matching existing data.

  • data – Take existing data from keys in this dict matching form field attributes. obj takes precedence if it also has a matching attribute. Only used if formdata is not passed.

  • meta – A dict of attributes to override on this form’s meta instance.

  • extra_filters – A dict mapping field attribute names to lists of extra filter functions to run. Extra filters run after filters passed when creating the field. If the form has filter_<fieldname>, it is the last extra filter.

  • kwargs – Merged with data to allow passing existing data as parameters. Overwrites any duplicate keys in data. Only used if formdata is not passed.

save(obj: Optional[Label] = None) Label
description = <UnboundField(TextAreaField, ('opis',), {})>
name = <UnboundField(StringField, ('nazwa',), {'validators': [<wtforms.validators.InputRequired object>]})>
class bip.admin.forms.PageForm(*args, **kwargs)

Klasy bazowe: ObjectForm

Parametry:
  • formdata – Input data coming from the client, usually request.form or equivalent. Should provide a „multi dict” interface to get a list of values for a given key, such as what Werkzeug, Django, and WebOb provide.

  • obj – Take existing data from attributes on this object matching form field attributes. Only used if formdata is not passed.

  • prefix – If provided, all fields will have their name prefixed with the value. This is for distinguishing multiple forms on a single page. This only affects the HTML name for matching input data, not the Python name for matching existing data.

  • data – Take existing data from keys in this dict matching form field attributes. obj takes precedence if it also has a matching attribute. Only used if formdata is not passed.

  • meta – A dict of attributes to override on this form’s meta instance.

  • extra_filters – A dict mapping field attribute names to lists of extra filter functions to run. Extra filters run after filters passed when creating the field. If the form has filter_<fieldname>, it is the last extra filter.

  • kwargs – Merged with data to allow passing existing data as parameters. Overwrites any duplicate keys in data. Only used if formdata is not passed.

save(obj: Optional[Page] = None) Page
active = <UnboundField(BooleanField, ('aktywna',), {'description': 'strony nieaktywne dostępne wyłącznie w archiwum'})>
change_description = <UnboundField(TextAreaField, ('opis zmiany',), {'description': 'opcjonalny opis wprowadzonej zmiany'})>
description = <UnboundField(TextAreaField, ('opis',), {'description': 'opis strony indeksowany przez wyszukiwarki internetowe'})>
main = <UnboundField(BooleanField, ('główna',), {'description': 'czy strona ma być widoczna na liście stron w menu'})>
order = <UnboundField(IntegerField, ('porządek',), {'validators': [<wtforms.validators.Optional object>], 'description': 'strony bez ustawionego porządku sortowane na końcu listy według tytułu'})>
text = <UnboundField(TextAreaField, ('tekst',), {'validators': [<wtforms.validators.InputRequired object>], 'description': 'treść strony zapisana przy użyciu Markdown'})>
title = <UnboundField(StringField, ('tytuł',), {'validators': [<wtforms.validators.InputRequired object>]})>
class bip.admin.forms.UserEditForm(*args, **kwargs)

Klasy bazowe: ObjectForm

Parametry:
  • formdata – Input data coming from the client, usually request.form or equivalent. Should provide a „multi dict” interface to get a list of values for a given key, such as what Werkzeug, Django, and WebOb provide.

  • obj – Take existing data from attributes on this object matching form field attributes. Only used if formdata is not passed.

  • prefix – If provided, all fields will have their name prefixed with the value. This is for distinguishing multiple forms on a single page. This only affects the HTML name for matching input data, not the Python name for matching existing data.

  • data – Take existing data from keys in this dict matching form field attributes. obj takes precedence if it also has a matching attribute. Only used if formdata is not passed.

  • meta – A dict of attributes to override on this form’s meta instance.

  • extra_filters – A dict mapping field attribute names to lists of extra filter functions to run. Extra filters run after filters passed when creating the field. If the form has filter_<fieldname>, it is the last extra filter.

  • kwargs – Merged with data to allow passing existing data as parameters. Overwrites any duplicate keys in data. Only used if formdata is not passed.

active = <UnboundField(BooleanField, ('aktywny',), {})>
admin = <UnboundField(BooleanField, ('administrator',), {})>
email = <UnboundField(EmailField, ('email',), {'validators': [<bip.utils.forms.EmailValidator object>, <wtforms.validators.Optional object>]})>
class bip.admin.forms.UserForm(*args, **kwargs)

Klasy bazowe: ObjectForm

Parametry:
  • formdata – Input data coming from the client, usually request.form or equivalent. Should provide a „multi dict” interface to get a list of values for a given key, such as what Werkzeug, Django, and WebOb provide.

  • obj – Take existing data from attributes on this object matching form field attributes. Only used if formdata is not passed.

  • prefix – If provided, all fields will have their name prefixed with the value. This is for distinguishing multiple forms on a single page. This only affects the HTML name for matching input data, not the Python name for matching existing data.

  • data – Take existing data from keys in this dict matching form field attributes. obj takes precedence if it also has a matching attribute. Only used if formdata is not passed.

  • meta – A dict of attributes to override on this form’s meta instance.

  • extra_filters – A dict mapping field attribute names to lists of extra filter functions to run. Extra filters run after filters passed when creating the field. If the form has filter_<fieldname>, it is the last extra filter.

  • kwargs – Merged with data to allow passing existing data as parameters. Overwrites any duplicate keys in data. Only used if formdata is not passed.

save() User
active = <UnboundField(BooleanField, ('aktywny',), {})>
admin = <UnboundField(BooleanField, ('administrator',), {})>
email = <UnboundField(EmailField, ('email',), {'validators': [<bip.utils.forms.EmailValidator object>, <wtforms.validators.Optional object>]})>
name = <UnboundField(StringField, ('nazwa',), {'validators': [<wtforms.validators.InputRequired object>]})>
password1 = <UnboundField(PasswordField, ('hasło',), {'validators': [<wtforms.validators.InputRequired object>]})>
password2 = <UnboundField(PasswordField, ('hasło (powtórz)',), {'validators': [<wtforms.validators.InputRequired object>, <wtforms.validators.EqualTo object>]})>

bip.admin.utils module

class bip.admin.utils.ItemCollectionMeta(dataobject: peewee.Model, form: Union[Type[flask_wtf.form.FlaskForm], NoneType], message: Union[str, NoneType] = None, template: Union[str, NoneType] = None, order: Union[peewee.Field, NoneType] = None, filters: Union[Sequence[peewee.Expression], NoneType] = None)

Klasy bazowe: object

dataobject: Model
filters: Optional[Sequence[Expression]] = None
form: Optional[Type[FlaskForm]]
message: Optional[str] = None
order: Optional[Field] = None
template: Optional[str] = None
class bip.admin.utils.ItemMeta(dataobject: peewee.Model, form: Type[flask_wtf.form.FlaskForm], message: str, success_url: str, title_field: Union[str, NoneType] = None, template: Union[str, NoneType] = None, success_url_kwargs: Mapping[str, Any] = <factory>)

Klasy bazowe: object

dataobject: Model
form: Type[FlaskForm]
message: str
success_url: str
success_url_kwargs: Mapping[str, Any]
template: Optional[str] = None
title_field: Optional[str] = None
bip.admin.utils.default_admin_item_view(item_meta: ItemMeta, item_pk: Any) Union[str, Response]

Default item view for admin interface.

Parametry:
  • item_meta (ItemMeta) – item metadata object

  • item_pk (Any) – item lookup key

Zwraca:

Flask response (Response object or str)

Typ zwracany:

Union[str, Response]

bip.admin.utils.default_admin_list_view(item_meta: ItemCollectionMeta) Union[str, Response]

Default collection (list) view for admin interface.

Parametry:

item_meta (ItemCollectionMeta) – item collection metadata object

Zwraca:

Flask response (Response object or str)

Typ zwracany:

Union[str, Response]

bip.admin.views module

bip.admin.views.attachment_detail(attachment_pk: int) Union[Response, str]
bip.admin.views.attachment_list() Union[Response, str]
bip.admin.views.before_request() Optional[Response]
bip.admin.views.home() str
bip.admin.views.label_detail(label_pk: int) Union[Response, str]
bip.admin.views.label_list() Union[Response, str]
bip.admin.views.page_attachments(page_pk: int) Union[Response, str]
bip.admin.views.page_detail(page_pk: int) Union[Response, str]
bip.admin.views.page_labels(page_pk: int) Union[Response, str]
bip.admin.views.page_list() Union[Response, str]
bip.admin.views.user_detail(user_pk: int) Union[Response, str]
bip.admin.views.user_list() Union[Response, str]