Browse Source

workspaceSchema inherit from workspace digest

Guénaël Muller 6 years ago
parent
commit
4906883661
1 changed files with 4 additions and 10 deletions
  1. 4 10
      tracim/views/core_api/schemas.py

+ 4 - 10
tracim/views/core_api/schemas.py View File

@@ -69,24 +69,18 @@ class WorkspaceMenuEntrySchema(marshmallow.Schema):
69 69
     icon = marshmallow.fields.String()
70 70
 
71 71
 
72
-class WorkspaceSchema(marshmallow.Schema):
72
+class WorkspaceDigestSchema(marshmallow.Schema):
73 73
     id = marshmallow.fields.Int()
74
-    slug = marshmallow.fields.String()
75 74
     label = marshmallow.fields.String()
76
-    description = marshmallow.fields.String()
77 75
     sidebar_entries = marshmallow.fields.Nested(
78 76
         WorkspaceMenuEntrySchema,
79 77
         many=True,
80 78
     )
81 79
 
82 80
 
83
-class WorkspaceDigestSchema(marshmallow.Schema):
84
-    id = marshmallow.fields.Int()
85
-    label = marshmallow.fields.String()
86
-    sidebar_entries = marshmallow.fields.Nested(
87
-        WorkspaceMenuEntrySchema,
88
-        many=True,
89
-    )
81
+class WorkspaceSchema(WorkspaceDigestSchema):
82
+    slug = marshmallow.fields.String()
83
+    description = marshmallow.fields.String()
90 84
 
91 85
 
92 86
 class WorkspaceMemberSchema(marshmallow.Schema):