Skip to content

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

Open
@idchlife

Description

@idchlife

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 😞

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions