Opened 18 years ago
Closed 18 years ago
#3721 closed (fixed)
[boulder-oracle] LazyDate objects are not being handled by the Oracle backend
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | other branch |
Severity: | Keywords: | Oracle LazyDate | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
While attempting to implement user logins using the authentication framework, I received this error.
Traceback (most recent call last): File "manage.py", line 11, in ? execute_manager(settings) File "/home/swuser/jsafreports/django/django/core/management.py", line 1693, in execute_manager execute_from_command_line(action_mapping, argv) File "/home/swuser/jsafreports/django/django/core/management.py", line 1592, in execute_from_command_line action_mapping[action](int(options.verbosity), options.interactive) File "/home/swuser/jsafreports/django/django/core/management.py", line 576, in syncdb _emit_post_sync_signal(created_models, verbosity, interactive) File "/home/swuser/jsafreports/django/django/core/management.py", line 505, in _emit_post_sync_signal verbosity=verbosity, interactive=interactive) File "/home/swuser/jsafreports/django/django/dispatch/dispatcher.py", line 358, in send sender=sender, File "/home/swuser/jsafreports/django/django/dispatch/robustapply.py", line 47, in robustApply return receiver(*arguments, **named) File "/home/swuser/jsafreports/jsafreports-two/jsaf_reports/../jsaf_reports/jsafreports/management.py", line 115, in install_data create_users() File "/home/swuser/jsafreports/jsafreports-two/jsaf_reports/../jsaf_reports/jsafreports/management.py", line 137, in create_users u.save() File "/home/swuser/jsafreports/django/django/db/models/base.py", line 238, in save ','.join(placeholders)), db_values) File "/home/swuser/jsafreports/django/django/db/backends/oracle/base.py", line 103, in execute return Database.Cursor.execute(self, query, params) cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data type LazyDate
The error stems from cx_Oracle being unable to convert a LazyDate object to an appropriate representation for the Oracle Timestamp datatype.
I have attached a patch that works around this problem by replacing the LazyDate object with a DateTime object before the query is executed. I don't believe this is suitable for a final fix because it violates the LazyDate object by directly invoking the __get_value__()
function.
I am using the boulder-oracle-sprint branch.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | oracle_lazydate.patch added |
---|
comment:1 by , 18 years ago
Component: | Uncategorized → Database wrapper |
---|---|
Owner: | changed from | to
Patch needs improvement: | set |
Summary: | LazyDate objects are not being handled by the Oracle backend → [boulder-oracle] LazyDate objects are not being handled by the Oracle backend |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Temporary workaround to replace the LazyDate with the DateTime