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

Replace __local_mapper/table_args__ with __merge_mapper/table_args__. #17

Closed
wants to merge 1 commit into from

Conversation

seth-p
Copy link
Contributor

@seth-p seth-p commented Mar 20, 2015

This is my attempt at fixing the logic for merging __mapper/table_args__ from base classes.

In the absence of callables, the logic for setting cls.__mapper/table_args__ is straightforward:

  • if cls.__dict__ specifies '__mapper/table_args__', then simply use that;
  • otherwise, merge cls.__dict__['__merge_mapper/table_args__'] (if any) with the recursive calculation of __mapper/table_args__ for every base base in cls.__bases__.

In the case that any of the base __mapper/table_args__ are constructed from callables (e.g. classmethods), such callables are reevaluated for cls.

@seth-p seth-p changed the title Replace __local_mapper/table_args__ with __merge_mapper/table_args__. WIP: Replace __local_mapper/table_args__ with __merge_mapper/table_args__. Mar 20, 2015
@seth-p seth-p force-pushed the merge_declarative_args branch 2 times, most recently from 320617c to a3911dd Compare March 20, 2015 01:46
@seth-p seth-p changed the title WIP: Replace __local_mapper/table_args__ with __merge_mapper/table_args__. Replace __local_mapper/table_args__ with __merge_mapper/table_args__. Mar 20, 2015
@dgilland
Copy link
Owner

Merged #18 instead of this one.

@dgilland dgilland closed this Mar 24, 2015
@seth-p seth-p deleted the merge_declarative_args branch March 24, 2015 21:21
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

2 participants