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

TypeError: can't compare offset-naive and offset-aware datetimes #68

Open
areski opened this issue Apr 8, 2014 · 5 comments
Open

TypeError: can't compare offset-naive and offset-aware datetimes #68

areski opened this issue Apr 8, 2014 · 5 comments

Comments

@areski
Copy link
Contributor

areski commented Apr 8, 2014

I'm getting this error when saving on a model that have datetime, here a pastebin
http://pastebin.com/uLWyEVMD

"""
File "/home/areski/.virtualenvs/sandman/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py", line 661, in get_history
return History.from_scalar_attribute(self, state, dict_[self.key])
File "/home/areski/.virtualenvs/sandman/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py", line 1261, in from_scalar_attribute
elif attribute.is_equal(current, original) is True:
File "/home/areski/.virtualenvs/sandman/lib/python2.7/site-packages/sqlalchemy/sql/type_api.py", line 207, in compare_values
return x == y
TypeError: can't compare offset-naive and offset-aware datetimes
"""

let me know if you need further info

@jeffknupp
Copy link
Owner

Is it possible for you to attach your db schema and/or the code that triggered this?

@areski
Copy link
Contributor Author

areski commented Apr 14, 2014

Sure, here you go http://pastebin.com/AmqVNdw5
and I trigger it like this : sandmanctl postgresql://postgres:password@localhost:5432/newfiesdb

@jeffknupp
Copy link
Owner

I'm unable to reproduce this (by adding a record to 'southmigration_history', for example). What was the specific value you were trying to use and on which model?

@areski
Copy link
Contributor Author

areski commented Apr 28, 2014

for instance if I try to update a record in dnc_contact : http://localhost:5000/admin/dnc_contactview/edit/?url=%2Fadmin%2Fdnc_contactview%2F&id=3

then I will get the following error http://pastebin.com/NixuUWfY

@vporoshok
Copy link

I've got the same error. Is there a solution?

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

3 participants