mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Add is_protected and views to Tags API
This commit is contained in:
parent
4f9ec2e8a4
commit
bdd3ab4360
@ -330,9 +330,11 @@ Supported query parameters:
|
|||||||
### Tags
|
### Tags
|
||||||
|
|
||||||
* GET `/api/tags/` ([View](/api/tags/)): List of:
|
* GET `/api/tags/` ([View](/api/tags/)): List of:
|
||||||
* `name`: technical name
|
* `name`: technical name.
|
||||||
* `title`: human-readable title
|
* `title`: human-readable title.
|
||||||
* `description`: tag description or null
|
* `description`: tag description or null.
|
||||||
|
* `is_protected`: boolean, whether the tag is protected (can only be set by Editors in the web interface).
|
||||||
|
* `views`: number of views of this tag.
|
||||||
|
|
||||||
### Content Warnings
|
### Content Warnings
|
||||||
|
|
||||||
|
@ -818,7 +818,13 @@ class Tag(db.Model):
|
|||||||
|
|
||||||
def getAsDictionary(self):
|
def getAsDictionary(self):
|
||||||
description = self.description if self.description != "" else None
|
description = self.description if self.description != "" else None
|
||||||
return { "name": self.name, "title": self.title, "description": description }
|
return {
|
||||||
|
"name": self.name,
|
||||||
|
"title": self.title,
|
||||||
|
"description": description,
|
||||||
|
"is_protected": self.is_protected,
|
||||||
|
"views": self.views,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class MinetestRelease(db.Model):
|
class MinetestRelease(db.Model):
|
||||||
|
Loading…
Reference in New Issue
Block a user