I want to use imports inside a class that is then inherited by another class so that I don't have to manually define my imports in each file. I am trying it like this but its not working, any advice is appreciated:
class Djangoimports ():
def __init__(self):
from django.template import Context
print Context
class Init1 (Djangoimports):
def __init__(self):
Djangoimports.__init__(self)
self.c = Context(self.constructor_dict) # just example of trying to use the imported "Context"
>>>>> global name 'Context' is not defined
I have tried variations of trying to use "self" but can't figure out how to appropriately use this with the import from as its not the same as a class attribute / method where I normally use 'self'