Python:Presentation

From wiki
Revision as of 07:23, 5 April 2023 by Sysop (talk | contribs) (modified through wikirestore by Sysop)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

from dataclasses import dataclass from typing import Optional import dacite @dataclass class Presentation:

   """
   a presentation of a lecture
   """
   pageTitle:str
   key:Optional[str] # The key of the Presentation
   num:Optional[str] # The number of the Presentation
   name:Optional[str] # The name of the Presentation
   ppt_file:Optional[str] # The powert point file name of the Presentation
   sciebo:Optional[str] # The sciebo link suffix of this Presentation
   gitlab:Optional[str] # The gitlab url of the Presentation
   moodle:Optional[str] # The moodle pdf annotator page id of the Presentation
   @classmethod
   def askQuery(cls):
       """
       get the ask Query for Presentation
       
       Returns:
           str: the mediawiki markup for the ask query
       """

ask="""

pageTitlekeynumnameppt_filesciebogitlabmoodle
Presentation/OrgaOrga0Organisatorisches0-Organisatorisches.pptx45666116040-Orga/0-Organisatorisches.pdf583301
Presentation/IntroIntro1Einführung1-Einfuehrung.pptx45666116371-Intro/1-Einfuehrung.pdf583306
Presentation/ERMERM2Entity-Relationship2-Entity-Relationship.pptx45666116162-ERM/2-Entity-Relationship.pdf589038
Presentation/RelDataRelData3Relationales Datenmodell3-RelationalesDatenmodell.pptx45666117243-RelData/3-RelationalesDatenmodell.pdf595181
Presentation/SQLSQL4Relationale Datenbanksprache SQL4-RelationaleDatenbankspracheSQL.pptx45666117544-SQL/4-RelationaleDatenbankspracheSQL.pdf612739
Presentation/RelQueryRelQuery5Relationale Abfragebeantwortung5-RelationaleAnfragebearbeitung.pptx45666118205-RelQuery/5-RelationaleAnfragebearbeitung.pdf617639
Presentation/RelDesignRelDesign6Relationale Entwurfstheorie6-RelationaleEntwurfstheorie.pptx45666118476-RelDesign/6-RelationaleEntwurfstheorie.pdf639444
Presentation/TMTM8Transaktionsverwaltung8-Transaktionsverwaltung.pptx45666118808-TM/8-Transaktionsverwaltung.pdf656576

"""

       return ask
       
   @classmethod
   def fromDict(cls,data:dict):
       """
       create a Presentation from the given dict
       
       Args:
           data(dict): the dict to create the Presentation from
       
       Returns:
           Presentation: the freshly created Presentation
       """
       presentation=dacite.from_dict(data_class=cls,data=data)
       return presentation