Get the languages configured for the current model

        :param model_label:
        :param app_label:
        :return:
181505
def get_languages_from_model(app_label, model_label):
        
        try:
            mod_lan = TransModelLanguage.objects.filter(model='{} - {}'.format(app_label, model_label)).get()
            languages = [lang.code for lang in mod_lan.languages.all()]
            return languages
        except TransModelLanguage.DoesNotExist:
            return []
1246424
function labels (modelName, callback) {

    if (callback) {
        return get(modelName, true).getLabels(callback);
    }

    return get(modelName, true).getLabels();

}
738993
def is_model_registered(app_label, model_name):
    
    try:
        apps.get_registered_model(app_label, model_name)
    except LookupError:
        return False
    else:
        return True
708537
def load_lang_model(self):
        
        if self.lang in self.languages:
            if not Spacy.model_installed(self.lang):
                download(self.lang)
            model = spacy.load(self.lang)
        elif self.lang in self.alpha_languages:
            language_module = importlib.import_module(f"spacy.lang.{self.lang}")
            language_method = getattr(language_module, self.alpha_languages[self.lang])
            model = language_method()
        self.model = model
781408
def site_models(self, app_label=None):
        
        site_models = {}
        app_configs = (
            django_apps.get_app_configs()
            if app_label is None
            else [django_apps.get_app_config(app_label)]
        )
        for app_config in app_configs:
            model_list = [
                model
                for model in app_config.get_models()
                if model._meta.label_lower in self.registry
            ]
            if model_list:
                model_list.sort(key=lambda m: m._meta.verbose_name)
                site_models.update({app_config.name: model_list})
        return site_models
582165
def resolve_labels(model_label):
    
    labels = {}

    # Resolve app label.
    labels['app'] = model_label.split('.')[0]

    # Resolve model label
    labels['model'] = model_label.split('.')[-1]

    # Resolve module_app_model label.
    labels['app_model'] = '%s.%s' % (labels['app'], labels['model'])

    return labels
214018
def supported_app_locales():
    
    locale = _get_locale()
    codes = current_app.config["BABEL_ACCEPT_LANGUAGES"]
    return ((Locale.parse(code), locale.languages.get(code, code)) for code in codes)
657659
def get_profile_model():
    
    user_profile_module = getattr(settings, 'USER_PROFILE_MODULE', None)
    if user_profile_module:
        app_label, model_name = user_profile_module.split('.')
        return get_model(app_label, model_name)
    else:
        return None
21810
def get_field(cls, model, opts, label, field):
    

    trans_model = model._meta.translation_model
    try:
        (f, lang_id) = trans_model._meta.translated_fields[field]
        return f
    except KeyError:
        # fall back to the old way -- see if model contains the field
        # directly
        pass

    try:
        return opts.get_field(field)
    except models.FieldDoesNotExist:
        raise ImproperlyConfigured("'%s.%s' refers to field '%s' that is " \
            "missing from model '%s'." \
            % (cls.__name__, label, field, model.__name__))
958503
def get_perm_model():
    
    try:
        return django_apps.get_model(settings.PERM_MODEL, require_ready=False)
    except ValueError:
        raise ImproperlyConfigured("PERM_MODEL must be of the form 'app_label.model_name'")
    except LookupError:
        raise ImproperlyConfigured(
            "PERM_MODEL refers to model '{}' that has not been installed".format(settings.PERM_MODEL)
        )
976355
def get_app_nodes(self, app_label):
        
        return [node for node in self.graph.nodes if node[0] == app_label]
274645
def get_profile_model():
    
    auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', None)
    profile_model = None
    if auth_profile_module:
        # get the profile model. TODO: super flacky, refactor
        app_label, model = auth_profile_module.split('.')
        profile_model = getattr(__import__("%s.models" % app_label, \
                globals(), locals(), [model, ], -1), model, None)

    return profile_model
77533
def supported_languages(self, task=None):
    
    if task:
      collection = self.get_collection(task=task)
      return [isoLangs[x.id.split('.')[1]]["name"]
                                         for x in collection.packages]
    else:
      return [x.name.split()[0] for x in self.collections()
                                         if Downloader.LANG_PREFIX in x.id]
578252
def field_pklist_to_json(self, model, pks):
        
        app_label = model._meta.app_label
        model_name = model._meta.model_name
        return {
            'app': app_label,
            'model': model_name,
            'pks': list(pks),
        }
649191
def get_model(model):
    
    try:
        if isinstance(model, str):
            app_label, model_name = model.split('.', 1)
            m = loading.get_model(app_label, model_name)
            if not m:  # pragma: no cover
                raise LookupError()  # Django < 1.7 just returns None
            return m
        elif issubclass(model, models.Model):
            return model
    except (LookupError, ValueError):
        pass
    raise ValueError(model)
803229
def get_app_content_types(self):
        
        # Import this here to silence RemovedInDjango19Warning. See #15
        from django.contrib.contenttypes.models import ContentType

        return [ContentType.objects.get_for_model(c) for c
                in self.get_app_model_classes()]
1218000
def get_premises_model():
    
    try:
        app_label, model_name = PREMISES_MODEL.split('.')
    except ValueError:
        raise ImproperlyConfigured("OPENINGHOURS_PREMISES_MODEL must be of the"
                                   " form 'app_label.model_name'")
    premises_model = get_model(app_label=app_label, model_name=model_name)
    if premises_model is None:
        raise ImproperlyConfigured("OPENINGHOURS_PREMISES_MODEL refers to"
                                   " model '%s' that has not been installed"
                                   % PREMISES_MODEL)
    return premises_model