Jump to content

Module:Sandbox/Tom Morris

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tom Morris (talk | contribs) at 13:22, 19 May 2013 (p26). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}

p.getKeys = function(tbl)
    local keyset = {}
    local n = 0
    for k,v in pairs(tbl) do
        n = n + 1
        keyset[n] = k
    end
    return keyset
end

p.spouse = function(frame)
    local entity = mw.wikibase.getEntity()
    return table.concat(p.getKeys(entity.claims.p26), ", ")
end

return p