I have a class-based Admin view:
class All_RDPs(BaseView):
@expose('/')
def index(self):
return 'ok1'
@expose('/test')
def testindex(self):
return 'ok2'
which is registered with Flask-Admin like so:
admin.add_view(All_RDPs(name='dep_rdp'))
and then is viewable from the browser like so:
http://localhost/admin/all_rdps/
http://localhost/admin/all_rdps/test
the question is:
- how do I specify the URL for this class instead of the default generated name
all_rdps
? - how do I use
url_for
to generate urls for these endpoints?url_for('admin.All_RDPs.testindex')
,url_for('admin.All_RDPs')
don't work.