'Returns the query provided by the user.
Returns an empty string if the query is invalid.'

def get_query(self):

    if self.form.is_valid():
        return self.form.cleaned_data[u'q']
    return u''
