Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow meta attributes in relationship fields #406

Open
Labels
@svametcalf

Description

@svametcalf

I have a setup where we are using a ManyToMany field with a through model, similar to the situation described in thisforum post from the json-api spec.

It seems like there are two ways of approaching this. One would be to use themeta key in the relationship, such as:

{"type":"objective","id":"00559422-02E7-11DB-8468-BA18C3C820AE","relationships": {"concepts": {"data": [        {"type":"concept","id":"02B7","meta": {"emphasis":"primary" } },        {"type":"concept","id":"3AF6","meta": {"emphasis":"secondary" } },        {"type":"concept","id":"CB23","meta": {"emphasis":"tertiary" } }      ]    }  }}

Is this possible in using this library?

On the other hand, I could have the relationship point to thethrough model, which would be formatted as such:

{"type":"ObjectiveConceptLink","id":"....","attributes": {"emphasis":"primary",   },"relationships": {"concept": {"data": {"type":"concept","id":"...."        }     },"objective": {"data": {"type":"objective","id":"...."        }     }  }}

Right now in my app, the response does not respect thethrough key when using a ResourceRelatedField. The resulting responserelationships key has a type ofobjective, as opposed toobjective-concept-link.

Are either of these solutions possible with this library? If so, how?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp