diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2017-10-05 13:07:23 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2017-10-05 13:07:23 +0200 |
commit | fc11314eda6103d5055062c3035536c93784ea4c (patch) | |
tree | 28412e40675f37eef2e1302c709a06ee5f14ad3b /archivist/server/tag.py | |
parent | 4bd7160a182bf0175b0b6a46c298375c38e2df69 (diff) | |
download | archivist-fc11314eda6103d5055062c3035536c93784ea4c.tar.gz archivist-fc11314eda6103d5055062c3035536c93784ea4c.tar.bz2 archivist-fc11314eda6103d5055062c3035536c93784ea4c.zip |
Change to flask_restplus
Diffstat (limited to 'archivist/server/tag.py')
-rw-r--r-- | archivist/server/tag.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/archivist/server/tag.py b/archivist/server/tag.py new file mode 100644 index 0000000..96fafcd --- /dev/null +++ b/archivist/server/tag.py @@ -0,0 +1,19 @@ +from flask_restplus import Resource, fields, Namespace + +from .. import model as m + +api = Namespace('tag', description = 'Operations on tags') + +tag = api.model('Tag', { + 'name' : fields.String(required=True), + 'prefix' : fields.String, + 'description' : fields.String +}) + +@api.route('/') +class TagList(Resource): + + @api.marshal_list_with(tag) + def get(self): + """List all available tags.""" + return list(m.Tag.select().where(~m.Tag.default).dicts().iterator()) |