views:

21

answers:

1

There are database string values that are sometimes stored with unnecessary spaces: "SDF@#$#@ 132423"

Given the value without spaces in the UI of a program: "SDF@#$#@132423"

How could I do a Django queryset filter to find the Database value (with spaces) from the UI input value sans spaces?

+3  A: 

A way is to add another field to your model to store "cleaned" values. Next you only have to search for the "cleaned" user entry in this field.

Pierre-Jean Coudert