Hello! First, thank you for your time. I am working with a database full of classes (like school work) and I'm trying to display a certain type of class that has been categorized. Each row in my database is basically a class. There are a number of columns, but specifically; I have set 3 categories and I would like to display all the classes in the category "Practice Advancement."
However, you can tell the list is crazy-long. So, long-story-long, I tried to filter out the classes by adding a filter to the loop:
{% for row in hubdb_table_rows(2033946) %}
The above works (I promise). The below does not:
{% for row in hubdb_table_rows(2033946, 'session_category__contains=Practice Advancement') %}
By swapping out the line above, I break the loop and the page will not display much at all. Can anyone help me with the filter I applied, I used the documentation and noticed I could use "__contains" or "__eq" . . . neither work. "Practice Advancement" might be the issue, but I don't know why as I'm following the direction from the video.
Ok, going back to the documentation didn't help. You were very close actually. I went back and removed the loop surrounding the for-loop. And in doing so I also (purposefully) threw an error in. The text editor found the error and displayed it. So I went through and troubleshot with the error and eventually came to this conclusion:
{% for row in hubdb_table_rows(2033946, 'session_category=1') %}
Which does not work with the "?" or any of the filters supplied in documentations (operators). So, you and I fixed this, but there are problems with HubL in my opinon.
Thank you so much Bryan! I'm going to mark your comment as solution as it did lead to my fix.
Something like this should work for you, note that you'll want to add the ? mark at the start of the queryparm call and you'll want to use the HubDB Column Name. You'll want to confirm what this is by going into the Hub DB, clicking on the column heading and going to edit and it will show you the column name there, copy that and replace HUBDB-COL-NAME and you should be set!
{% for row in hubdb_table_rows(2033946, '?HUBDB-COL-NAME=Practice Advancement') %}
-- Bryan Schneidewind Manager of Web Development Weidert Group
Hello Bryan and thank you for the attempt. I was unable to fix the module with that suggestion. Here is the code I used per your input (both lines are attempts - neither worked) :
{% for row in hubdb_table_rows(2033946, '?session_category__contains=Practice Advancement') %}
{% for row in hubdb_table_rows(2033946, '?session_category=Practice Advancement') %}
Also, here is the setting for the COL in the database:
Didn't move the needle Bryan but I love the support so thank you!
I'm going to go through the list and trial-n-error this sonofgun so help me. I'll keep you updated. I'm going to try every option twice from this list:
Ok, going back to the documentation didn't help. You were very close actually. I went back and removed the loop surrounding the for-loop. And in doing so I also (purposefully) threw an error in. The text editor found the error and displayed it. So I went through and troubleshot with the error and eventually came to this conclusion:
{% for row in hubdb_table_rows(2033946, 'session_category=1') %}
Which does not work with the "?" or any of the filters supplied in documentations (operators). So, you and I fixed this, but there are problems with HubL in my opinon.
Thank you so much Bryan! I'm going to mark your comment as solution as it did lead to my fix.