Flask-Electron-0.4.9
توضیحات
Core code for Flask based projects
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | Flask-Electron-0.4.9 |
| نام | Flask-Electron |
| نسخه کتابخانه | 0.4.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Keith Byrne |
| ایمیل نویسنده | keithmbyrne@gmail.com |
| آدرس صفحه اصلی | https://github.com/kmjbyrne/flask-electron |
| آدرس اینترنتی | https://pypi.org/project/Flask-Electron/ |
| مجوز | MIT |
# KBPC

[](https://badge.fury.io/py/kbpc)
[](https://travis-ci.org/kmjbyrne/kbpc)
[](https://coveralls.io/github/kmjbyrne/kbpc?branch=master)
Table of contents
=================
<!--ts-->
* [Database](#database)
* [Models](#models)
* [User](#user)
* [User Model](#user-model)
* [User DAO](#user-dao)
* [Serializer](#flask-alchemy-model-serializer)
* [Common](#common)
* [Exceptions](#exceptions)
<!--te-->
## Database
### Models
#### User Model
Docs coming soon
#### User DAO
Docs coming soon
---
### Flask Alchemy Model Serializer
Transformation was originally a series of routines written to convert FlaskAlchemy models into jsonifiable dict
structures. This proved to be a solution lacking elegance and evolved and eventually found its way into half a dozen
projects over time and eventually, then started to splinter into slightly different variations.
#### Basic Usage
```python
from flask import jsonify
from application.models import SomeFlaskAlchemyModel
from kbpc.db.flaskalchemy import serializer
# Assume the model has name and age as the model fields
model = SomeFlaskAlchemyModel('John Doe', 25)
transformed_model = serializer.serialize(model)
# This typically fails if you attempt it with the model.
json = jsonify(data=model)
# This however is serializable immediately
json = jsonify(data=transformed_model)
```
---
Often, fields like passwords or other sensitive data should be hidden from responses or outputs. Usually this would be
managed at the model class, and writing a to_dict() function or something similar, and simply not declaring the
protected properties of that instance.
#### Protected Properties
```python
from flask import jsonify
from application.models import SomeFlaskAlchemyModel
from kbpc.db.flaskalchemy import serializer
# Assume the model has name and age as the model fields
model = SomeFlaskAlchemyModel('John Doe', 25)
tablename = 'tablename_of_model'
exclusions = {tablename: ['age']}
transformed_model = serializer.serialize(model, exclusions)
# This however is serializable immediately
json = jsonify(data=transformed_model)
```
نحوه نصب
نصب پکیج whl Flask-Electron-0.4.9:
pip install Flask-Electron-0.4.9.whl
نصب پکیج tar.gz Flask-Electron-0.4.9:
pip install Flask-Electron-0.4.9.tar.gz