Skip to main content

Store Flash messages in session data until they are retrieved. Bootstrap compatibility, sticky messages, and more.

Project description

Pytonik Bootstrap Flash Message

Store messages in session data until they are retrieved. Bootstrap compatibility, sticky messages, and more

Installation

With Pip

pip install FlashBootstrap

With Git

git clone https://github.com/emmamartins/FlashBootstrap/

Import the Module:

from FlashBootstrap.FlashBootstrap import FlashBootstrap

or

from FlashBootstrap.FlashBootstrap import *

Defualt Parameter

description=""
title=""
dismissible=True
key='flash' 

Basic Usage

#Instantiate the class
msg = FlashBootstrap

#Add messages With Bootstrap
msg.info('This is an info message')
msg.success('This is a success message')
msg.warning('This is a warning message')
msg.error('This is an error message')

#Add messages Without Bootstrap
msg.message('This is an info message')


#Wherever you want to display the messages simply call:
msg.display()

Message Types

Info

msg.info('This is a info message')

Info Message

Success

msg.success('This is a success message')

Success Message

Warning

msg.warning('This is a warning ')

Warning Message

Error

msg.error('This is a error')

Error Message

Redirect

It's possible to redirect to a different URL before displaying a message. For example, redirecting from checklogin back to a form login, (and displaying an error message) so a user can correct an error - subjected to pytonik developers.

Error Message

  #Import Pytonik
  from pytonik.Web import app
  #Import FlashBootstrap
  from FlashBootstrap.FlashBootstrap import *

  def checklogin():
    FlashBootstrap.error('Cannot login account')
    return app.redirect('/login', True)

Project details


Download files

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

Source Distribution

FlashBootstrap-1.0a2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FlashBootstrap-1.0a2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file FlashBootstrap-1.0a2.tar.gz.

File metadata

  • Download URL: FlashBootstrap-1.0a2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for FlashBootstrap-1.0a2.tar.gz
Algorithm Hash digest
SHA256 bdecf9a378247f34d4ff8f28972f028b88f58ed14120c6cbf5dff77f78639c1a
MD5 90b1acac40d6d724114ce1cd091b8707
BLAKE2b-256 761d89327e14e1e88351d87fa78e62d5d11e51d160dc9984864897efe6642609

See more details on using hashes here.

File details

Details for the file FlashBootstrap-1.0a2-py3-none-any.whl.

File metadata

  • Download URL: FlashBootstrap-1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for FlashBootstrap-1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 94f311eaaf57a85a68dd04296f9db7ba9b75853a42cbb2593dda95e9f8afd44a
MD5 2b379e6744c19378b999d435a26e5007
BLAKE2b-256 308baa4f50c31e4ea279525766f10bd7904a46faf1ced740e13da1c2616c4159

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page