ここに問題があります。これは私のdjangoビューです
def home(request):
try:
from_number = request.GET['from_number']
to_number = request.GET['to_number']
messagetext = request.GET['msg_text']
date_time = request.GET['date_time']
date_received = request.GET['date_received']
status = 0
except:
LOG_ERROR('Invalid Parameter')
#Return to some product page or 500 error with message
#pass # return some value after discussing with sir
# #Based on from number identify the Vmn and his class anc class the respective receieve method of that class
if from_number !=None and to_number != None:
try:getvmn = ServiceProvider.objects.get(status = False)
except:
LOG_FATAL("VMN doesn't exists ")
getvmn = False
if getvmn:
print "-=-=-=-=-==-=-=-==================="
# get_related_class = ServiceProvider.objects.filter(id = getvmn.merchant,status = False)
get_related_class = ServiceProvider.objects.get(status = False)
b = SMSMgr()
for objec in b._allsp:
if objec.class_Name == 'MessageNet':
# messageglobalobject =
MessageNet.receive(MessageGlobal(from_number,to_number,messagetext,date_received,status))
ここにsmsmessage.pyがあります
class MessageGlobal():
def __init__(self,from_number,to_number,messagetext,date,status = None):
self.messagetext = messagetext
self.to_number = to_number
self.from_number = from_number
self.date = date
self.status = status
ここに MessageNet クラスがあります
class MessageNet():
def __init__(self,username,password,sendingurl,class_Name):
self.username = username
self.password = password
self.messagetext = None
self.sendingurl = sendingurl
self.class_Name = class_Name
self.PhoneNumber = None
# self.apiurl = apiurl
def send(self,mg):
payload = {'username': self.username, 'Pwd': self.password,'PhoneNumber':mg.tonumber,'PhoneMessage':mg.messagetext}
r = requests.get(self.sendingurl, params=payload)
LOG_INFO("Message sent to %s via %s", self.PhoneNumber,'Messagenet')
# Call to ms manager
def receive(self,getmessageobject):
print "receive and notify the user "
エラーが発生しています
MessageNet.receive(MessageGlobal(from_number,to_number,messagetext,date_received,status))
of my views .
MessageGlobal のオブジェクトを receive メソッドに渡して、MessageNet クラスの receive メソッド内でアクセスできるようにしようとしています。
ai がこのエラーを受け取る理由を教えてください。