使用标识符的Flask Restive扩展。
Flask-RESTive-Identifiers的Python项目详细描述
#Flask Restive标识符
Flask Restive扩展以使用标识符。
[![构建状态](https://travis-ci.org/left-join/flask-restive-identifiers.svg?branch=master)(https://travis ci.org/left join/flask restive标识符)
[![覆盖状态](https://coveralls.io/repos/github/left-join/flask-restive-identifiers/badge.svg?branch=master)](https://coveralls.io/github/left-join/flask-restive-identifiers?分支=主)
[![代码运行状况](https://landscape.io/github/left-join/flask-restive-identifiers/master/landscape.svg?style=flat)(https://landscape.io/github/left join/flask restive identifiers/master)
[![pypi版本](https://img.shields.io/pypi/v/flask restive identifiers.svg)(https://pypi.python.org/pypi/flask restive identifiers)
因此,您应该首先将
应用程序配置为使用postgresql:
``python
from flask import flask
app.config['sqlalchemy_database_u uri']='postgresql+psycopg2://user:password@localhost:5432/database'
````
是:
``python
>>>gt>gt>>从烧瓶进口进口从烧瓶进口从烧瓶进口从烧瓶进口到进口生成识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别(命名空间='new_space')
>;>;gt;1
```
库提供自动生成自动递增id的模式。
first_name=fields.string(required=true)
last_name=fields.string(required=true)
identifier_namespace='scientists'
```````
>每次加载不带id时都会生成新的自动增量id:
``python
>;>schema=scientistschema()
>;>data,errors=schema.load({'名字':'albert','姓':'einstein'})
>;>;data.id
1
>;>;data,errors=schema.load({'名字':'nicolaus','姓':'copernicus'})
>;>;data.id
2
````
Flask Restive扩展以使用标识符。
[![构建状态](https://travis-ci.org/left-join/flask-restive-identifiers.svg?branch=master)(https://travis ci.org/left join/flask restive标识符)
[![覆盖状态](https://coveralls.io/repos/github/left-join/flask-restive-identifiers/badge.svg?branch=master)](https://coveralls.io/github/left-join/flask-restive-identifiers?分支=主)
[![代码运行状况](https://landscape.io/github/left-join/flask-restive-identifiers/master/landscape.svg?style=flat)(https://landscape.io/github/left join/flask restive identifiers/master)
[![pypi版本](https://img.shields.io/pypi/v/flask restive identifiers.svg)(https://pypi.python.org/pypi/flask restive identifiers)
因此,您应该首先将
应用程序配置为使用postgresql:
``python
from flask import flask
app.config['sqlalchemy_database_u uri']='postgresql+psycopg2://user:password@localhost:5432/database'
````
是:
``python
>>>gt>gt>>从烧瓶进口进口从烧瓶进口从烧瓶进口从烧瓶进口到进口生成识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别识别(命名空间='new_space')
>;>;gt;1
```
库提供自动生成自动递增id的模式。
first_name=fields.string(required=true)
last_name=fields.string(required=true)
```````
>每次加载不带id时都会生成新的自动增量id:
``python
>;>schema=scientistschema()
>;>data,errors=schema.load({'名字':'albert','姓':'einstein'})
>;>;data.id
1
>;>;data,errors=schema.load({'名字':'nicolaus','姓':'copernicus'})
>;>;data.id
2
````