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

as_marshmallow_field params are not passed to the container in a ListField #64

Closed
lafrech opened this issue Oct 26, 2016 · 3 comments
Closed
Assignees
Labels

Comments

@lafrech
Copy link
Collaborator

lafrech commented Oct 26, 2016

In ListField, the params that are passed to as_marshmallow_field are used only for the underlying Marshmallow List but nothing is passed to the container.

https://github.com/Scille/umongo/blob/master/umongo/fields.py#L119

AFAIU, there is no way to pass params to the container, for instance an EmbeddedField inside the ListField. This sort of breaks the cascading mechanism.

@touilleMan
Copy link
Member

touilleMan commented Oct 29, 2016

What about a special container_params field to define in params ?

EDIT: I've just realised this is already done in EmbeddedDocumentField with the embedded params named just params. So I'm not sure whether we should call it container_params or just params...

@lafrech
Copy link
Collaborator Author

lafrech commented Nov 3, 2016

Well, IIUC, we could do the same as EmbeddedField:

params is a dict with the parameters for the field, and it may include a params key for which the value is a dict with the parameters for the nested field.

This should work in all cases. As long as no field requires a parameter called params, since this would be a reserved word for nested field parameters.

Unless I missed something, this should be pretty easy.

I'll try to tackle this and #65. Not a priority right now, but I'll try to find the time.

@lafrech lafrech self-assigned this Dec 4, 2016
@lafrech lafrech added the bug label Dec 4, 2016
@lafrech
Copy link
Collaborator Author

lafrech commented Dec 4, 2016

Labelling bug as it is a flaw of the existing mechanism rather than a missing feature.

Assigning to myself. Doesn't mean I'll be doing this any soon. I'm on tight schedule and this is not blocking. If you find time to do that, don't refrain to do so!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants