# Path: entity/category.py
# class Category:
#     def __init__(self, id=None, name=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_name(db, name):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def name_exists(db, name):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/image.py
# class Image:
#     def __init__(self, id=None, recipe_id=None, path=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/synonym.py
# class Synonym:
#     def __init__(self, id=None, recipe_id=None, name=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/tag.py
# class Tag:
#     def __init__(self, id=None, name='', synonym_of=None, synonyms=[]):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_name(db, name):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def find_synonyms(self, db):
#     def from_row(db, row, find_synonyms=True):
#     def is_new(self):
#     def name_exists(db, name):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/url.py
# class Url:
#     def __init__(self, id=None, recipe_id=None, name='', url=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/user.py
# class User:
#     def __init__(self, id=None, name=None, pw_hash=None, salt=None, session=None):
#     def __str__(self):
#     def count_all(db):
#     def delete(self, db):
#     def find_all(db):
#     def find_name(db, name):
#     def find_pk(db, id):
#     def from_row(db, row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):


from entity import category as category_entity
from entity import image as image_entity
from entity import synonym as synonym_entity
from entity import tag as tag_entity
from entity import url as url_entity
from entity import user as user_entity
import os
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    def __delete_recipe_has_tag(self, db):
        """ Deletes entries in recipe_has_tag. """
        query = 'DELETE FROM recipe_has_tag WHERE recipe_id = ?'
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    def __delete_synonyms(self, db):
        """ Deletes entries in synonyms. """
        query = 'DELETE FROM synonyms WHERE recipe_id = ?'
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    def __delete_urls(self, db):
        """ Deletes entries in urls. """
        query = 'DELETE FROM urls WHERE recipe_id = ?'
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    @staticmethod
    def __generic_find(db, query, params):
        """ Generic implementation of a find single method. Returns entity or
        None. """
        cursor = db.cursor()

# Path: entity/category.py
# class Category:
#     def __init__(self, id=None, name=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_name(db, name):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def name_exists(db, name):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/image.py
# class Image:
#     def __init__(self, id=None, recipe_id=None, path=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/synonym.py
# class Synonym:
#     def __init__(self, id=None, recipe_id=None, name=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/tag.py
# class Tag:
#     def __init__(self, id=None, name='', synonym_of=None, synonyms=[]):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_name(db, name):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def find_synonyms(self, db):
#     def from_row(db, row, find_synonyms=True):
#     def is_new(self):
#     def name_exists(db, name):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/url.py
# class Url:
#     def __init__(self, id=None, recipe_id=None, name='', url=''):
#     def __str__(self):
#     def delete(self, db):
#     def find_all(db):
#     def find_pk(db, id):
#     def find_recipe(db, recipe):
#     def from_row(row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):
# 
# Path: entity/user.py
# class User:
#     def __init__(self, id=None, name=None, pw_hash=None, salt=None, session=None):
#     def __str__(self):
#     def count_all(db):
#     def delete(self, db):
#     def find_all(db):
#     def find_name(db, name):
#     def find_pk(db, id):
#     def from_row(db, row):
#     def is_new(self):
#     def save(self, db):
#     def __generic_find(db, query, params):


# Path: entity/recipe.py
from entity import category as category_entity
from entity import image as image_entity
from entity import synonym as synonym_entity
from entity import tag as tag_entity
from entity import url as url_entity
from entity import user as user_entity
import os

        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    def __delete_recipe_has_tag(self, db):
        """ Deletes entries in recipe_has_tag. """
        query = 'DELETE FROM recipe_has_tag WHERE recipe_id = ?'
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    def __delete_synonyms(self, db):
        """ Deletes entries in synonyms. """
        query = 'DELETE FROM synonyms WHERE recipe_id = ?'
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    def __delete_urls(self, db):
        """ Deletes entries in urls. """
        query = 'DELETE FROM urls WHERE recipe_id = ?'
        params = [self.id]
        cursor = db.cursor()
        cursor.execute(query, params)

    @staticmethod
    def __generic_find(db, query, params):
        """ Generic implementation of a find single method. Returns entity or
        None. """
        cursor = db.cursor()

        cursor.execute(query, params)