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

Inherited CompositeFields don't have the Fields from the parent CompositeField one #18

Open
piranna opened this issue Jun 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@piranna
Copy link

piranna commented Jun 25, 2024

I have a CompositeField with common fields, that later it's inherited by a couple of classes that add more fields. Problem is, when trying to access the fields using the Proxy, only the fields of the child classes are available, and the fields of the parent base CompositeField class are missing. If I copy the fields of the parent class to the child ones, then I can be able to access to them.

As a side note, when the fields were defined only on the parent class, they were not added to the database either.

@bikeshedder bikeshedder added the enhancement New feature or request label Jun 30, 2024
@bikeshedder
Copy link
Owner

I have never thought of using inheritance in composite fields.

Do you have a test case showing the behavior?
Do you want to work on a PR adding support for inheritance?

@piranna
Copy link
Author

piranna commented Aug 17, 2024

Do you have a test case showing the behavior?

No, I don't have it, but it would be trivial: a parent composite field A with an a field, and a child composite field B that inherit from A and have a b field. When creating an instance of A, only have the a field, and it's the only one in the database, and when creating an instance of B, both a and b fields are available both in the composite field and in the database.

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

No branches or pull requests

2 participants