Module:Sandbox/Tom Morris

From blackwiki
< Module:Sandbox
Revision as of 13:22, 19 May 2013 by blackwiki>Tom Morris (p26)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Sandbox/Tom Morris/doc

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