⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Grocery CRUD with recipe DB



Datenshi

Datenshi
  • profile picture
  • Member

Posted 04 August 2018 - 15:22 PM

Hi all,

 

I am trying to implement a simple web site to create a recipes DB. The idea is simple, tables and content:

* 'recipe' : with id(PK), name, description, author

* 'step': id(PK), recipe_id(FK), step_number, description

* 'step_ingredient': recipe_id(PK), ingredient_id(FK), step_id(PK), amount

* 'ingredient': id(PK), name, provider

 

dSnpA.png

Something like that but skipping the tables I did not listed. Only the four tables I mentioned are mandatory. So basically I would like to use this module for a recipes CRUD system.

 

I can also consider something like this:

 

wNjCC.png

The key points, and actually, what I am struggling to implement are, 1. to be able to keep the order of the ingredients added, and 2. for each ingredient be able to define the amount of it in the add recipe or edition windows.

 

Thanks a lot and best regards.


Julio

Julio
  • profile picture
  • Member

Posted 05 August 2018 - 01:28 AM

Hi @Datenshi,

Are you getting some kind of error message?

Datenshi

Datenshi
  • profile picture
  • Member

Posted 05 August 2018 - 02:25 AM

Hi Julio, no, I'm a newby working with Grocery CRUD and I don't know if it is possible to create a unique view to fully manage the recipe CRUD.

I mean, to be able to see recipe fields like, ingredients and amount of each one, even the proper order. Fields that belong to other table but they have a relation.

Or I have to split the recipe in multiple views...

Thanks a lot

Julio

Julio
  • profile picture
  • Member

Posted 05 August 2018 - 14:16 PM

Indeed with just the features of GC it won't be possible to use a single window CRUD, specially the amount of the ingredients.

But you should use set_relation, add_action button and callbacks.