BelongsTo subfields? How? #664
Unanswered
kde99
asked this question in
Q&A (Help)
Replies: 1 comment 1 reply
-
Hello @kde99 For Does it work for you ? Cheers |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone!
I have my two models called Partners(id, name, mail_address_id, shipping_address_id) and Addresses(id, country, address). According to the documentation this should be a belongsTo relationship (since partners has they address_id field).
My issue is that with belongsTo like this Backpack creates the select from a list type of field, but what I want is the subfields type. When I defined it by hand (with belongsTo) it is ignored and the select type shows still. I tried to define it with hasOne (I know it's not the right relationship BUT partner <-> address is 1-1! not n-1), this partially works: the subfields show up I can save (it saves the new address), but neither of the Partner table's fields get updated with the new address id.
I have also thought about the inline create operation, but I want the subfields to show up in case we have to change the addresses manually.
My question is: how could I make subfields work with this arrangement without having to create a whole new table for these address types?
Beta Was this translation helpful? Give feedback.
All reactions