Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:18:55+00:00 2026-05-29T22:18:55+00:00

I have a model project_phase : from django.db import models from django.utils import simplejson

  • 0

I have a model project_phase:

    from django.db import models
    from django.utils import simplejson
    from core.models import pmo_review_task

it references pmo_review_task (because it creates a pmo_review_task in its save ovewrite)

from django.db import models
from datetime import datetime
from django.contrib.auth.models import User
from core.models import sc_review_task

which references sc_review_task that references project_phase (because it creates a project_phase in its save ovewrite)

from django.db import models
from core.models import project_phase

so it ends up project_phase imports pmo_review_task imports sc_review_task imports project_phase and I guess it loops up somehow generating this error:

Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x010ACFB0>>
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 88, in inner_run
    self.validate(display_num_errors=True)
  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "C:\Python27\lib\site-packages\django\core\management\validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 146, in get_app_errors
    self._populate()
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 64, in _populate
    self.load_app(app_name)
  File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
    __import__(name)
  File "C:\work\Portman\core\models\__init__.py", line 4, in <module>
    from pmo_review_task import pmo_review_task
  File "C:\work\Portman\core\models\pmo_review_task.py", line 5, in <module>
    from core.models import sc_review_task
  File "C:\work\Portman\core\models\sc_review_task.py", line 3, in <module>
    from core.models import project_phase
  File "C:\work\Portman\core\models\project_phase.py", line 4, in <module>
    from core.models import pmo_review_task
ImportError: cannot import name pmo_review_task

how do I overcome this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:18:57+00:00Added an answer on May 29, 2026 at 10:18 pm

    Two ways:

    1. To import a model inside a method (as @YujiTomita suggested).
    2. To use get_model function from django.db.models which is designed for lazy model imports.:

      project_phase = get_model('core', 'project_phase')
      

    I prefer the second one, but both methods are ok.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have worked a bit with Django and I quite like its project/applications model
I have a django model as following class Project(models.Model) name=models.CharField(max_length=200) class Application(models.Model) proj=models.ForeignKey(Project, null=True,
I have a Project model similar to: class Project(models.Model): ... lead_analyst=models.ForeignKey(User, related_name='lead_analyst') ... I
I have a model: class Cost(models.Model): project = models.ForeignKey(Project) cost = models.FloatField() date =
I have the following model and it's form: class Project(models.Model) class ProjectForm(forms.ModelForm) class Meta:
I have two Django model classes that are structured similar to the following: class
I have a Project model and it has some text attributes, one is summary.
Let's say I have a model class called Project, but instead of this: class
I have an existing model for my project. I would like to switch to
I have a project which exposes object model to use by different types of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.