Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import peewee
from zdict.constants import DB_FILE
db = peewee.SqliteDatabase(DB_FILE)
class Record(peewee.Model):
'''
A model for storing the query results into the SQLite db.
:param word: the vocabulary
:param content: the query result of the vocabulary.
It's a json document has the following spec.
{
'word': word,
// storing the querying result.
'pronounce': [
('key', 'value'),
...
],
def create_zdict_db_if_not_exists():
if not os.path.exists(constants.DB_FILE):
open(constants.DB_FILE, 'a').close()
def create_zdict_db_if_not_exists():
if not os.path.exists(constants.DB_FILE):
open(constants.DB_FILE, 'a').close()
def create_zdict_db_if_not_exists():
if not os.path.exists(constants.DB_FILE):
open(constants.DB_FILE, 'a').close()
def create_zdict_db_if_not_exists():
if not os.path.exists(constants.DB_FILE):
open(constants.DB_FILE, 'a').close()