Skip to content

Instantly share code, notes, and snippets.

@SurendraTamang
Created January 2, 2021 13:17
Show Gist options
  • Save SurendraTamang/94ad929b9141d2bd789a8eecf590b060 to your computer and use it in GitHub Desktop.
Save SurendraTamang/94ad929b9141d2bd789a8eecf590b060 to your computer and use it in GitHub Desktop.
# Most of the time we need query the Model we dynamically we can do it by using
from django.apps import apps
# Suppose we have the Class Model of Keyword in the app as app
# app_name and model_name will be two parameters that is needed to be passed!
instance_keyword = apps.get_model('app','keyword')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment