mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:06:47 +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 {
|
||||
ModelOptions,
|
||||
ModelStatic,
|
||||
QueryInterfaceDropTableOptions,
|
||||
SyncOptions,
|
||||
Transactionable,
|
||||
ModelStatic,
|
||||
Utils,
|
||||
Utils
|
||||
} from 'sequelize';
|
||||
import { Database } from './database';
|
||||
import { Field, FieldOptions } from './fields';
|
||||
@ -62,6 +62,10 @@ export class Collection<
|
||||
return this.options.name;
|
||||
}
|
||||
|
||||
get titleField() {
|
||||
return (this.options.titleField as string) || this.model.primaryKeyAttribute;
|
||||
}
|
||||
|
||||
get db() {
|
||||
return this.context.database;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user