#14626: DateField is not coming in as Python's datetime.date object
------------------------------------------+---------------------------------
 Reporter:  mischko                       |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.2       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 Oracle backend with cx_Oracle 5.0.4
 Python 2.4.3
 Oracle 11

 class scott_test1(models.Model):
     graphic_id = models.IntegerField()
     graphic_desc = models.CharField(max_length=30)
     curves = models.TextField()
     graphic_type = models.CharField(max_length=4)
     df = models.DateField(null=True, auto_now = True) # datetime.date
     dtf = models.DateTimeField(null=True, auto_now = True) #
 datetime.datetime
     tf = models.TimeField(null=True, auto_now =True) # datetime.time

 foo=scott_test1(graphic_id=2,graphic_desc="here is some text", curves= ",
 ".join([str(x * 3.1514) for x in xrange(1000)]), graphic_type="none")

 foo.save()

 According to the docs at
 http://docs.djangoproject.com/en/dev/ref/models/fields/#datefield, foo.df
 should be a datetime.date object, not datetime.datetime:

 In [7]: foo.df
 Out[7]: datetime.datetime(2010, 11, 5, 10, 13, 3, 744903)

 In [8]: foo.dtf
 Out[8]: datetime.datetime(2010, 11, 5, 10, 13, 3, 745076)

 In [9]: foo.tf
 Out[9]: datetime.time(10, 13, 3, 745130)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14626>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to