私はPythonとフラスコが初めてで、安らかな顧客データベースを構築して学習しようとしているので、これはdataModels.pyにあります:
非常にわかりやすい:
class Customer(object):
def __init__(self, pID, name, address, email, custNO, agent ):
self.pID = pID
self.name = name
self.address =address
self.email = email
self.custNO = custNO
self.agent = agent
class CustomerList(list):
def addCustomer(self, pID, name, address, email, custNO, agent):
self.append((false, pID, name, address, email, custNO, agent))
def custCount(self):
return len (self)
これはviews.pyにあります:
api.add_resource(CustomerList, '/customer')
「AttributeError: type object 'CustomerList' has no attribute 'as_view'」というエラーが表示されます。私は何が欠けていますか?
助けてくれてありがとう。