Addind imports to a class namespace

Ryan K ryankaskel at
Sat Jul 11 13:56:48 EDT 2009

Okay so below is the acutal code. I am starting to think there is no
reason why I can't install the post_save signal in itself
and thereby avoid this issue entirely.

class Link(CommonAbstractModel):

class Menu(CommonAbstractModel):

class StaticPage(CommonAbstractModel):

class CachedMenuXhtml(CommonAbstractModel):

post_save.connect(signals.build_menu, sender=Link)
post_save.connect(signals.build_menu, sender=Menu)


# Signlas for caching of menu XHTML

class GenerateMenuXhtml(threading.Thread):

    def __init__(self, instance):
        from asqcom.apps.staticpages.models import Menu, Link,
        self.Link = Link
        self.Menu = Menu
        self.CachedMenuXhtml = CachedMenuXhtml

# Function to run on post_save signal
def build_menu(sender, instance, **kwargs):

More information about the Python-list mailing list