forked from fossasia/open-event-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmails.py
More file actions
28 lines (22 loc) · 705 Bytes
/
mails.py
File metadata and controls
28 lines (22 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Schema
from app.api.helpers.utilities import dasherize
class MailSchema(Schema):
"""
Api schema for mail Model
"""
class Meta:
"""
Meta class for mail Api Schema
"""
type_ = 'mail'
self_view = 'v1.mail_detail'
self_view_kwargs = {'id': '<id>'}
self_view_many = 'v1.mail_list'
inflect = dasherize
id = fields.Str(dump_only=True)
recipient = fields.Email(dump_only=True)
time = fields.DateTime(dump_only=True)
action = fields.Str(dump_only=True)
subject = fields.Str(dump_only=True)
message = fields.Str(dump_only=True)