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

dates are converting to todays date if they were None when accessed on models #246

Closed
josephmancuso opened this issue Nov 29, 2020 · 2 comments · Fixed by #247
Closed

dates are converting to todays date if they were None when accessed on models #246

josephmancuso opened this issue Nov 29, 2020 · 2 comments · Fixed by #247

Comments

@josephmancuso
Copy link
Member

If i set a field in the __dates__ attribute, it converts fine on serialize but does not work on accessing the attribute.

If you try to use a pendulum instance on the attribute you will get:

'str object' has no attribute 'is_today'
@josephmancuso
Copy link
Member Author

The actual issue was that the dates were converting to todays date if they were None

@josephmancuso josephmancuso changed the title Model dates do not convert to pendulum instances when accessed dates are converting to todays date if they were None when accessed on models Nov 29, 2020
@josephmancuso
Copy link
Member Author

actually when assigning a relationship, relationship is being serialized (to a string) and then when retrieving the attribute it does not convert back to pendulum.

Could possibly add this logic inside the getattr method on the model or find a way to register the relationship without serializing

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.

1 participant