Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support embedded form for one-to-one relationships #390

Closed
jpetitcolas opened this issue Apr 9, 2015 · 5 comments
Closed

Support embedded form for one-to-one relationships #390

jpetitcolas opened this issue Apr 9, 2015 · 5 comments

Comments

@jpetitcolas
Copy link
Contributor

Considering an API returns the following response:

// GET /api/posts
[{
    id: 1,
    title: "Cake is a lie!",
    metadata: {
        id: 4,
        source: "GladOS"
    }
}]

With a one-to-one relationship between Post and Metadata. We need to be able to embed a metadata form into the post form, as we have to save them simultaneously.

@fzaninotto
Copy link
Member

Fixed by #549

@Phocea
Copy link
Contributor

Phocea commented Sep 7, 2015

Thanks fot the dot notation support.
However how does this apply to embedded one-to.many relationship?

// GET /api/posts
[{
id: 1,
title: "Cake is a lie!",
metadata: [ {
key: 4,
value: "GladOS"
},
{
key: 10,
value: "HopeOS"
}],
}]

@fzaninotto
Copy link
Member

Nope, not for now. But if you're looking for an element at a fixed position in a sub-array, I think an ElementTransformer is the way to go.

@Phocea
Copy link
Contributor

Phocea commented Sep 7, 2015

Ok, thanks for the reply.
What I need is to display all the key/value of an entity, exactly as if it was an external 1-n relationship. Also need to be able to edit a value, or add a key/value.
I will look into this....

@fzaninotto
Copy link
Member

So this is somehow related to #241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants