I have a table that I cannot control, but need to select from it. The field \"building\" is a varchar, and also defined like this in my (non managed) django model. But it should
as simple as it gets: use a regex query
regex = r'^0{0,4}%s ?$' % building_no address = Address.objects.filter(building__iregex=regex)\
any hints on performance welcome...