'Returns the model matching the given app_label and case-insensitive
model_name.
Returns None if no model is found.
Raises UnavailableApp when set_available_apps() in in effect and
doesn\'t include app_label.'

def get_model(self, app_label, model_name, seed_cache=True, only_installed=True):

    if seed_cache:
        self._populate()
    if (only_installed and (app_label not in self.app_labels)):
        return None
    if ((self.available_apps is not None) and only_installed and (app_label not in self.available_apps)):
        raise UnavailableApp(("App    with    label    %s    isn't    available." % app_label))
    try:
        return self.app_models[app_label][model_name.lower()]
    except KeyError:
        return None
