fibrenest-db-models-21.11
توضیحات
DB schema and sqlalchemy db models for fibrenest
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | fibrenest-db-models-21.11 |
| نام | fibrenest-db-models |
| نسخه کتابخانه | 21.11 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Nitin Sidhu |
| ایمیل نویسنده | nitin.sidhu23@gmail.com |
| آدرس صفحه اصلی | https://gitlab.com/horsebridge/fibrenest_db_models.git |
| آدرس اینترنتی | https://pypi.org/project/fibrenest-db-models/ |
| مجوز | MIT |
# fibrenest_db_models
This is the DB schema and sqlalchemy db models for fibrenest
# Usage
You would want to install this module in your project and then import the
needed db model.
There is separate model if the backend DB is postgres.
DB Models for OLD Mysql DB are in `old.py`
#### Installation
`pip install fibrenest-db-models`
#### Example import for postgres
`from fibrenest_db_models.postgres import *`
#### Example import for all other DBs
`from fibrenest_db_models.all import *`
#### Creating the DB and tables
If the DB is not created, then you would need to first create the DB. Use [sqlalchemy-utils](https://sqlalchemy-utils.readthedocs.io/en/latest/database_helpers.html) for this.
After the DB is created, you can connect to this DB and create tables. Detailed instructions [here](https://docs.sqlalchemy.org/en/13/orm/tutorial.html#connecting)
```python
engine = create_engine('sqlite:///test.db')
Base.metadata.create_all(engine)
```
## Models
1) ONT: Table for ONTs info
2) SUBSCRIPTION: Table for Service subscriptions
3) RADCHECK: Table for radius radcheck
4) RADUSERGROUP: Table for radius user group
5) RADACCT: Radius accounting table. Available only for postgres
نیازمندی
| مقدار | نام |
|---|---|
| - | sqlalchemy |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| ~=3.6 | Python |
نحوه نصب
نصب پکیج whl fibrenest-db-models-21.11:
pip install fibrenest-db-models-21.11.whl
نصب پکیج tar.gz fibrenest-db-models-21.11:
pip install fibrenest-db-models-21.11.tar.gz