Module:SOM.DateBounded.HasName

From SunshinePPS Wiki

This module defines the composite attribute class SOM.DateBounded.HasName.

Representation of a date-bounded name for an entity


ask()
Undocumented
attach()
Undocumented
basic_current_first_table_args()
Undocumented
decode_and_attach()
Undocumented
fetch_all()
Undocumented
form_entry(embed in, hide, add button)
Generate a Page Forms form entry template
arguments:
embed in : the TEMPLATE[FIELD] in which this entry should be embedded
hide : (optional) key of a field to be omitted from the form
add button : text label for the button which adds a new entry
form_field()
Undocumented
instance_template()
Undocumented
is_composite()
Undocumented
render_current()
Undocumented
render_current_instance()
Undocumented
render_table()
Undocumented
render_table_and_references()
Undocumented
require_current(instances)
From a list of instances, select those that are marked current.If there are none, set SOM/Has missing current attribute.
arguments:
instances : (table of tables) instances to scan
select_current(instances)
From a list of instances, select those that are marked current.
arguments:
instances : (table of tables) instances to scan

(/doc page)


--local dbp = require("Module:SOM.meta.DateBoundedProperty")
--
--return dbp.generate_atomic({
--	class_name = "SOM.DateBounded.HasName",
--	property_root = "Has name",
--	value_arg = "name",
--	value_lua_type = "string",
--	value_label = "Name",
--	value_input_type = "text",
--	attribute_label = "Name",
--	instance_template = "SOM.DateBounded.HasName/Instance",
--	docstring = [[
--Representation of a date-bounded name for an entity.]]
--	})

local DBA = require("Module:SOM.meta.DateBoundedAttribute")
local util = require("Module:SOM.util")

return DBA.generate_composite{
	class_name = "SOM.DateBounded.HasName",
	elements = {
		name = {
			smw = {
				property = "Has name",
			},
			field = {
				label = "Name",
				input_type = "text",
			}
		}
	},
	form_layout = { 
		util.list_join(nil, { "name" }, DBA.DATEBOUNDS_FORM_ROW),
	},
	title_key = "name",
	docstring = "Representation of a date-bounded name for an entity"
}