Skip to content

How to exclude or specifically include fields from having filters auto created #418

Open

Description

@adiberk

Is there a way we can explicitly list all the fields we want filters created for? Like maybe in the Meta of the sqlalchemy object type?

Activity

  1. changed the title [-]How to exclude fields from having filters auto created[/-] [+]How to exclude or specifically include fields from having filters auto created[/+] on Dec 27, 2024
  2. andmaster-one commented on Feb 13, 2025

    @andmaster-one

    Have you got how to do that?

  3. rcb4by commented on Apr 23, 2025

    @rcb4by

    @adiberk @andmaster-one if you look in the docstring for ORMField you'll see a param for enabling/disabling filter creation. Modifying an example usage from the same docstring:

                class MyModel(Base):
                    id = Column(Integer(), primary_key=True)
                    name = Column(String)
    
                class MyType(SQLAlchemyObjectType):
                    class Meta:
                        model = MyModel
    
                    id = ORMField(create_filter=False)       # disable filtering for this field
                    name = ORMField(create_filter=True)  # True is default behavior, but we can make it explicit

    You can also change the default behavior using the create_filter param on the Meta class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions