marshmallow-sqlalchemy
marshmallow-sqlalchemy copied to clipboard
Document Related Field
Marshmallow-sqlalchemy contains a Field ~~"Result"~~ Related but the documentation doesn't reference it at all. Document Related field, and give examples of it's use.
I'm not sure what you're referring to. There's no Result
class in the code.
I am so sorry . . . I meant Related. I’ve edited the issue title.
Ah, I see. Yes, we should document that class. It's use for foreign key relationships.
I would definitely review/merge a PR adding docs.
Thanks.
Specifically, it's not clear which args and kwargs Related
uses, how it's related to Nested
, how/if it handles secondary joins, how/if it handles multiple foreign keys, etc.
Currently, it translates all the relationships to the relevant UUID pks (I'm using Postgres). I don't know if this is a problem with Related or Postgres support. It might be a new bug, old bug, or I'm just not using it right. Hard to tell.
So far the best documentation is in the unit tests: https://github.com/marshmallow-code/marshmallow-sqlalchemy/blob/dev/tests/test_marshmallow_sqlalchemy.py
I added Related
to the autogenerated documentation: https://marshmallow-sqlalchemy.readthedocs.io/en/latest/api_reference.html#marshmallow_sqlalchemy.fields.Related . The docs still need to be fleshed out, but it's a start.
Still accepting PRs!