Skip to content

Conversation

@ZapAnton
Copy link
Member

@ZapAnton ZapAnton commented Jan 19, 2020

TODO:

- Share sqlalchemy engine between modules in projects (to be able to call sqlalchemy functions from different modules)

  • Add standard styles when db is initialized
  • Replace show_all_styles function with the sqlalchemy function
  • Replace chosen_style_exists function with the sqlalchemy function
  • Replace get_style_by_name function with the sqlalchemy function
  • Implement formatting for the style body from the db (replace the {@} sign with the user input).

from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String

SQLITE_DB_PATH = 'styles.db'
SQLITE_URL = f'sqlite:///{SQLITE_DB_PATH}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use combined DATABASE_URL and make it possible to override from os.environ (https://12factor.net/backing-services).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants