﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3721	[boulder-oracle] LazyDate objects are not being handled by the Oracle backend	Ben Khoo <benk@…>	Adrian Holovaty	"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."		closed	Database layer (models, ORM)	other branch		fixed	Oracle LazyDate		Accepted	1	0	0	1	0	0
