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 7498303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:25:40+00:00 2026-05-29T19:25:40+00:00

Weirdly, it has worked before and now it doesn’t: getting the following error: Exception

  • 0

Weirdly, it has worked before and now it doesn’t:

getting the following error:

Exception Value:    
'module' object is not callable
Exception Location: C:\work\Portman\core\models\pmo_review_task.py in save, line 38

if I change “from core.models import sc_review_task” to “from core.models import *” the error message will change to “global name sc_review_task is not defined.”

if I run django admin and do:
from core.models import sc_review_task
a = sc_review_task()

it all looks ok – no error messages.

please help me figure this out, I’m loosing hair 🙂

pmo_review_task (line 38 is “newtask = sc_review_task()”):

# -*- coding: utf-8 -*-
from django.db import models
from datetime import datetime
from django.contrib.auth.models import User
from core.models import sc_review_task

class pmo_review_task(models.Model):
    project_phase_to_review = models.ForeignKey('project_phase')
    creation_date = models.DateTimeField(default=datetime.now())
    is_closed = models.BooleanField(default=False,null=False)
    review_date = models.DateTimeField(null=True,blank=True)
    review_comment = models.TextField(null=True, blank=True)
    reviewed_by = models.ForeignKey(User, null=True, blank=True)
    is_review_result_ok = models.NullBooleanField(null=True)
    scheduled_sc = models.ForeignKey('sc_event', null=True, blank=True)
    review_goal = models.ForeignKey('phases')

    def __unicode__(self):
        return self.project_phase_to_review.project.name

    def save(self, *args, **kwargs):

        if self.is_closed and self.is_review_result_ok and self.scheduled_sc is None:
            raise models.ImproperlyConfigured

        if self.is_closed and self.is_review_result_ok is False:
            self.project_phase_to_review.is_finished = False
            self.project_phase_to_review.is_approved_for_sc = False
            self.project_phase_to_review.save()

        if self.is_closed and self.is_review_result_ok and self.scheduled_sc:
            if self.scheduled_sc.has_taken_place is True:
                raise Exception("Cannot assign a task to a SC event that has taken place")
            #update reviewed project to indicate it has been saved
            self.project_phase_to_review.is_approved_for_sc = True
            self.project_phase_to_review.save()
            #create sc_review_talk
            newtask = sc_review_task()
            newtask.project_phase_to_review = self.project_phase_to_review
            newtask.sc_event_to_review_at = self.scheduled_sc
            newtask.review_goal = self.review_goal
            newtask.is_closed = False
            newtask.save()
            #call real save operation
        super(pmo_review_task,self).save(*args, **kwargs)

    class Meta:
        app_label = 'core'

sc_review_task:

# -*- coding: utf-8 -*-
from django.db import models
from core.models import project_phase

class sc_review_task(models.Model):
    sc_event_to_review_at = models.ForeignKey('sc_event', null=False)
    project_phase_to_review = models.ForeignKey('project_phase', null=False)
    review_goal = models.ForeignKey('phases',related_name="target_review_goal")
    is_closed = models.BooleanField(default=False)
    review_decision_phase = models.ForeignKey('phases', null=True, blank=True,related_name="sc_decided_phase")
    review_decision_comment = models.TextField(null=True, blank=True)

    def __unicode__(self):
        return self.project_phase_to_review.project

    def save(self, *args, **kwargs):
        super(sc_review_task,self).save(*args, **kwargs)
        if self.is_closed and self.project_phase_to_review.phase == self.review_decision_phase:
            self.project_phase_to_review.is_approved_for_sc = False
            self.project_phase_to_review.is_finished = False
            self.project_phase_to_review.is_closed = False
            self.project_phase_to_review.save()
        elif self.is_closed:
            self.project_phase_to_review.is_closed = True
            self.project_phase_to_review.save()
            new_phase = project_phase()
            new_phase.project = self.project_phase_to_review.project
            new_phase.phase = self.review_decision_phase
            new_phase.save()

    class Meta:
        app_label = 'core'

each of the classes sits in its own file within /models/ and here is the init.py:

from divisions import divisions
from django.db import models
from groups import groups
from phases import phases
from pmo_review_task import pmo_review_task
from priorities import priorities
from progress_indicator import progress_indicator
from project import project
from project_imported_from_excel import project_imported_from_excel
from project_phase import project_phase
from project_phase_history import project_phase_history
from project_status_submit_form import project_status_submit_form
from roles import roles
from sc_event import sc_event
from sc_review_task import sc_review_task
from milestone import milestone
from milestone import milestone_history


__all__ = ['divisions',
           'groups',
           'phases',
           'pmo_review_task',
           'priorities',
           'progress_indicator',
           'project',
           'project_imported_from_excel',
           'project_phase',
           'project_phase_history',
           'project_status_submit_form',
           'roles',
           'sc_event',
           'sc_review_task',
           'milestone',
           'milestone_history']
  • 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-29T19:25:41+00:00Added an answer on May 29, 2026 at 7:25 pm

    Check your namespaces…

    in pmo_review_task (line 38 is “newtask = sc_review_task()”) it should be newtask=sc_review_task.sc_review_task()

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

Sidebar

Related Questions

Weirdly, I've never come across this issue before, but I've just started making a
I have the following code that, weirdly, works for a couple of seconds and
Weirdly, the index page of my Magento commerce is very slow. While you navigate
I have this weirdly formatted URL. I have to extract the contents in '()'.
Below is code for UITableView , But when i scroll its behaves weirdly (too
I have an app which has a UITabBarController, and when different tabs are pressed,
If a would-be-HTTP-server written in Python2.6 has local access to a file, what would
I have a resources web app, which only has static content, such as images,
I want to be able to modify Object dynamically by adding / removing properties
I'm coding some iPad application, and a strange effect has started to appear. I

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.