def index_field_from_django_field(f, default=CharField):
 result = default
 if (f.get_internal_type() in (u'DateField', u'DateTimeField')):
  result = DateTimeField
 elif (f.get_internal_type() in (u'BooleanField', u'NullBooleanField')):
  result = BooleanField
 elif (f.get_internal_type() in (u'CommaSeparatedIntegerField',)):
  result = MultiValueField
 elif (f.get_internal_type() in (u'DecimalField', u'FloatField')):
  result = FloatField
 elif (f.get_internal_type() in (u'IntegerField', u'PositiveIntegerField', u'PositiveSmallIntegerField', u'SmallIntegerField')):
  result = IntegerField
 return result

def index_field_from_django_field ( f , default = CharField ) : result = default if ( f . get_internal_type ( ) in ( u'DateField' , u'DateTimeField' ) ) : result = DateTimeField elif ( f . get_internal_type ( ) in ( u'BooleanField' , u'NullBooleanField' ) ) : result = BooleanField elif ( f . get_internal_type ( ) in ( u'CommaSeparatedIntegerField' , ) ) : result = MultiValueField elif ( f . get_internal_type ( ) in ( u'DecimalField' , u'FloatField' ) ) : result = FloatField elif ( f . get_internal_type ( ) in ( u'IntegerField' , u'PositiveIntegerField' , u'PositiveSmallIntegerField' , u'SmallIntegerField' ) ) : result = IntegerField return result
returns the haystack field type that would likely be associated with each django type .