2018-07-27 20:27:42 +00:00
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
Author: freezed <freezed@users.noreply.github.com> 2018-07-27
|
|
|
|
|
Version: 0.1
|
|
|
|
|
Licence: `GNU GPL v3` GNU GPL v3: http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
This file is part of [ocp5](https://github.com/freezed/ocp5) project
|
|
|
|
|
"""
|
|
|
|
|
|
2018-08-04 13:58:31 +00:00
|
|
|
|
# API
|
|
|
|
|
FIELD_KEPT = {
|
|
|
|
|
'product': [
|
|
|
|
|
'product_name',
|
|
|
|
|
'nutrition_grades',
|
|
|
|
|
'categories_tags'
|
|
|
|
|
],
|
|
|
|
|
'category': [
|
|
|
|
|
'_id',
|
|
|
|
|
'url',
|
|
|
|
|
'product_name',
|
|
|
|
|
'nutrition_grades',
|
|
|
|
|
'categories_tags'
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-27 20:27:42 +00:00
|
|
|
|
# DATABASE
|
|
|
|
|
DB_CONFIG = {
|
|
|
|
|
'host': 'localhost',
|
|
|
|
|
'user': 'loff',
|
2018-08-02 18:00:30 +00:00
|
|
|
|
'password': 'loff',
|
2018-07-27 20:27:42 +00:00
|
|
|
|
'db': 'loff',
|
2018-08-02 18:00:30 +00:00
|
|
|
|
'charset': 'utf8',
|
2018-08-03 16:23:09 +00:00
|
|
|
|
'autocommit': True,
|
2018-07-27 20:27:42 +00:00
|
|
|
|
'file': 'create-db-loff.sql'
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-02 22:03:31 +00:00
|
|
|
|
DB_MSG_TEMPLATE = {
|
|
|
|
|
"database": "DB «{}» contains these tables :",
|
|
|
|
|
"db_created": "DB «{}» created\n\n",
|
|
|
|
|
"tables": "{}\n",
|
|
|
|
|
"dashboard": "DB size : {dbsize}\nTable 'product' has «{rowprod}» "
|
|
|
|
|
"row(s)\nTable 'category' has «{rowcat}» row(s)"
|
|
|
|
|
}
|