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

Add support for django serializers #7

Open
travfu opened this issue Feb 1, 2023 · 0 comments
Open

Add support for django serializers #7

travfu opened this issue Feb 1, 2023 · 0 comments

Comments

@travfu
Copy link

travfu commented Feb 1, 2023

Can support for django.core.serializers.serialize be added? see django doc on subject.

Currently, strategy field's value_to_string will return a stringified class instance '<path.to.Strategy object at 0xffff89fd9190>', when I imagine we would want it to be something like "path.to.Strategy"

Proposal
since StrategyField is a CharField, something like this should work

class AbstractStrategyField(models.Field):
    def value_to_string(self, obj):
        value = self.value_from_object(obj)
        return self.get_prep_value(value)
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