mfares / solrpy

Automatically exported from code.google.com/p/solrpy
0 stars 0 forks source link

Time from datetime values is lost #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add a document using a datetime value with a non-zero time field
   for a stored solr.DateField field.
2. Retrieve the stored document from solr.

The time portion of the retrieved document should provide the time
passed in, but shows 00:00:00 instead.

The problem is caused by the order of the type checks in 
SolrConnection.__add():

- Since datetime.datetime subclasses datetime.date, the first
  isinstance(value, datetime.date) returns true, and throws
  away the time value.

- The constructed incorrect value is then processed correctly.

The problem occurs in both the released 0.5 and the trunk.

The attached patch corrects the problem and adds a test.

Original issue reported on code.google.com by fdrake on 24 Jan 2010 at 8:41

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r58.

Original comment by ed.summers on 18 Feb 2010 at 11:39