You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_get_fields_with_property only return top level excludes which is good because sub level excludes should be mixed with overrides parameters like this :
overrides : {
'myrelationname' : excludes: {...}}
The text was updated successfully, but these errors were encountered:
tsauerwein
changed the title
admin_only don't apply through sequences/relationship
admin_only property is not considered for fields in relationships
Nov 27, 2014
_get_fields_with_property only return top level excludes which is good because sub level excludes should be mixed with overrides parameters
So you are ok with the current behavior?
I see three solutions on how to deal with this problem that the admin_only property is only taken into account for fields on the main model:
It's not a bug, it's a feature. If the user wants to exclude fields for child models, he/she has to set 'overrides'. Which is confusing in my opinion.
Check for the admin_only recursively and and set the excludes with the overrides property for child models when creating the schema. The problem is that the user might provide a custom overridesobject, so we would have to merge the user overrides with our overrides. This might be tricky but doable.
Remove the admin_only property. The user would have to specify the includes or excludes via the overrides property. This also allows to hide fields in the user views.
We agreed to go for option 3, because it should be possible to use the same model with different schemas. And because this is also the way you would do it when directly using ColanderAlchemy.
c2cgeoform/c2cgeoform/schema.py
Line 22 in ed621dc
_get_fields_with_property only return top level excludes which is good because sub level excludes should be mixed with overrides parameters like this :
overrides : {
'myrelationname' : excludes: {...}}
The text was updated successfully, but these errors were encountered: