Closed alexgv closed 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
Fixed.
Thanks.
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