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

When using multiple inheritance, rogue field errors for any inherited models #596

Open
idchlife opened this issue Jul 9, 2019 · 0 comments

Comments

@idchlife
Copy link

idchlife commented Jul 9, 2019

Here is example:

from schematics import Model
from schematics import StringField, ListField, BooleanField

class WithRoles():
  roles = ListField(StringField)

class _UserForm():
  email = StringField()
  name = StringField()

class CurrentUserForm(Model, _UserForm):
  pass

class AdminUserForm(Model, _UserForm, WithRoles)
  active = BooleanField()

When I try to validate AdminUserForm I'm getting rogue field error on 'roles' field, 'email' field, 'name' field. Only active field is used.

Same with CurrentUserForm, rogue fields are 'email' and 'name'

I tried to google the problem, but it seems I'm the only one crazy enough to use multiple inheritance like this 😞

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

No branches or pull requests

1 participant