I am new to python and flask, trying learning by building a restful customer database, so this is in dataModels.py:
very plain:
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)
this is in views.py:
api.add_resource(CustomerList, '/customer')
I am getting a "AttributeError: type object 'CustomerList' has no attribute 'as_view'" error. What am I missing?
I appreciate the help.