WIP: Aureplop/kpsul js refactor #501
1 changed files with 10 additions and 2 deletions
|
@ -547,17 +547,25 @@ class Article extends ModelObject {
|
|||
/**
|
||||
* Verbose name for Article model
|
||||
* @default <tt>'article'</tt>
|
||||
* @see {@link Models.ModelObject.compare|ModelObject.compare}
|
||||
* @see {@link Models.ModelObject.verbose_name|ModelObject.verbose_name}
|
||||
*/
|
||||
static get verbose_name() { return 'article'; }
|
||||
|
||||
/**
|
||||
* @default {@link Formatters.ArticleCategoryFormatter}
|
||||
* @default {@link Formatters.ArticleFormatter}
|
||||
*/
|
||||
formatter() {
|
||||
return ArticleFormatter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Comparison function between Article model instances.
|
||||
* @see {@link Models.ModelObject.compare|ModelObject.compare}
|
||||
*/
|
||||
static compare(a, b) {
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
|
||||
// Take care of 'price' type
|
||||
// API currently returns a string object (serialization of Decimal type within Django)
|
||||
get price() { return this._price; }
|
||||
|
|
Loading…
Reference in a new issue