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

Extraneous return of empty string in field.export() #1649

Closed
matthewhegarty opened this issue Oct 4, 2023 · 0 comments
Closed

Extraneous return of empty string in field.export() #1649

matthewhegarty opened this issue Oct 4, 2023 · 0 comments
Assignees
Labels

Comments

@matthewhegarty
Copy link
Contributor

matthewhegarty commented Oct 4, 2023

Describe the bug

We have this call in field.export():

    def export(self, instance):
        """
        Returns value from the provided instance converted to export
        representation.
        """
        value = self.get_value(instance)
        if value is None:
            return ""
        return self.widget.render(value, instance)

This means that we have logic which changes the return value within Field. It would be ideal if the widget was responsible for rendering the return value.

This might be a useful modification to v4.

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

No branches or pull requests

1 participant