This week I finished “dependent fields” part of the project. This was a very simple task. What dependent fields mean is that each filter can have one or more than one fields on which they depend (i.e. these filters will not be shown on the Special:Drilldown Page until all the filters on which it depends, have been applied). To declare a dependent field/filter in Cargo, you can add something like:
|field_1 = field description 1 ( dependent on = fields; )
to #cargo_declare. And That’s it, after that, whenever you go to Special:Drilldown page of the corresponding table, field_1 will not be displayed until you apply all the fields/filters which have been added to its “dependent on” parameter.
Its uses are pretty clear and can be seen in many forms and stuff.For instance, If a table is declared in the following manner :
|State=String (dependent on=Country)
|Cities=List (,) of String (dependent on=State)
then on Special:Drilldown page of Cities table, ‘State’ filter won’t show up until a ‘Country’ value is selected and ‘Cities’ filter won’t show up until a ‘State’ value is selected.
After finishing this, I started with “parent tables” part of my project. I assume this will be the toughest (not trickiest but still toughest) part of the project.
Let me explain it to you in simple terms:
Let’s say we have two tables: Books and Authors. And while declaring the table Books, Authors table has been declared as parent table. Then, in Special:Drilldown of the `Books` tables, not only filters for just `Books` table, but also the filters for the `Authors` table will be shown such that search for a book can include not just fields directly related to the `Books` table, like its genre and language, but also fields for its parent table (`Authors`), like the nationality of its author.
About its implementations, what I have thought yet is that by applying nested joins conditions, I may be able to do it but there may be more complications which I may not have foreseen.
For this task, I had to learn SQL, and it was fun.
Thanks for reading…