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

#87 breaks persistent Text fields #90

Closed
agroszer opened this issue Mar 6, 2020 · 1 comment · Fixed by #91
Closed

#87 breaks persistent Text fields #90

agroszer opened this issue Mar 6, 2020 · 1 comment · Fixed by #91

Comments

@agroszer
Copy link
Contributor

agroszer commented Mar 6, 2020

We persist some schemas that use fields. Setting unicode_normalization in Text.__init__ breaks persistent loading of such schemas.

@jamadden
Copy link
Member

jamadden commented Mar 6, 2020

IIUC, a class attribute would solve that?

class Text(MinMaxLen, Field):
    unicode_normalization = 'NFC'

    def __init__(self, *args, **kwargs):
        self.unicode_normalization = kwargs.pop(
            'unicode_normaliaztion',
            type(self).unicode_normalization)
        super(Text, self).__init__(*args, **kwargs)

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

Successfully merging a pull request may close this issue.

2 participants