I have the following model in Django:
class Event(models.Model):
start_date = models.DateField()
end_date = models.DateField()
I am using Oracle 10g Database with Django 1.5 and cx_oracle 5.1.2. The problem here is that when I try to create a new object in the admin interface (selecting a date from the calendar), the following error occurs:
ORA-01843: not a valid month
syncdbcreated a field DATEin oracle for start_dateand end_date. Is this like a bug in the backend or am I doing something wrong?
I have other models with DateTimeField(), and they work fine when I save new objects, the problem is related to myself DateField.
UPDATE: I checked the backend implementation on backends/oracle/base.pylines 513 through 516:
cursor.execute(
"ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
" NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF'"
+ (" TIME_ZONE = 'UTC'" if settings.USE_TZ else ''))
insert DATE. , , '2013-03-20' start_date end_date. NLS_DATE_FORMAT, !
. , cx_oracle.
. ( , cx_oracle, ), DateField DateTimeField, TIMESTAMP .