1

i saw a question here

i wonder why i need to use get_model ?

i think we can use like this

from my_project.my_app.models import model_name

def gen(): 
      objects = model_name.objects.all()
      for object in objects:
          object.model_type = Null      (Or some activity)
          object.save()

is there has different?(performence or etc..) if this way have some problem please tell me some advice for me.

thank you :)

Jade Han
  • 1,185
  • 5
  • 15
  • 36
  • because we need avoid to circular imports [see here](https://stackoverflow.com/questions/4379042/django-circular-model-import-issue) – Jade Han Feb 22 '21 at 01:52

0 Answers0