# Path: models.py
# ENVIRONMENT = os.getenv('ENVIRONMENT', 'dev')
# class BaseModel(Model):
#     class Meta:
# class Item(BaseModel):
# class Picture(BaseModel):
# class User(BaseModel, UserMixin):
# class Address(BaseModel):
# class Order(BaseModel):
#     class Meta:
# class OrderItem(BaseModel):
# class Favorite(BaseModel):
#     def save(self, *args, **kwargs):
#     def json_list(cls, objs_list):
#     def json(self, include_data=[]):
#     def validate_input(cls, data, partial=False):
#     def search(cls, query, dataset, limit=-1,
#                attributes=None, weights=None,
#                threshold=search.config.THRESHOLD):
#     def __str__(self):
#     def is_favorite(self, item):
# def on_delete_item_handler(model_class, instance):
#     def filename(self):
#     def __str__(self):
# def on_delete_picture_handler(model_class, instance):
#     def exists(email):
#     def hash_password(password):
#     def verify_password(self, password):
#     def add_favorite(user, item):
#     def delete_favorite(self, obj):
#     def order_items(self):
#     def empty_order(self):
#     def create_order(user, address, items):
#     def update_items(self, items, update_total=True, new_address=None):
#     def edit_items_quantity(self, items):
#     def delete_items(self, items):
#     def create_items(self, items):
#     def add_item(self, item, quantity=1):
#     def remove_item(self, item, quantity=1):
#     def add_item(self, quantity=1):
#     def remove_item(self, quantity=1):
#     def _calculate_subtotal(self):


from colorama import init, Fore, Style
from models import (User, Item, Order, OrderItem,
                    Address, Picture, database, Favorite)
import sys


init(autoreset=True)


def drops_all_tables(database):
    """Doesn't drop unknown tables."""
    tables = database.get_tables()
    for table in tables:
        if table == 'item':
            Item.drop_table()
        if table == 'order':
            Order.drop_table()
        if table == 'user':
            User.drop_table()
        if table == 'orderitem':
            OrderItem.drop_table()
        if table == 'address':
            Address.drop_table()
        if table == 'picture':

# Path: models.py
# ENVIRONMENT = os.getenv('ENVIRONMENT', 'dev')
# class BaseModel(Model):
#     class Meta:
# class Item(BaseModel):
# class Picture(BaseModel):
# class User(BaseModel, UserMixin):
# class Address(BaseModel):
# class Order(BaseModel):
#     class Meta:
# class OrderItem(BaseModel):
# class Favorite(BaseModel):
#     def save(self, *args, **kwargs):
#     def json_list(cls, objs_list):
#     def json(self, include_data=[]):
#     def validate_input(cls, data, partial=False):
#     def search(cls, query, dataset, limit=-1,
#                attributes=None, weights=None,
#                threshold=search.config.THRESHOLD):
#     def __str__(self):
#     def is_favorite(self, item):
# def on_delete_item_handler(model_class, instance):
#     def filename(self):
#     def __str__(self):
# def on_delete_picture_handler(model_class, instance):
#     def exists(email):
#     def hash_password(password):
#     def verify_password(self, password):
#     def add_favorite(user, item):
#     def delete_favorite(self, obj):
#     def order_items(self):
#     def empty_order(self):
#     def create_order(user, address, items):
#     def update_items(self, items, update_total=True, new_address=None):
#     def edit_items_quantity(self, items):
#     def delete_items(self, items):
#     def create_items(self, items):
#     def add_item(self, item, quantity=1):
#     def remove_item(self, item, quantity=1):
#     def add_item(self, quantity=1):
#     def remove_item(self, quantity=1):
#     def _calculate_subtotal(self):


# Path: scripts/init_db.py
from colorama import init, Fore, Style
from models import (User, Item, Order, OrderItem,
                    Address, Picture, database, Favorite)
import sys



init(autoreset=True)


def drops_all_tables(database):
    """Doesn't drop unknown tables."""
    tables = database.get_tables()
    for table in tables:
        if table == 'item':
            Item.drop_table()
        if table == 'order':
            Order.drop_table()
        if table == 'user':
            User.drop_table()
        if table == 'orderitem':
            OrderItem.drop_table()
        if table == 'address':
            Address.drop_table()
        if table == 'picture':

            Picture.drop_table()