def clean_username(self): """ Validate that the username is in use. """ user = User.gql("WHERE username = :1 ", self.cleaned_data['username']) if not user: raise forms.ValidationError(__(u'That is not a valid username.')) return self.cleaned_data['username']