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

feature/finish-db-models #7

Merged
merged 15 commits into from
Nov 7, 2020
Prev Previous commit
Next Next commit
Rename ignore classes global
  • Loading branch information
JacksonMaxfield committed Oct 30, 2020
commit 06a7749d50000776a8794380bcec7d5ec9435acb
4 changes: 2 additions & 2 deletions cdp_backend/bin/create_cdp_database_uml.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _construct_dot_file(output_file: str):

# First pass: create nodes for each model
for model_name, cls in inspect.getmembers(models, inspect.isclass):
if model_name not in models.TESTING_IGNORE_CLASSES:
if model_name not in models._BUILD_IGNORE_CLASSES:
# Attach fields for each model by using the Example
fields = []
m = cls.Example()
Expand Down Expand Up @@ -106,7 +106,7 @@ def _construct_dot_file(output_file: str):

# Second pass: Create DAG
for model_name, cls in inspect.getmembers(models, inspect.isclass):
if model_name not in models.TESTING_IGNORE_CLASSES:
if model_name not in models._BUILD_IGNORE_CLASSES:
# Attach fields for each model by using the Example
m = cls.Example()

Expand Down
2 changes: 1 addition & 1 deletion cdp_backend/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

###############################################################################

TESTING_IGNORE_CLASSES = [
_BUILD_IGNORE_CLASSES = [
"Model",
"datetime",
"IndexedField",
Expand Down
2 changes: 1 addition & 1 deletion cdp_backend/tests/database/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

def test_validate_model_definitions():
for model_name, cls in inspect.getmembers(models, inspect.isclass):
if model_name not in models.TESTING_IGNORE_CLASSES:
if model_name not in models._BUILD_IGNORE_CLASSES:
assert hasattr(cls, "Example")
assert hasattr(cls, "_PRIMARY_KEYS")
assert hasattr(cls, "_INDEXES")
Expand Down