Les's to use a unique ORM to manage the persistence in one project.
Project description
full_alchemyst
Let's you to use both SqlAlchemyst and MongoAlchemyst libraries Les's to use a unique ORM to manage the persistence in one project.
How to Use?
You need to configurate a dictionary with the next parameters: db_config = { "type":"mongo", "host": "localhost", "port":27017, "user":"", "database":"google", "password":"", "SQLALCHEMY_TRACK_MODIFICATIONS":True }
- *** type: *** mongo | mysql
- *** host: *** Host where the database is
- *** port: *** Port of engine runs
- *** user: *** User
- *** databse: *** Name of database
- *** password: *** Password
How you see, you can to specify other attributes of the ORM, like "SQLALCHEMY_TRACK_MODIFICATIONS".
After to set the configuration that you want to use, you have to create a FullAlchemyst instance:
app = Flask(__name__)
fullAlchemyst= FullAlchemyst(app,db_config)
Obviusly, What is a ORM without models? Create one:
class task(fullAlchemyst.Entity):
id = define(fullAlchemyst.db, {"name":"id","type":"int","primary_key":True})
nombre = define(fullAlchemyst.db, {"name":"nombre","type":"str"})
Steps:
- First, you need to extend you model of fullAlchemyst.Entity
- Define your attributes. In this step, remember to use the "define" function. We see this later
"define" function
This function is used to configurate you model depending what type of database you use.
This function, receives a dict, and its structure is the next:
- type : int | str o another inside de buildins of python.
- primary_key : If you attribute is a primary key.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file full_alchemyst-1.0.1.tar.gz.
File metadata
- Download URL: full_alchemyst-1.0.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6aa1efa07a925b71c299f8590708a3308c862a419584ef1c1016ca5693b3db77
|
|
| MD5 |
bf51e374229b59b3ea57e95b4aaa35fe
|
|
| BLAKE2b-256 |
4224a97b26a7ef78c05d71f030adbd6d8bf179f9e2489acbd3796f18aee7cea3
|
File details
Details for the file full_alchemyst-1.0.1-py3-none-any.whl.
File metadata
- Download URL: full_alchemyst-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
284e882d6cc59371eb5dcf3c5af860570860baad736855b98aec294870db5108
|
|
| MD5 |
50e6082007a536090ad0b875f7c134e5
|
|
| BLAKE2b-256 |
8dec8b621aabf1ced865e3fd744732cb0cd9d8ef32a838f641a8f5173a3867f9
|