adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

Enhancement: One to many relationship

Open stelone opened this issue 6 years ago • 3 comments

Original request

Hi

I have one/many to many relations in my ressource and I want to be able in the detail resource page to :

  • modify relations in edit mode
  • see object associate with my ressource

Like nested object in the example.

Is it possible with custom ressource ?

For information : I use sequelize has ORM.

Description

We have to find a way of allowing people to add one to many relationships - aka. displaying list of related items in a show action.

Possible solutions:

  1. add new propertyType: 'hasMany' | 'list' | 'whatever..' and option filter, which will filter records and print them in a table
  2. don't have other proposition

blockers:

  • #251

stelone avatar Jan 29 '20 09:01 stelone

Hi, I have a similar problem. I've found this example into the live demo's code https://github.com/SoftwareBrothers/admin-bro-example-app/blob/master/sequelize/models/favouriteplace.js But I need to do something like the complicated example with mongoose and I can't find the way to do it with sequelize... https://github.com/SoftwareBrothers/admin-bro-example-app/blob/master/mongoose/complicated-model.js does anyone can help me with this issue? thank you in advance!

MariaRoblesSpin avatar Feb 12 '20 08:02 MariaRoblesSpin

Hi, I needed that also, I use sequelize + postgresql, finally I just created a view in the database and defined everything like it is a regular table, looks fine so far, maybe you should try that?

nogalasman avatar Feb 16 '20 07:02 nogalasman

https://github.com/SoftwareBrothers/adminjs/issues/319

krzysztofstudniarek avatar Aug 16 '22 08:08 krzysztofstudniarek