Skip to main content

Small tool to add and show flash messages

Project description

Pyramid FLASH MESSAGE

Small tool to add and show flash messages 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)

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

{{ 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

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.1.6

  • some debug (now you can use it)

v 0.1

  • refactor as package
  • some debug

v 0.0

  • init project and create skeleton of it

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyramid-flash-message, version 0.1.8
Filename, size File type Python version Upload date Hashes
Filename, size pyramid_flash_message-0.1.8.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page