Beispiel #1
0
 def patch(self):
     group = self.shared.group_get(self.request.matchdict['object_id'])
     schema = GroupEditSchema(context={'request': self.request,
                                       'modified_obj': group})
     data = schema.load(self.request.unsafe_json_body).data
     self.shared.populate_instance(group, data)
     return schema.dump(group).data
Beispiel #2
0
 def post(self):
     schema = GroupEditSchema(context={'request': self.request})
     data = schema.load(self.request.unsafe_json_body).data
     group = Group()
     self.shared.populate_instance(group, data)
     group.persist(flush=True, db_session=self.request.dbsession)
     return schema.dump(group).data
Beispiel #3
0
 def post(self):
     schema = GroupEditSchema(context={"request": self.request})
     data = schema.load(self.request.unsafe_json_body).data
     group = Group()
     self.shared.populate_instance(group, data)
     group.persist(flush=True, db_session=self.request.dbsession)
     return schema.dump(group).data
Beispiel #4
0
 def patch(self):
     group = self.shared.group_get(self.request.matchdict["object_id"])
     schema = GroupEditSchema(
         context={"request": self.request, "modified_obj": group}
     )
     data = schema.load(self.request.unsafe_json_body).data
     self.shared.populate_instance(group, data)
     return schema.dump(group).data
Beispiel #5
0
 def get(self):
     schema = GroupEditSchema(context={'request': self.request})
     group = self.shared.group_get(self.request.matchdict['object_id'])
     return schema.dump(group).data
Beispiel #6
0
 def collection_list(self):
     groups = self.shared.collection_list()
     schema = GroupEditSchema(context={'request': self.request})
     return schema.dump([group for group in groups], many=True).data
Beispiel #7
0
 def get(self):
     schema = GroupEditSchema(context={"request": self.request})
     group = self.shared.group_get(self.request.matchdict["object_id"])
     return schema.dump(group).data
Beispiel #8
0
 def collection_list(self):
     groups = self.shared.collection_list()
     schema = GroupEditSchema(context={"request": self.request})
     return schema.dump([group for group in groups], many=True).data