Pytonik Bootstrap Flash Message
Pytonik Bootstrap Flash Message helps you store messages in session data until they are retrieved. Bootstrap compatibility, sticky messages, and more
Installation Guide
Step 1:
You can simply install the module into your pytonik application using any of the methods below.
With Pip
pip install FlashBootstrap
With Git
git clone https://github.com/emmamartins/FlashBootstrap/
Step 2:
Import the module using either of the following method
from FlashBootstrap.FlashBootstrap import FlashBootstrap
or
from FlashBootstrap.FlashBootstrap import *
Step 3: Default 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 ')
msg.error('This is an error ')
#Add messages Without Bootstrap
msg.message('This is an info message')
#Wherever you want to display the messages simply call:
msg.display()
#Wherever you want to clear or unset the messages simply call:
msg.clear()
#Wherever you want to redirect to
msg.redirect('/location')
Message Types
Info
msg.info('This is a info message')
Success
msg.success('This is a success message')
Warning
msg.warning('This is a warning ')
Error
msg.error('This is a error')
Redirect
It is 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.
#Import FlashBootstrap
from FlashBootstrap.FlashBootstrap import *
def checklogin():
FlashBootstrap.error('Cannot login account')
return FlashBootstrap.redirect('/login', True)
Alternative
#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)
Author
👤 Raphael Essien
- Github: Raphael Essien
🤝 Contributing
Contributions, issues and feature requests are welcome!
Show your support
Give a ⭐️ if you like this project!
Metadata
Release files for FlashBootstrap 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| FlashBootstrap-1.0.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| FlashBootstrap-1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.9 kB
Release files / FlashBootstrap-1.0.tar.gz
| Download URL | FlashBootstrap-1.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94a0930eb4c08f62071b5e6846eb005abf87d39f868c2a731a898b9e36812c52
|
|
BLAKE2b-256 checksum How to use checksums |
5eaae292849ed802e077ba236cdbe6dc54be45c7036e87a4bdcc4ec146f611f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / FlashBootstrap-1.0-py3-none-any.whl
| Download URL | FlashBootstrap-1.0-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
884b4aefde406609473f1f1b2d9cdd9f13ab5a62f528448a8731c49862a88290
|
|
BLAKE2b-256 checksum How to use checksums |
4b223783b6b7817327b9ae795d0aec72305da877b31e05c6f919029f54e7818f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|