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

Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more consistent. #14019

Merged
merged 1 commit into from Feb 19, 2021

Conversation

hannseman
Copy link
Contributor

@hannseman hannseman commented Feb 18, 2021

Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@hannseman Thanks 👍

django/contrib/postgres/constraints.py Outdated Show resolved Hide resolved
django/contrib/postgres/constraints.py Outdated Show resolved Hide resolved
@hannseman hannseman force-pushed the constraint-index-repr-unification branch from e31b4a2 to e8a03d4 Compare February 19, 2021 11:16
@hannseman
Copy link
Contributor Author

hannseman commented Feb 19, 2021

I also made CheckConstraint follow the same format where check isn't quoted. I made sure to run str and repr before %-formatting to make sure that we don't crash on bad user input, for example someone passes a tuple as name and repr blows up on self.name = "abc", and '%s % self.name.

@hannseman hannseman force-pushed the constraint-index-repr-unification branch from e8a03d4 to 748c2f8 Compare February 19, 2021 11:33
@hannseman hannseman changed the title Fixed #32458 -- Made Index, UniqueConstraint and ExclusionConstraint repr-methods consistent. Fixed #32458 -- Made Index and Constraint __repr__ consistent. Feb 19, 2021
@felixxm felixxm changed the title Fixed #32458 -- Made Index and Constraint __repr__ consistent. Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more consistent. Feb 19, 2021
@felixxm felixxm force-pushed the constraint-index-repr-unification branch from 748c2f8 to 644fd7d Compare February 19, 2021 11:55
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@hannseman Thanks for updates 👍 I pushed small edits.

django/contrib/postgres/constraints.py Outdated Show resolved Hide resolved
django/db/models/constraints.py Outdated Show resolved Hide resolved
django/contrib/postgres/constraints.py Outdated Show resolved Hide resolved
@felixxm felixxm force-pushed the constraint-index-repr-unification branch from 0c899e3 to 87acbf0 Compare February 19, 2021 19:26
@felixxm
Copy link
Member

felixxm commented Feb 19, 2021

@hannseman Thanks 👍

@felixxm felixxm merged commit 87acbf0 into django:master Feb 19, 2021
@hannseman
Copy link
Contributor Author

@felixxm thanks for the review and fixes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants