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

fixes: #2943, allow overriding validates for inheritance #10574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

indiVar0508
Copy link
Contributor

@indiVar0508 indiVar0508 commented Nov 1, 2023

Applied the patch mentioned in #2943, to allow overriding the validates method of a given Model, Added tests for same in test_validators.
If a Child class overrides the parent class validates method only child class validator will be invoked unless child class explicitly invokes parent class validator

Description

Checklist

This pull request is:

  • A new feature implementation
    • please include the issue number, and create an issue if none exists, which must
      include a complete example of how the feature would look.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests.

Have a nice day!

@zzzeek
Copy link
Member

zzzeek commented Nov 1, 2023

OK...it all works? this is a 2.1 thing then

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision d310bef of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

New Gerrit review created for change d310bef: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/4919

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Federico Caselli (CaselIT) wrote:

left some style suggestions

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/4919

test/orm/test_validators.py Outdated Show resolved Hide resolved
test/orm/test_validators.py Outdated Show resolved Hide resolved
Applied the patch mentioned in sqlalchemy#2943, to allow overriding the
validates method of a given Model, Added tests for same in
test_validators.
If a Child class overrides the parent class validates method
only child class validator will be invoked unless child class
explicitly invokes parent class validator
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

Successfully merging this pull request may close these issues.

None yet

3 participants