Skip to content

When saving timezone field with string value it won't get converted to pytz object #57

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

Closed
imomaliev opened this issue Oct 22, 2019 · 2 comments · Fixed by #102
Closed

Comments

@imomaliev
Copy link

imomaliev commented Oct 22, 2019

obj = MyModel.objects.create(timezone='Europe/Berlin')
assert not isinstance(obj.timezone, str)

It should return pytz object. I'm not sure but we probably will have to create descriptor like FileField has

@imomaliev imomaliev changed the title When saving timezone field with string value it will no get converted to pytz object When saving timezone field with string value it won't get converted to pytz object Oct 22, 2019
@mfogel
Copy link
Owner

mfogel commented Nov 14, 2020

Agreed this would be better to return a timezone object. Pull requests happily entertained.

@mfogel
Copy link
Owner

mfogel commented Dec 9, 2023

The fix for this is on main and will be included in the next release to pypi, which will be a major version bump.

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

Successfully merging a pull request may close this issue.

2 participants