diff options
author | Charlie <charlie@tutorius-dev.(none)> | 2009-10-03 18:12:14 (GMT) |
---|---|---|
committer | Charlie <charlie@tutorius-dev.(none)> | 2009-10-03 18:12:14 (GMT) |
commit | a7098702db81f1359f01d41edc111de2ac28a1e4 (patch) | |
tree | 965544a44f0e08dab8af171916dd9aa0faa05826 | |
parent | 960bd3313d504eae302303d7dcd2d43db10ff4ed (diff) |
Added a Tutorial wrapper class around the list returned by the Vault
-rw-r--r-- | TutoriusActivity.activity/WorkshopModel.py | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/TutoriusActivity.activity/WorkshopModel.py b/TutoriusActivity.activity/WorkshopModel.py index 9524733..22be6b5 100644 --- a/TutoriusActivity.activity/WorkshopModel.py +++ b/TutoriusActivity.activity/WorkshopModel.py @@ -52,3 +52,82 @@ class WorkshopActivity(): """ pass + +class Tutorial(): + """ + Wrapper for tutorial metadata + """ + def __init__(self,metadata_dict): + self.__original_dict = metadata_dict + self.__update_dict = metadata_dict + if 'Description' in self.__orgininal_dict: + self.__description = self.__original_dict['Description'] + else: + self.__description = None + + if 'Author' in self.__original_dict: + self.__author = self.__original_dict['Author'] + else: + self.__author = None + + if 'Rating' in self.__original_dict: + self.__rating = self.original_dict['Rating'] + else: + self.__rating = None + + if 'PublishedState' in self.__original_dict: + self.__published_state = original_dict['PublishedState'] + else: + self.__published_state = None + + if 'TutorialId' in self._original_dict: + self.__id = original_state['TutorialId'] + else: + self.__id = None + + def get_description(self): + return self.__description + + def set_description(self,description): + self.__description = description + self.__update_dict['Description'] = description + + def get_author(self): + return self.__author + + def set_author(self,author): + self.__author = author + self.__update_dict['Author'] = author + + def get_rating(self): + return self.__rating + + def set_rating(self,rating): + self.__rating = rating + self.__update_dict['Rating'] = rating + + def get_published_state(self): + return self.__published_state + + def set_published_state(self,published_state): + self.__published_state = published_state + self.__update_dict['PublishedState'] = published_state + + def get_id(self): + return self.__id + + def set_id(self,id): + self.__id = id + self.__update_dict['TutorialId'] = id + + def get_updated_metadata(self): + return self.__update_dict + + description = property(get_description,set_description) + author = property(get_author,set_author) + rating = property(get_rating,set_rating) + published_state = property(get_published_state,set_published_state) + id = property(get_id,set_id) + updated_metadata = property(get_updated_metadata) + + |