Constructor
new ModelAdmin(model)
Parameters:
Name | Type | Description |
---|---|---|
model |
Sequelize.Model | The model produced by Sequelize.define |
Properties:
Name | Type | Description |
---|---|---|
actions |
Array.<ModelAdmin~action> | List of actions |
list_fields |
array.<String> | List of fields, visible on list view. You can define nonexistent field here and define its view method via addFieldsDescriptions |
list_links |
array.<String> | List of fields, which are links |
list_exclude |
array.<String> | List of fields, excluded from list view You can define nonexistent field here to show all fields |
list_per_page |
number | Number of entries on list view page |
search_fields |
array.<String> | Searchable fields if not set -- all STRING and TEXT fields |
ordering |
array.<String> | Default model list ordering, prepend minus means desc order example: ['date', '-active'] |
editor_fields |
array.<String> | List of fields, visible on entry editor screen |
readonly_fields |
array.<String> | List of readonly fields |
icon |
String | Html code of icon in model list screen. Default <span class="oi oi-list"></span> |
- Source:
Members
(readonly) model :Sequelize.Model
Model instance
Type:
- Sequelize.Model
- Source:
(readonly) name :String
Model name
Type:
- String
- Source:
(readonly) namePlural :String
Model plural name
Type:
- String
- Source:
(readonly) pkName :String
Model primary key name
Type:
- String
- Source:
Methods
(static) entryRenderer(req, res, next)
Render entry editor view instead default one
Parameters:
Name | Type | Description |
---|---|---|
req |
Express.Request | |
res |
Express.Response | |
next |
function |
- Source:
(static) modelListRenderer(req, res, next)
Render model view instead default model list
Parameters:
Name | Type | Description |
---|---|---|
req |
Express.Request | |
res |
Express.Response | |
next |
function |
- Source:
addExtraResource(resources)
Push extra js or css to page section.
Resources can be tag