Skip to content
Advertisement

Can’t Query and iterate through database

I am trying to filter only the rows that have the foreign id of 1 or in this case ‘Skincare’ I have tried both, but no matter what combo I try it either applies no filter, nothing at all shows up, or I get an error that it is not iterable. I want

JavaScript
JavaScript
JavaScript

Advertisement

Answer

I’m not sure what is going on, it does not actually seem to matter if the id is a string or an int. Something like this should work.

JavaScript

Here we iterate over the list of model objects and use the model to populate the template.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement