8,756
edits
mNo edit summary |
mNo edit summary |
||
Line 58: | Line 58: | ||
fields = field | fields = field | ||
args = { | if (string.find(field, "term", -4) ~= nil) then | ||
table = 'Genders' | |||
args = {where='Gender="' .. gender .. '" AND _pageName="Gender and Pronouns"', limit='1'} | |||
else | |||
table = 'Pronouns' | |||
args = { | |||
where='pronoun="' .. pronoun .. '" AND _pageName="Gender and Pronouns"', | where='pronoun="' .. pronoun .. '" AND _pageName="Gender and Pronouns"', | ||
limit='1' | limit='1' | ||
} | |||
local result= cargo.query( | end | ||
local result= cargo.query(table,fields,args) | |||
if not next(result) then | if not next(result) then | ||
return nil | return nil |