API Constructor

Report a typo

Sort the code in the right way to get a working program:

Put the items in the correct order
class ArgResourceDao(object):
    def __init__(self, name, value):
        self.name = name
        self.value = value
arg_fields = {'name': fields.String, 'value': fields.String}
class ArgResource(Resource):
    @marshal_with(arg_fields)
    def __init__(self, **kwargs):
        return ArgResourceDao(**kwargs)
app = Flask('main')
api = Api(app)
from flask import Flask
from flask_restful import fields, marshal_with, Api, Resource
app.run()
___

Create a free account to access the full topic