Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Problem: mandatory keyword restriction is forced#45

Merged
ahashibon merged 1 commit into
masterfrom
make-datacontainer-restriction-optional
Sep 29, 2016
Merged

Problem: mandatory keyword restriction is forced#45
ahashibon merged 1 commit into
masterfrom
make-datacontainer-restriction-optional

Conversation

@mehdisadeghi

Copy link
Copy Markdown
Contributor

This PR disables mandatory keyword restriction on data property of CUDS classes. In order to have restriction, one must do it manually:

RestrictedDataContainer = create_data_container(Material.supported_parameters())
rdc = RestrictedDataContainer()
rdc[CUBA.NAME] = 'myname'
m1 = Material(data=rdc)
m2 = Material()
m1.data[CUBA.MASS] = 1.0 # Not allowed
m2.data[CUBA.MASS] = 1.0 #Allowed by default

Solution: disable it.

@mehdisadeghi

Copy link
Copy Markdown
Contributor Author

Related PR: simphony/simphony-common#293

@ahashibon ahashibon merged commit 4215eb9 into master Sep 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants