Difference between revisions of "Module:Sandbox/Tom Morris"

From blackwiki
Jump to navigation Jump to search
blackwiki>Tom Morris
(p26)
blackwiki>Tom Morris
(let's try again)
Line 1: Line 1:
 
local p = {}
 
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)
 
p.spouse = function(frame)
 
     local entity = mw.wikibase.getEntity()
 
     local entity = mw.wikibase.getEntity()
     return table.concat(p.getKeys(entity.claims.p26), ", ")
+
     return tostring(entity.claims.p26.mainsnak.datavalue.value["numeric-id"])
 
end
 
end
  
 
return p
 
return p

Revision as of 13:25, 19 May 2013

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

local p = {}

p.spouse = function(frame)
    local entity = mw.wikibase.getEntity()
    return tostring(entity.claims.p26.mainsnak.datavalue.value["numeric-id"])
end

return p