#!/usr/bin/env python3

import os, os.path
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'..')))

import MySQLdb

from kokbok import conf
from kokbok import model

def main():

    #model.db_init()
    ingredient = model.Ingredient("Test", 1, 2, 3, 4, 5, 6, 7)
    ingredient.save()
    
    recipe = model.Recipe.new(
            title="bread",
            servings=4,
            cook_time_prep=30,
            cook_time_cook=30,
            ingredients=[{'title': '',
                          'ingredients': [{'unit': model.Unit.ML, 'quantity': 17, 'prepnotes': None,
                                           'ingredient': ingredient}]}],
            author=None,
            instructions=["Blanda mjöl", "sätt på ugnen", "klart!"],
            description="Jättegott bröd",
            version=1
            )
    
    
if __name__ == '__main__':
    main()
