I've found defaults file. Thanks.

What I mean about the tables:

A recipe can have many ingredients, and a ingredient can be in many recipes. It would better if we have three tables:
- ingredients
- recipe
- ingredients_recipe

So we could have something like this:

Recipe_table
id_recipe
name_recipe
...

Ingredient_table
id_ingredient
name_ingredient
...

Ingredients_per_recipe_table
id_ingredient
id_recipe
amount
unit
optional
...

So if we have a common ingredient, like salt, pepper, sugar, it will appear only one time in ingredients table. It would be much better to search recipes through ingredients, it wouldn't be redundant, it would spend less storage space and tables would be normalized.

The way it is done gets really hard to get ingredients that are not repeated, because ingredients_table has many instances of the same item. 

Another thing I've found strange is that shopcatsorder doesn't have a foreign key, like many other tables. 
I can make another design for the tables, and try to implement. What do you think? Do you think it would be too complicated to change the actual design? Or would I have to change only the db.py?

Thanks, and sorry if I'm being much abusive.

2012/2/7 Thomas Mills Hinkle <Thomas_Hinkle@alumni.brown.edu>
On Tue, Feb 7, 2012 at 6:35 PM, Patricia Dousseau <pdousseau@gmail.com> wrote:
I downloaded Gourmet and I loved it, it has wonderful features! It's helping me a lot, I'll use it as my official recipe book.

I wanted to help the project, so I downloaded the source code to take a look. I'd like to imple Doubts about implementation ment a plugin to list and set the price for ingredients, so that people could know the cost of any given recipe. I ended up with some doubts, and I'd be very grateful if you could help me:

Is the default.py file used anywhere? I looked for references in the code but I couldn't find anything.


Yes, the defaults are used frequently -- look for import defaults.defaults just about anywhere in the code. The defaults directory is basically set up for localization that can not be done with standard/simple localization tools -- unit conversions, categories, common ingredients, etc. -- things that go beyond simple translation.
 
Why aren't the recipe table and the ingredients table n:n? Very common ingredientes like salt end up with numerous entries. I also found strange that the the foreign key was placed in the ingredients table, instead of the recipe table.


I'm not sure what you mean, I'm afraid.

There is a table for recipes, each row of which includes information about a recipe. Then there is a table for ingredients, each row of which includes information about a particular ingredient, including the recipe it is part of.

For what you're working on, you'd want to create a new table which worked off of the ingkey and keyed it to a price. You can use the shopping code as a model, as that does the same thing (keying each ingkey to a shopping category).
 
Congratulations and thank you very much for making Gourmet available. 

No problem. Glad you're interested in playing around with it.

Tom
 
Have a great week, 
Patricia


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Grecipe-manager-devel mailing list
Grecipe-manager-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/grecipe-manager-devel