Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #78 from postatum/101949350_change_password
Browse files Browse the repository at this point in the history
Parse hidden fields
  • Loading branch information
jstoiko committed Sep 27, 2015
2 parents 0ef1fad + 8ab40c4 commit deae3f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ramses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def generate_model_cls(config, schema, model_name, raml_resource,
'__tablename__': model_name.lower(),
'_public_fields': schema.get('_public_fields') or [],
'_auth_fields': schema.get('_auth_fields') or [],
'_hidden_fields': schema.get('_hidden_fields') or [],
'_nested_relationships': schema.get('_nested_relationships') or [],
}
# Generate fields from properties
Expand Down
2 changes: 2 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def _test_schema(self):
'_auth_model': False,
'_public_fields': ['public_field1'],
'_auth_fields': ['auth_field1'],
'_hidden_fields': ['hidden_field1'],
'_nested_relationships': ['nested_field1']
}

Expand Down Expand Up @@ -170,6 +171,7 @@ def test_simple_case(self, mock_res, mock_reg, mock_subscribers):
assert model_cls.__tablename__ == 'story'
assert model_cls._public_fields == ['public_field1']
assert model_cls._auth_fields == ['auth_field1']
assert model_cls._hidden_fields == ['hidden_field1']
assert model_cls._nested_relationships == ['nested_field1']
assert model_cls.foo == 'bar'
assert issubclass(model_cls, models.engine.ESBaseDocument)
Expand Down

0 comments on commit deae3f9

Please sign in to comment.