Community & Support

Will Drupal be able to handle this problem in a fairly "natural" way ?

Hi, fellows.

We need to handle these:

- nutrients (wich have a decimal value)
- foods (wich have nutrients),
- recipes (wich have foods) and
- menus (wich have foods and recipes)

We are evaluating Drupal as a framework to develop a website dealing with this data. D7 entities seem to be the right way but we are not sure about it. Can anyone please tell us if this data model can be handled in a pretty straightforward way and roughly how that way would be ?

We specially have doubts in how to manage the relationship between nutrients, foods, recipes and menus.

Thanks so much !!!!

Rafa.

Comments

...

Seams pretty straight forward for Drupal...

Basically, nutrients, foods, recipes, and menus will all be content types. Then, each will have node reference fields to the other content types:

Menus
- foods node reference field
- recipes node reference field

Recipes
- foods node reference field

Foods
- nutrients node reference field

Nutrients - No references here as it is a the bottom of the food chain (pun intended).

...

@Poieo, thanks for your reply. That sounds very D6 language. What about D7 entities and bundles ?? How do those terms enter the scene ? We should need an array of node references en every case, is this possible ?

thanks!!

ps: thanks to VM for updating the forum category of this thread

node references array

Hi, I'm replying to myself with my findings so far and asking for a bit further advice please.

I've installed D7 and CCK.
I defined a food content type and everything's allright (because nutrients were set as independent fields in the food content type). Now I'm trying to define the recipe content type with an "ingredients" field, using CCK node reference. The thing is that I need "an array of node references" and I only see the option to set a "node reference" field type. Can anyone give a hand please ?

I've checked this module: http://drupal.org/project/awesomerelationship and just more questions arise. Aren't entities the same as content types ??

Well, sorry for the newbieness ;)

Thanks !!!

multiple values?

So you want to be able to specify multiple values for a field? You should be able to set this up in the CCK field settings.

You may want to only experiment with Drupal 7 at this point as it's not production-ready. Drupal 6 would still be perfectly acceptable, and the majority of contributed code is going to work with it. Most CCK is now in core Drupal 7, but in Drupal 6 you would just use CCK and related modules.

thanks mradcliffe

I found it ...

still, whats the purpose of the awesome relationships module ??

cheers !

...

Apparently Awesome Relationships is going to be a bi-directional relationship. Node references are uni-directional.

new doubts ...

We are planning to use D7 because we go for production in late feb 2011 (I know this this is arguably, but that's what we've come up so far).

Now, provided that we use D7, should we define new entities for foods, recipes and menus or should those be nodes ? any comments on this ??

thanks

rafa.

nobody click here