(self, domain, user_input)
First check by site-code, if that fails, fall back to name.
        Note that name lookup may raise MultipleObjectsReturned.
First check by site-code, if that fails, fall back to name.
        Note that name lookup may raise MultipleObjectsReturned.
First check by site - code if that fails fall back to name . Note that name lookup may raise MultipleObjectsReturned .
def get_from_user_input(self, domain, user_input):
        """
        First check by site-code, if that fails, fall back to name.
        Note that name lookup may raise MultipleObjectsReturned.
        """
        try:
            return self.get(domain=domain, site_code=user_input)
        except self.model.DoesNotExist:
            return self.get(domain=domain, name__iexact=user_input)
def get_from_user_input ( self , domain , user_input ) : try : return self . get ( domain = domain , site_code = user_input ) except self . model . DoesNotExist : return self . get ( domain = domain , name__iexact = user_input )