mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 16:46:31 +00:00
feat: collection titleField
This commit is contained in:
parent
aaf6718755
commit
3b7143a282
@ -3,11 +3,11 @@ import { EventEmitter } from 'events';
|
|||||||
import { default as lodash, default as _ } from 'lodash';
|
import { default as lodash, default as _ } from 'lodash';
|
||||||
import {
|
import {
|
||||||
ModelOptions,
|
ModelOptions,
|
||||||
|
ModelStatic,
|
||||||
QueryInterfaceDropTableOptions,
|
QueryInterfaceDropTableOptions,
|
||||||
SyncOptions,
|
SyncOptions,
|
||||||
Transactionable,
|
Transactionable,
|
||||||
ModelStatic,
|
Utils
|
||||||
Utils,
|
|
||||||
} from 'sequelize';
|
} from 'sequelize';
|
||||||
import { Database } from './database';
|
import { Database } from './database';
|
||||||
import { Field, FieldOptions } from './fields';
|
import { Field, FieldOptions } from './fields';
|
||||||
@ -62,6 +62,10 @@ export class Collection<
|
|||||||
return this.options.name;
|
return this.options.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get titleField() {
|
||||||
|
return (this.options.titleField as string) || this.model.primaryKeyAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
get db() {
|
get db() {
|
||||||
return this.context.database;
|
return this.context.database;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user