Good Day!
Where are we going to put this code "CategoriesController.index(*args, **kwargs)" ??
It is not that clear for me but I want to display all of the categories.
Please help me.
Search Forums
2 posts Started 10 years ago by Chalie Delligos Latest reply from Felix Schwarz
Good Day!
Where are we going to put this code "CategoriesController.index(*args, **kwargs)" ??
It is not that clear for me but I want to display all of the categories.
Please help me.
Not sure why you want to use "CategoriesController.index(...)". That is a controller method so it is not intended to be used somewhere else. Do you refer to the JSON API ("Querying Categories")? In that case submit a HTTP request to "/api/categories?api_key=...".
If you want to have a list of categories just in the code, you should build the appropriate SQLAlchemy query like Category.query.filter(...)
.
You must log in to post.