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 FlashBoostrap
  from FlashBoostrap.FlashBoostrap import *

  def checklogin():
    FlashBoostrap.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.0a1.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.0a1-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: FlashBootstrap-1.0a1.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.0a1.tar.gz
Algorithm Hash digest
SHA256 65aeababb7147d2404514a700bfe47e9fa632ebac824ea00b8405e2d42c1c6cd
MD5 d0a1c73dd56eb9b65772158c1397d8b5
BLAKE2b-256 37e13aa738a4c49f6a5a247ddeaea68f086c7a7665777abd82f1564d6fb88b33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: FlashBootstrap-1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 16.1 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.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 0db6e0f6d1ea8e30e2cfc29f30e0b5c6db3d7f54576e3cc6d1fecf74990b9b32
MD5 c27556b15150784536ac042a7efe06be
BLAKE2b-256 84b35e19d8b9fca28ee783e46dcf9ba490cff97812e73be0f9b443ea1bc96b29

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