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

Refactor BoundColumn attributes to allow override of class names. #349 #367

Closed
wants to merge 1 commit into from

Conversation

graup
Copy link
Contributor

@graup graup commented Aug 15, 2016

Related issue: #349

First proposal, refactoring the BoundColumn code to allow override of the class names. For now this preserves the old behaviour of adding the column's name by default. See the test for how it can be overriddden. In a future version we could just swap the two get_class_name versions.

I'm not entirely happy with this, though. I think it would be better if users didn't have to touch the BoundColumn internals. I just couldn't think of a better place.

Maybe instead have a overridable get_column_class_name(self, bound_column) method directly on the table which would be called from BoundColumn, passing itself?

@jieter
Copy link
Owner

jieter commented Aug 16, 2016

@graup thanks for opening the PR!

I agree users should not have to touch BoundColumn internals, the bound_column_class addition to table's class Meta is not a very clear API. can you try your latest suggestion, maybe in a different PR so we can compare the two?

@jieter
Copy link
Owner

jieter commented Aug 22, 2016

Decided to use the other option provided in #370

@jieter jieter closed this Aug 22, 2016
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.

2 participants