python - 'module' object is not callable typeerror django -
so have module use. added file module , gives me error.
i have file generate_bags_uk
has method:
def generate_bags(bags, price):
and use this:
from excelgenerator import generate_bags_uk ... uk_bag = generate_bags_uk.generate_bags(tshirts, form.cleaned_data['price_uk_bag'])
and typeerror: module not callable. doing wrong here ?
try following code instead -
from excelgenerator.generate_bags_uk import generate_bags ... uk_bag = generate_bags(tshirts, form.cleaned_data['price_uk_bag'])
and make sure excelgenerator
folder has __init__.py
inside it, otherwise not dealt python package.
also, guess method has body, if not @ least give definition -
def generate_bags(bags, price): pass
comment : looks of error, error happening in file /home/marijus/workspace/tshirtnation/excelgenerator/generate_bags_uk.py
. think other calls of similar format , causing error. please change them mentioned. problem should solved.
Comments
Post a Comment