Module:BuildList

local p = {} local cargo = mw.ext.cargo

function p.main local qArgs = { where = "NOT Type= 'Test'", orderBy = "Type", limit = 5000, }

local lolis = cargo.query("loliInfo","Type, SubType",qArgs)

--create list of Types local types = {} local hash = {} for i,table in ipairs(lolis) do       local type = lolis[i]["Type"] if (not hash[type]) then types[#types+1] = type hash[type] = true end end

local subTypes = {} local hash = {} for i,type in ipairs(types) do       mw.log(type) for n,loli in ipairs(lolis) do           if (loli["Type"] == type) then mw.log(loli["SubType"]) end end

end mw.logObject(subTypeTable)

--create header and add subtypes

return

end return p