bip.admin package

Submodules

bip.admin.forms module

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

Klasy bazowe: bip.utils.forms.BaseForm

Parametry
  • formdata – Used to pass data coming from the enduser, usually request.POST or equivalent. formdata should be some sort of request-data wrapper which can get multiple parameters from the form input, and values are unicode strings, e.g. a Werkzeug/Django/WebOb MultiDict

  • obj – If formdata is empty or not provided, this object is checked for attributes matching form field names, which will be used for field values.

  • prefix – If provided, all fields will have their name prefixed with the value.

  • data – Accept a dictionary of data. This is only used if formdata and obj are not present.

  • meta – If provided, this is a dictionary of values to override attributes on this form’s meta instance.

  • **kwargs – If formdata is empty or not provided and obj does not contain an attribute named the same as a field, form will assign the value of a matching keyword argument to the field, if one exists.

save(page: bip.models.Page)bip.models.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: bip.utils.forms.ObjectForm

Parametry
  • formdata – Used to pass data coming from the enduser, usually request.POST or equivalent. formdata should be some sort of request-data wrapper which can get multiple parameters from the form input, and values are unicode strings, e.g. a Werkzeug/Django/WebOb MultiDict

  • obj – If formdata is empty or not provided, this object is checked for attributes matching form field names, which will be used for field values.

  • prefix – If provided, all fields will have their name prefixed with the value.

  • data – Accept a dictionary of data. This is only used if formdata and obj are not present.

  • meta – If provided, this is a dictionary of values to override attributes on this form’s meta instance.

  • **kwargs – If formdata is empty or not provided and obj does not contain an attribute named the same as a field, form will assign the value of a matching keyword argument to the field, if one exists.

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

Klasy bazowe: bip.utils.forms.ObjectForm

Parametry
  • formdata – Used to pass data coming from the enduser, usually request.POST or equivalent. formdata should be some sort of request-data wrapper which can get multiple parameters from the form input, and values are unicode strings, e.g. a Werkzeug/Django/WebOb MultiDict

  • obj – If formdata is empty or not provided, this object is checked for attributes matching form field names, which will be used for field values.

  • prefix – If provided, all fields will have their name prefixed with the value.

  • data – Accept a dictionary of data. This is only used if formdata and obj are not present.

  • meta – If provided, this is a dictionary of values to override attributes on this form’s meta instance.

  • **kwargs – If formdata is empty or not provided and obj does not contain an attribute named the same as a field, form will assign the value of a matching keyword argument to the field, if one exists.

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

Klasy bazowe: bip.utils.forms.ObjectForm

Parametry
  • formdata – Used to pass data coming from the enduser, usually request.POST or equivalent. formdata should be some sort of request-data wrapper which can get multiple parameters from the form input, and values are unicode strings, e.g. a Werkzeug/Django/WebOb MultiDict

  • obj – If formdata is empty or not provided, this object is checked for attributes matching form field names, which will be used for field values.

  • prefix – If provided, all fields will have their name prefixed with the value.

  • data – Accept a dictionary of data. This is only used if formdata and obj are not present.

  • meta – If provided, this is a dictionary of values to override attributes on this form’s meta instance.

  • **kwargs – If formdata is empty or not provided and obj does not contain an attribute named the same as a field, form will assign the value of a matching keyword argument to the field, if one exists.

save(obj: Optional[bip.models.Page] = None)bip.models.Page
active = <UnboundField(BooleanField, ('aktywna',), {'description': 'strony nieaktywne są 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 są 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.UserForm(*args, **kwargs)

Klasy bazowe: bip.utils.forms.ObjectForm

Parametry
  • formdata – Used to pass data coming from the enduser, usually request.POST or equivalent. formdata should be some sort of request-data wrapper which can get multiple parameters from the form input, and values are unicode strings, e.g. a Werkzeug/Django/WebOb MultiDict

  • obj – If formdata is empty or not provided, this object is checked for attributes matching form field names, which will be used for field values.

  • prefix – If provided, all fields will have their name prefixed with the value.

  • data – Accept a dictionary of data. This is only used if formdata and obj are not present.

  • meta – If provided, this is a dictionary of values to override attributes on this form’s meta instance.

  • **kwargs – If formdata is empty or not provided and obj does not contain an attribute named the same as a field, form will assign the value of a matching keyword argument to the field, if one exists.

active = <UnboundField(BooleanField, ('aktywny',), {})>
admin = <UnboundField(BooleanField, ('administrator',), {})>
email = <UnboundField(EmailField, ('email',), {'validators': [<bip.utils.forms.EmailValidator 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: peewee.Model
filters: Optional[Sequence[peewee.Expression]] = None
form: Optional[Type[flask_wtf.form.FlaskForm]]
message: Optional[str] = None
order: Optional[peewee.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: peewee.Model
form: Type[flask_wtf.form.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: bip.admin.utils.ItemMeta, item_pk: Any) → Union[str, flask.wrappers.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: bip.admin.utils.ItemCollectionMeta) → Union[str, flask.wrappers.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[flask.wrappers.Response, str]
bip.admin.views.attachment_list() → Union[flask.wrappers.Response, str]
bip.admin.views.before_request() → Optional[flask.wrappers.Response]
bip.admin.views.home()str
bip.admin.views.label_detail(label_pk: int) → Union[flask.wrappers.Response, str]
bip.admin.views.label_list() → Union[flask.wrappers.Response, str]
bip.admin.views.page_attachments(page_pk: int) → Union[flask.wrappers.Response, str]
bip.admin.views.page_detail(page_pk: int) → Union[flask.wrappers.Response, str]
bip.admin.views.page_labels(page_pk: int) → Union[flask.wrappers.Response, str]
bip.admin.views.page_list() → Union[flask.wrappers.Response, str]
bip.admin.views.user_detail(user_pk: int) → Union[flask.wrappers.Response, str]
bip.admin.views.user_list() → Union[flask.wrappers.Response, str]