You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just installed thecut-durationfield with pip, getting version 2.0.3.
The durationfield is a great idea since django doesn't support postgres
relative timedelta like 'mons' or 'year'. Thanks a lot for making this!
If I do this, I get an Error: TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'str'
The same happens if I call the obejcts save method: AttributeError: 'str' object has no attribute 'days' [save_traceback.txt](https://github.com/thecut/thecut-durationfield/files/421942/save_traceback.txt)
Historically, Django provided a metaclass called SubfieldBase which always called to_python() on assignment. This did not play nicely with custom database transformations, aggregation, or values queries, so it has been replaced with from_db_value().
But nothing was modified on the field to provide from_db_value.
Commit 13a3a34 is also slightly worrying, as it claims 'some fixes' for things which aren't described / referenced / tested.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I just installed thecut-durationfield with pip, getting version 2.0.3.
The durationfield is a great idea since django doesn't support postgres
relative timedelta like 'mons' or 'year'. Thanks a lot for making this!
Unfortunately I have problems using the RelativeDeltaField, using a
model like documented on
https://pypi.python.org/pypi/thecut-durationfield/2.0.3:
If I do this, I get an Error:
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'str'
The same happens if I call the obejcts save method:
AttributeError: 'str' object has no attribute 'days' [save_traceback.txt](https://github.com/thecut/thecut-durationfield/files/421942/save_traceback.txt)
see attached save_traceback.txt
Obviously the 'P7D' string is not converted to relativedelta.
When I do this:
The above code works, also the save method, but only until I fetch the
entry from the Database:
Here the string is not converted back to a relativedelta object.
Any support would be highly appreciated!
Best regards,
Juergen
The text was updated successfully, but these errors were encountered: