kapilratnani / django_hana

[Discontinued] Django db backend for SAP HANA
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

icontains search not working #10

Closed alexgv closed 11 years ago

alexgv commented 11 years ago

Institution.objects.using(db(request)).filter(Description_Short__icontains= "Short")

The following query below creates a sql similar to above

SELECT FoundationBuilder_institution.id, FoundationBuilder_institution.InstID, FoundationBuilder_institution.UserID, FoundationBuilder_institution.Eff_Date, FoundationBuilder_institution.Address, FoundationBuilder_institution.Description_Short, FoundationBuilder_institution.Description_Long, FoundationBuilder_institution.Phone_Number, FoundationBuilder_institution.Fax_Number, FoundationBuilder_institution.Audit, FoundationBuilder_institution.Created FROM FoundationBuilder_institution WHERE FoundationBuilder_institution.Description_Short LIKE UPPER(%Short%) LIMIT 21

However, the type of query it should create should have the column wrapped in upper also like so. If not the query wont return anything

SELECT * FROM "STUDENTCLOUD"."FOUNDATIONBUILDER_INSTITUTION" WHERE UPPER(Description_Short) LIKE UPPER('%short%') LIMIT 21

kapilratnani commented 11 years ago

Fixed.

alexgv commented 11 years ago

Thanks.