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

Field.set_type should be able to modify options #128

Closed
Jaymon opened this issue Apr 29, 2021 · 1 comment
Closed

Field.set_type should be able to modify options #128

Jaymon opened this issue Apr 29, 2021 · 1 comment

Comments

@Jaymon
Copy link
Owner

Jaymon commented Apr 29, 2021

The whole point is to be able to define custom types, but this fails because .set_type(...) is called before the options are set, currently, I'm doing things like this:

foo = Field(FooStr, True, size=14)

And this is what set_type kind of looks like:

    def set_type(self, field_type, field_options):
        super(Field, self).set_type(field_type, field_options)
        if issubclass(field_type, FooStr):
            self._interface_type = str
            self.serializer = ""

And I would like to be able to set the size and stuff in options under self.serializer = ""

@Jaymon
Copy link
Owner Author

Jaymon commented Jun 25, 2021

At some point between April 29 and June 25, 2021 this got addressed

@Jaymon Jaymon closed this as completed Jun 25, 2021
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