Skip to content

Specify ignored attributes in mappings #1927

Closed
@lunalucadou

Description

@lunalucadou

SQLAlchemy interprets the ClassVar type annotation to mean a non-mapped variable which the ORM can safely ignore. This is great, since it lets us populate special fields at runtime without IDEs complaining about unresolved attributes (and, if the value is read before being set, it doesn't risk causing a runtime exception).

Is there a way to emulate this with Document mappings? We could pre-populate the fields to be empty strs/lists/dicts, but that means re-building our indices every time we want to add/remove special attributes or change their types.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions