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

should_set_tablename() doesn't handle declared_attr. #23

Merged

Conversation

seth-p
Copy link
Contributor

@seth-p seth-p commented Apr 24, 2015

This PR adds test_should_set_tablename_declared_attr() to demonstrate that should_set_tablename() doesn't handle @declared_attr columns and relationships.

I don't see how to fix this so long as should_set_tablename() is called from ModelMeta.__new__() before the class is constructed.

@seth-p seth-p force-pushed the should_set_tablename_declared_attr branch 7 times, most recently from 18ab0fe to 03b2f7c Compare April 25, 2015 01:09
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.23%) to 99.77% when pulling 18ab0fe on seth-p:should_set_tablename_declared_attr into fba26a6 on dgilland:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 03b2f7c on seth-p:should_set_tablename_declared_attr into fba26a6 on dgilland:develop.

@@ -93,6 +87,17 @@ def get_mapper_class(model, field):
return mapper_class(getattr(model, field))


def _concrete_value(obj, cls, check_classmethod=False, check_callable=False):
Copy link
Owner

Choose a reason for hiding this comment

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

Let's name this get_concrete_value and add a docstring.

@dgilland
Copy link
Owner

Overall, I think the logic looks good. Just a few nits and this should be good to merge.

@seth-p seth-p force-pushed the should_set_tablename_declared_attr branch from 03b2f7c to 20ba678 Compare April 25, 2015 06:10
@seth-p seth-p force-pushed the should_set_tablename_declared_attr branch from 20ba678 to 6921aaa Compare April 25, 2015 06:11
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 6921aaa on seth-p:should_set_tablename_declared_attr into fba26a6 on dgilland:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 6921aaa on seth-p:should_set_tablename_declared_attr into fba26a6 on dgilland:develop.

@dgilland
Copy link
Owner

Looks good! Thanks!

dgilland added a commit that referenced this pull request Apr 25, 2015
should_set_tablename() doesn't handle declared_attr.
@dgilland dgilland merged commit 47ea146 into dgilland:develop Apr 25, 2015
@seth-p seth-p deleted the should_set_tablename_declared_attr branch April 25, 2015 22:57
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