Mongoengine Pyramid extension based in flask-mongoengine
Project description
# Pyramid Mongoengine
pyramid-mongoengine package based in [flask-mongoengine](https://github.com/MongoEngine/flask-mongoengine)
## *** README In Progress ***
## Install
pip install pyramid-mongoengine
## Config
Basic setup
```python
if __name__ == "__main__":
config = Configurator()
config.include("pyramid_mongoengine")
config.add_connection_database()
```
`pyramid-mongoengine` provides `add_connection_database()`, he makes a connection with database
using data coming from .ini file.
```python
mongo_url = mongodb://my_ip_location_to_mongodb
mongodb_name = "my_db_application"
```
If theses data not exists in .ini, `pyramid-mongoengine` use default values
```python
# Default values
mongo_url = mongodb://localhost
mongodb_name = "test"
```
## Creating models
```python
from pyramid_mongoengine import MongoEngine
db = MongoEngine()
class User(db.Document):
email = db.StringField(required=True)
username = db.StringField(requred=True)
```
pyramid-mongoengine package based in [flask-mongoengine](https://github.com/MongoEngine/flask-mongoengine)
## *** README In Progress ***
## Install
pip install pyramid-mongoengine
## Config
Basic setup
```python
if __name__ == "__main__":
config = Configurator()
config.include("pyramid_mongoengine")
config.add_connection_database()
```
`pyramid-mongoengine` provides `add_connection_database()`, he makes a connection with database
using data coming from .ini file.
```python
mongo_url = mongodb://my_ip_location_to_mongodb
mongodb_name = "my_db_application"
```
If theses data not exists in .ini, `pyramid-mongoengine` use default values
```python
# Default values
mongo_url = mongodb://localhost
mongodb_name = "test"
```
## Creating models
```python
from pyramid_mongoengine import MongoEngine
db = MongoEngine()
class User(db.Document):
email = db.StringField(required=True)
username = db.StringField(requred=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
Close
Hashes for pyramid-mongoengine-0.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dd1b24250d2b2f723be4e5e19ffcc44dec8ceedb441e185dec58129d5d490e0 |
|
MD5 | 3c45e9c0d0ad065dc1d922a7f63192c6 |
|
BLAKE2b-256 | 43483cf80b697e76285a1b3d8b3318902121f076d12ac79a6c2abd31d4b151ed |