Pyramid Flash Message
Small tool to add and show flash messages
usage
for add new message to flash message queue
from pyramid_flash_message import MessageQueue
flash_message = MessageQueue()
flash_message.add('some message')
flash_message.add('danger message', message_type='danger')
flash_message.add('danger message', message_type=MessageQueue.danger)
by default in instant of MessageQueue added to request object so you can use request object without importing MessageQueue
request.flash_message.add('some message')
request.flash_message.add('danger message', message_type='danger')
request.flash_message.add('danger message', message_type=request.flash_message.danger)
you also can pass translation mapping and translation domain to it when you add new message or create new instance of MessageQueue.
request.flash_message.add('some message ${var1}', mapping={'var1': 123})
request.flash_message.add('some message', domain='some_domain')
pyramid_flash_message use default pyramid i18n system. so you can pass mapping arg to use in translation. also if you like to show source of message you can use source arg.
now for show flash message you can use flash_message panel in your templates
panel('flash_message', per_page=20, read=False)
for instance in jinja2 templates
{{ panel('flash_message', per_page=20, read=False) }}
there is also flash_message view than get page and per_page and read params for paged view of messages. this params will get via GET method so you can use it via
<a href="{{ request.route_url('flash_message') }}">View all messages</a>
<a href="{{ request.route_url('flash_message') }}?read=true">View and mark read</a>
Installation
for installing pyrmaid_flash_message
pip install pyramid_flash_message
add then add this package to your application
pyramid.includes =
pyramid_flash_message
or
config.include('pyramid_flash_message')
Support
You can use project issue page to submit your issue
Changes
v 0.2.3
handle error in session don’t found
v 0.2.2
get and use domain in translation
v 0.2.1
add message count
some bugfix
v 0.2
some bugfix and documentation
v 0.1.6
some bugfix (now you can use it)
v 0.1
refactor as package
some bugfix
v 0.0
init project and create skeleton of it
Metadata
Release files for pyramid-flash-message 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyramid_flash_message-0.2.3.tar.gz | 4.5 kB | Without provenance | Details for pyramid_flash_message-0.2.3.tar.gz |
Release files / pyramid_flash_message-0.2.3.tar.gz
| Download URL | pyramid_flash_message-0.2.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4060cbc36217054fd3ac82283118770e99358b679f861cde6b0fdd0fd2d20d1c
|
|
BLAKE2b-256 checksum How to use checksums |
c91d815728cd184e3ef62cadabb894f87a70a700e941859f19ef073ba90c02be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyramid-flash-message 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.