Schema Specifications

The following attributes can be used in an Idea file in which will be accepted and processed in a Stackpress project.

1. Model Attributes

The following attributes can be applied to models and types defined in an Idea file. These attributes are used to describe the model and how it should be represented in the admin interface.
Copy
Attribute
Description
Attributes
Example
An icon representation of a model. Uses font awesome names. 
Used to describe each row in a model 
A friendly name that represents the model 
A flag that represents the active field. Active fields are changed when deleting or restoring a row, as an alternative to actually deleting the row in the database.  
The default value applied when creating a row if no value was provided. 






A flag that represents that the value of this column is generated, bypassing the need to be validated  
A flag that represents the models identifier. If multiple ids then the combination will be used to determine each rows uniqueness.  
A flag deonoting this column is searchable and will be considered in a search field for example. Also used to know which columns need to be optimized in the database.  
A flag deonoting this column is sortable. Also used to know which columns need to be optimized in the database.  
A label that will be shown to represent this column instead of the actual column name. 
The minimum number value that will be accepted. This is also a consideration when determining the database type. 
The maximum number value that will be accepted. This is also a consideration when determining the database type. 
The incremental amount value that will be used when changing the columns value. This is also a consideration when determining the database type. 
Maps columns in the model that is related to another model.local: string
foreign: string
name?: string


A flag that ensures no duplicate value can be added to the model  
A flag that will automatically update the timestamp whenever a row is changed.  

2. Validation Attributes

The following validation attributes can be applied to model and type columns defined in an Idea file. These attributes are used validate form submissions (create and update).
Copy
Attribute
Description
Example
Validates that a value must be given before being inserted. 
Validates that a value is something as opposed to an empty string. 
Validates that the value is explicitly equal to the given argument
Validates that the value is explicitly not equal to the given argument
Validates that the value is one of the given options
Validates that the value matches the given regular expression
Validates that the value is a date 
Validates that the value is a future date 
Validates that the value is a past date 
Validates that the value is the present date 
Validate that the value is greater than the given number
Validate that the value is greater than or equal to the given number
Validate that the value is less than the given number
Validate that the value is less than or equal to the given number
Validate that the character count of the value is equal to the given number
Validate that the character count of the value is greater than or equal to the given number
Validate that the character count of the value is less than the given number
Validate that the character count of the value is less than or equal to the given number
Validate that the character count of the value is less than or equal to the given number
Validate that the word count of the value is equal to the given number
Validate that the word count of the value is greater than or equal to the given number
Validate that the word count of the value is less than the given number
Validate that the word count of the value is less than or equal to the given number
Validate that the word count of the value is less than or equal to the given number
Validates that the value is a credit card 
Validates that the value is a color value (color name or hex) 
Validates that the value is an email 
Validates that the value is a hexidecimal 
Validates that the value is a price number (ie. 2 decimal numbers) 
Validates that the value is a URL 
Validates that the value is a boolean 
Validates that the value is a number format 
Validates that the value is a float format 
Validates that the value is an integer format 
Validates that the value is an object 

3. Field Attributes

The following field attributes can be applied to a model and type columns defined in an Idea file. These attributes are used to describe how the column should be represented in a form (create and update). Logically, only one field attribute should be used per column.
Copy
Attribute
Description
Attributes
Example
Use a color field to represent this column in a form  
Use a checkbox to represent this column in a formlabel: string
check: boolean
circle: boolean
square: boolean
rounded: boolean
blue: boolean
orange: boolean

Use a country dropdown to represent this column in a formplaceholder: string
Use a currency dropdown to represent this column in a formplaceholder: string
Use a date field to represent this column in a form  
Use a date time field to represent this column in a form  
Use a code editor to represent this column in a formlang: html|md|css|js|ts
numbers: boolean

Use a file input to represent this column in a form  
Use a file list fieldset to represent this column in a form  
Use an input field to represent this column in a form  
Use a markdown editor to represent this column in a formnumbers: boolean
Use an input mask to represent this column in a formmask: string
Use a key value fieldset to represent this column in a form  
Uses a number field to represent this column in a formmin: number
max: number
step: number
separator: string
decimal: string
absolute: boolean

Uses a password field to represent this column in a form  
Uses a range field to represent this column in a formmin: number
max: number
step: number
width: number

Uses a rating field to represent this column in a formmax: number
Uses a select dropdown to represent this column in a formplaceholder: string
Uses an input field that transforms the value into a slug to represent this column in a form  
Uses a switch toggle to represent this column in a formrounded: boolean
onoff: boolean
yesno: boolean
checkex: boolean
sunmoon: boolean
ridge: boolean
smooth: boolean
blue: boolean
orange: boolean
green: boolean

Uses a textarea field to represent this column in a formrows: number
Uses a tag field to represent this column in a form  
Uses a text list fieldset to represent this column in a form  
Uses a time field to represent this column in a form  
Uses a WYSIWYG to represent this column in a formhistory: boolean
font: boolean
size: boolean
format: boolean
paragraph: boolean
blockquote: boolean
style: boolean
color: boolean
highlight: boolean
text: boolean
remove: boolean
indent: boolean
align: boolean
rule: boolean
list: boolean
lineheight: boolean
table: boolean
link: boolean
image: boolean
video: boolean
audio: boolean
fullscreen: boolean
showblocks: boolean
code: boolean
dir: boolean

4. Filter Attributes

The following filter attributes can be applied to model columns defined in an Idea file. These attributes are used to describe how the column should be represented in a search filter form. Logically, only one filter attribute should be used per column.
Copy
Attribute
Description
Attributes
Example
Use a color field to represent this column in a filter form  
Use a checkbox to represent this column in a filter formlabel: string
check: boolean
circle: boolean
square: boolean
rounded: boolean
blue: boolean
orange: boolean

Use a country dropdown to represent this column in a filter formplaceholder: string
Use a currency dropdown to represent this column in a filter formplaceholder: string
Use a date field to represent this column in a filter form  
Use a date time field to represent this column in a filter form  
Use a file input to represent this column in a filter form  
Use an input field to represent this column in a filter form  
Use an input mask to represent this column in a filter formmask: string
Uses a number field to represent this column in a filter formmin: number
max: number
step: number
separator: string
decimal: string
absolute: boolean

Uses a password field to represent this column in a filter form  
Uses a range field to represent this column in a filter formmin: number
max: number
step: number
width: number

Uses a rating field to represent this column in a filter formmax: number
Uses a select dropdown to represent this column in a filter formplaceholder: string
Uses an input field that transforms the value into a slug to represent this column in a filter form  
Uses a switch toggle to represent this column in a filter formrounded: boolean
onoff: boolean
yesno: boolean
checkex: boolean
sunmoon: boolean
ridge: boolean
smooth: boolean
blue: boolean
orange: boolean
green: boolean

Uses a time field to represent this column in a filter form  

5. Span Attributes

The following span attributes can be applied to model columns defined in an Idea file. These attributes are used to describe how the column should be represented in a search filter form. Spans are field that represent a range(from and to). This is good for numbers and dates. Logically, only one span attribute should be used per column.
Attribute
Description
Attributes
Example
Use a pair of date fields as a span to represent this column in a filter form  
Use a pair of date time fields as a span to represent this column in a filter form  
Use a pair of input fields as a span to represent this column in a filter form  
Use a pair of number fields as a span to represent this column in a filter formmin: number
max: number
step: number
separator: string
decimal: string
absolute: boolean

Use a range field as a span to represent this column in a filter formmin: number
max: number
step: number
width: number

Use a pair of rating fields as a span to represent this column in a filter formmax: number
Use a pair of select dropdowns as a span to represent this column in a filter formplaceholder: string
Use a pair of time fields as a span to represent this column in a filter form  

6. List Attributes

The following list format fields can be applied to model columns defined in an Idea file. These attributes are used to describe how the column should be represented in a formatted list of results (ie. table, search results page). Logically, only one list attribute should be used per column.
Copy
Attribute
Description
Attributes
Example
Hides this column in a formatted list of results  
Uses a code format to represent this column in a formatted list of resultslang: string
numbers: boolean
inline: boolean
trim: boolean
ltrim: boolean
rtrim: boolean

Uses a code color to represent this column in a formatted list of resultsbox: boolean
text: boolean

Uses a country format to represent this column in a formatted list of resultsflag: boolean
text: boolean

Uses a currency format to represent this column in a formatted list of resultsflag: boolean
text: boolean

Uses a date format to represent this column in a formatted list of resultslocale: string
format: string

Uses an email format to represent this column in a formatted list of results  
Outputs the value of the given formula in a formatted list of resultsformula: string
data: object
Uses a raw HTML format to represent this column in a formatted list of resultsordered: boolean
indent: number
spacing: number

Uses a image format to represent this column in a formatted list of results  
Uses an image carousel to represent this column in a formatted list of results. Ideally for an array of strings.  
Uses a json format to represent this column in a formatted list of results. Ideally for arrays or objects.  
Uses a clickable link to represent this column in a formatted list of results  
Uses a list (ordered or unordered) to represent this column in a formatted list of results. Ideally for an array of strings  
Converts the column value from markdown to raw HTML to represent this column in a formatted list of results  
Outputs the keys and values of the columns value in tabular format. Ideally for a key value object.padding: number
align: left|right|center
format: boolean

Uses a number format to represent this column in a formatted list of resultsseparator: string
decimal: string
decimals: number
absolute: boolean

Uses a format that considers text overflows to represent this column in a formatted list of resultslength: number
words: boolean
hellip: boolean

Uses a phone format to represent this column in a formatted list of resultslabel: string
Uses a rating format to represent this column in a formatted list of resultsmax: number
remainder: boolean
round: round|ceil|floor
spacing: number

Uses a separator format to represent this column in a formatted list of results. Ideally for an array of strings.separator: string
Uses a tablular format to represent this column in a formatted list of results. Ideally for an array of objects.top: boolean
left: boolean
right: boolean
padding: number
align: left|right|center
background: color
border: color
header: color
stripe: color

Uses a tag list format to represent this column in a formatted list of results. Ideally for an array of strings.curved: boolean
rounded: boolean
pill: boolean
info: boolean
warning: boolean
success: boolean
error: boolean
muted: boolean
primary: boolean
color: color
secondary: boolean
outline: boolean
solid: boolean
transparent: boolean

Uses a template to generate a text to represent this column in a formatted list of resultstemplate: string
Uses a text format to represent this column in a formatted list of resultsupper: boolean
lower: boolean
capital: boolean

Converts a boolean to a string representation to represent this column in a formatted list of resultsyes: string
no: string

7. View Attributes

The following view format fields can be applied to model columns defined in an Idea file. These attributes are used to describe how the column should be represented in a formatted result view (ie. detail page). Logically, only one view attribute should be used per column.
Copy
Attribute
Description
Attributes
Example
Hides this column in a view  
Uses a code format to represent this column in a viewlang: string
numbers: boolean
inline: boolean
trim: boolean
ltrim: boolean
rtrim: boolean

Uses a code color to represent this column in a viewbox: boolean
text: boolean

Uses a country format to represent this column in a viewflag: boolean
text: boolean

Uses a currency format to represent this column in a viewflag: boolean
text: boolean

Uses a date format to represent this column in a viewlocale: string
format: string

Uses an email format to represent this column in a view  
Outputs the value of the given formula in a viewformula: string
Uses a raw HTML format to represent this column in a viewordered: boolean
indent: number
spacing: number

Uses a image format to represent this column in a view  
Uses an image carousel to represent this column in a view. Ideally for an array of strings.  
Uses a json format to represent this column in a view. Ideally for arrays or objects.  
Uses a clickable link to represent this column in a view  
Uses a list (ordered or unordered) to represent this column in a view. Ideally for an array of strings  
Converts the column value from markdown to raw HTML to represent this column in a view  
Outputs the keys and values of the columns value in tabular format. Ideally for a key value object.padding: number
align: left|right|center
format: boolean

Uses a number format to represent this column in a viewseparator: string
decimal: string
decimals: boolean
absolute: boolean

Uses a format that considers text overflows to represent this column in a viewlength: number
words: boolean
hellip: boolean

Uses a phone format to represent this column in a viewlabel: string
Uses a rating format to represent this column in a viewmax: number
remainder: boolean
round: round|ceil|floor
spacing: number

Uses a separator format to represent this column in a view. Ideally for an array of strings.separator: string
Uses a tablular format to represent this column in a view. Ideally for an array of objects.top: boolean
left: boolean
right: boolean
padding: number
align: left|right|center
background: color
border: color
header: color
stripe: color

Uses a tag list format to represent this column in a view. Ideally for an array of strings.curved: boolean
rounded: boolean
pill: boolean
info: boolean
warning: boolean
success: boolean
error: boolean
muted: boolean
primary: boolean
color: boolean
secondary: boolean
outline: boolean
solid: boolean
transparent: boolean

Uses a template to generate a text to represent this column in a viewtemplate: string
Uses a text format to represent this column in a viewupper: boolean
lower: boolean
capital: boolean

Converts a boolean to a string representation to represent this column in a viewyes: string
no: string