(self, username, email)
Queries for a User by username or email
Queries for a User by username or email
Queries for a User by username or email
def by_username_or_email(self, username, email):
        """Queries for a User by username or email"""
        q = Q()

        if username:
            q |= Q(username=username)

        elif email:
            q |= Q(email=email)

        if q:
            return self.get(q)
        else:
            raise UserProxy.DoesNotExist
def by_username_or_email ( self , username , email ) : q = Q ( ) if username : q |= Q ( username = username ) elif email : q |= Q ( email = email ) if q : return self . get ( q ) else : raise UserProxy . DoesNotExist