Patch the old Form classes in web.py to create Bootstrap-compatible forms
Project description
# Effortless Bootstrap Web/Form Monkey Patch
Patch the old Form classes in web.py to create Bootstrap-compatible forms
Just because web.py hasn't been updated since 2012 doesn't mean you have to
settle for outdated HTML layouts. Scrap that 2001-era table-based form layout,
and use this module to create shiny, new Bootstrap 4-alpha forms!
## Example
To update your old webforms, just import and use the `patch()` function.
from effortless_bootstrap_web_form_monkey_patch import patch
patch()
Now you can continue to use your old web.py forms normally.
Oh yeah, make sure you update the templates to use Bootstrap. The most
important piece to remember is to wrap all Bootstrap items with a `.container`
div.
<div class="container">
<form>
$:form.render()
</form>
</div>
And of course you need the CSS. If you don't want to host it locally, use their
CDN by adding this piece to the header.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" integrity="2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj" crossorigin="anonymous">
For more information on using Bootstrap 4-alpha, check out http://v4-alpha.getbootstrap.com/ .
## Installation
Eventually, this will be a full fledged package, and you will be able to do this.
pip install effortless_bootstrap_web_form_monkey_patch
## Inspiration
- Bootstrap 4 alpha form documentation at http://v4-alpha.getbootstrap.com/components/forms/
- Runtime patching was learned at https://tryolabs.com/blog/2013/07/05/run-time-method-patching-python/
## Author
Justin McGuire — <jm@landedstar.com> — <a href="https://twitter.com/landedstar">@landedstar.com</a> — http://landedstar.com
## License
MIT License
Patch the old Form classes in web.py to create Bootstrap-compatible forms
Just because web.py hasn't been updated since 2012 doesn't mean you have to
settle for outdated HTML layouts. Scrap that 2001-era table-based form layout,
and use this module to create shiny, new Bootstrap 4-alpha forms!
## Example
To update your old webforms, just import and use the `patch()` function.
from effortless_bootstrap_web_form_monkey_patch import patch
patch()
Now you can continue to use your old web.py forms normally.
Oh yeah, make sure you update the templates to use Bootstrap. The most
important piece to remember is to wrap all Bootstrap items with a `.container`
div.
<div class="container">
<form>
$:form.render()
</form>
</div>
And of course you need the CSS. If you don't want to host it locally, use their
CDN by adding this piece to the header.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" integrity="2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj" crossorigin="anonymous">
For more information on using Bootstrap 4-alpha, check out http://v4-alpha.getbootstrap.com/ .
## Installation
Eventually, this will be a full fledged package, and you will be able to do this.
pip install effortless_bootstrap_web_form_monkey_patch
## Inspiration
- Bootstrap 4 alpha form documentation at http://v4-alpha.getbootstrap.com/components/forms/
- Runtime patching was learned at https://tryolabs.com/blog/2013/07/05/run-time-method-patching-python/
## Author
Justin McGuire — <jm@landedstar.com> — <a href="https://twitter.com/landedstar">@landedstar.com</a> — http://landedstar.com
## License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for effortless_bootstrap_web_form_monkey_patch-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ed43d951ea16cb20fdd61e4786944ca1ad005ef7c951d489d6efd06c272a47 |
|
MD5 | f6964309144ca6c337f58c745ae364e4 |
|
BLAKE2b-256 | 2b6a13737e4f7c4dfd578ef9a78ad2c23bf34935f0f2e3de251f23deaae972c7 |