On 8/2/07, Shane Graber <[EMAIL PROTECTED]> wrote:
>
> I'm trying to make a recipe/ingredient application as my road to
> learning more about Django.  Making a model of an ingredient and most
> of the recipe are relatively straight forward based on the excellent
> tutorials on the Django.  However, I'm struggling with understanding
> how to hook in multiple ingredients into a recipe.  Here's how I have
> my model setup:
>
> http://dpaste.com/hold/15911/
>
> I want to be able to add in new Ingredients from the /admin section of
> Django instead of supplying it as a tuple hardcoded into my model.

Not sure if this is the best way, but it works for me: http://dpaste.com/15913/

Basically ingredients like chicken, onions, etc are going to be in
lots of recipes but the quantity will be different in each. So make
one model for each type of ingredient, and another model to combine an
ingredient and a quantity. Then use edit_inline to make it convenient
to edit in the admin.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to