Example #1
0
 def to_dict(self):
     from p2k16.web import badge_blueprint
     return {**event_management.base_dict(self), **{
         "created_at": self.created_at,
         "created_by": self.created_by,
         "created_by_username": self.created_by.username,
         "account_badge": badge_blueprint.badge_to_json(self.account_badge),
         "badge_description": badge_blueprint.badge_description_to_json(self.badge_description) if self.badge_description else None,
     }}
Example #2
0
 def to_dict(self):
     return {
         **event_management.base_dict(self),
         **{
             "created_at": self.created_at,
             "created_by": self.created_by,
             "created_by_username": self.created_by.username,
             "tool_name": self.tool_name
         }
     }