示例#1
0
 def contents(self, with_content=False, authenticated=False):
     from sefaria.sheets import group_sheets, sheet_tag_counts
     contents = super(Group, self).contents()
     if with_content: 
         contents["sheets"]       = group_sheets(self, authenticated)["sheets"]
         contents["tags"]         = sheet_tag_counts({"group": self.name})
         contents["admins"]       = [public_user_data(uid) for uid in contents["admins"]]
         contents["publishers"]   = [public_user_data(uid) for uid in contents["publishers"]]
         contents["members"]      = [public_user_data(uid) for uid in contents["members"]]
         contents["invitations"]  = getattr(self, "invitations", []) if authenticated else []
         contents["pinnedSheets"] = getattr(self, "pinned_sheets", [])
     return contents
示例#2
0
 def contents(self, with_content=False, authenticated=False):
     from sefaria.sheets import group_sheets, sheet_tag_counts
     contents = super(Group, self).contents()
     if with_content: 
         contents["sheets"]       = group_sheets(self.name, authenticated)["sheets"]
         contents["tags"]         = sheet_tag_counts({"group": self.name})
         contents["admins"]       = [public_user_data(uid) for uid in contents["admins"]]
         contents["publishers"]   = [public_user_data(uid) for uid in contents["publishers"]]
         contents["members"]      = [public_user_data(uid) for uid in contents["members"]]
         contents["invitations"]  = getattr(self, "invitations", []) if authenticated else []
         contents["pinnedSheets"] = getattr(self, "pinned_sheets", [])
     return contents