Open Tambura opened 3 years ago
You'll have to expose to the root: @expose('/')
Hi,
I'm recently experiencing a similar error. WIth the understanding that the /
root has to be used...what would I use in the case were I needed the url to have a variable at the end. For example /<id>
?
Hi i have a similar issue or something in my approach is not right.. i will try to explain what i want to achieve and hopefully someone will be able to assist me in the right direction.
I want to create a navbar menu category, where in that category the dropdown content is all entries from a given table. For example
class MyCustomView(BaseView):
@expose
def index(self, "/"):
return self.render("my_index.html")
@expose
def show_entry_data(self, "/show_entry_data/<int:entry_id>"):
my_entry = Entry.query.filter_by(id=entry_id).first()
return self.render("show_entry_data.html, entry=my_entry)`
cars = Cars.query.all()
for car in cars:
admin.add_view(MyCustomView(name=car.name, category="Cars", url="/show_entry_data/{car.id}")
For some reason i fail to achieve what i want. Is this the proper way of doing it?
The view definition:
Add view:
Why I get the error: Attempted to instantiate admin view AdminTagView without default view