ladon-dev-team team mailing list archive
-
ladon-dev-team team
-
Mailing list archive
-
Message #00163
[Question #243850]: ImportError: No module named
New question #243850 on ladon:
https://answers.launchpad.net/ladon/+question/243850
Hi,
I'm building a webservice with ladon that returns a list of objects.
Under the code of ladon:
#coding: utf-8
from ladon.ladonizer import ladonize
from ladon.types.ladontype import LadonType
from ladon.compat import PORTABLE_STRING
from DAO.ScheduleDAO import ScheduleDAO
class Schedule(LadonType):
id = int
propertiesId = int
realtorId = int
customerId = int
comments = unicode
class UserService(object):
@ladonize(PORTABLE_STRING,rtype=[Schedule])
def sendShedule(self,realtorId):
try:
scheduleList = []
schedules = ScheduleDAO().selectScheduleRealtor(realtorId)
for schedule in schedules:
scheduleUnit = Schedule()
scheduleUnit.id = schedule.id
scheduleUnit.propertiesId = schedule.propertiesId
scheduleUnit.realtorId = schedule.realtorId
scheduleUnit.customerId = schedule.customerId
scheduleUnit.comments = schedule.comments
scheduleList.append(scheduleUnit)
del scheduleUnit
return scheduleList
except:
print 'Erro ScheduleWs '
The extrutura my program will the following:
www
├── Business
│ └── Schedule.pyc
├── DAO
│ ├── __init__.py
│ └── ScheduleDAO.py
└── WS
├── handler.py
├── __init__.py
└── ScheduleWS.py
When running the WS (http://54.207.37.29/ws) the following error appears:
ImportError: No module named DAO.ScheduleDAO
The DAO.ScheduleDAO module, as the name implies, is part of a package in which I perform the query on the database and return the arraylist of objects.
Have recreated several times a DAO class as well as the WS itself but nothing worked.
I would like your help for my case.
I looked on the internet, the scarce listed here and nothing is like mine!
Thank you!
--
You received this question notification because you are a member of
Ladon Developer, which is an answer contact for ladon.