def create_pub_metadata(self, request): pub_metadata = PublishMetadata() pub_metadata.title = request.POST['title'] pub_metadata.description = request.POST['description'] pub_metadata.tags = [t.strip() for t in request.POST['tags'].split(',')] pub_metadata.category = "KCClass" str_access = request.POST['access'] if str_access == 'private': pub_metadata.access = Access.PRIVATE else: pub_metadata.access = Access.PUBLIC return pub_metadata
def create_publish_metadata(service_name): """ Create an instance of a publishing metadata and fill it with the specifics for the given multimedia provider. """ metadata = PublishMetadata() if service_name == "youtube": metadata.category="Education" metadata.category=Access.PUBLIC elif service_name == "picassaweb": metadata.category="KCClass" metadata.category=Access.PUBLIC elif service_name == "slideshare": metadata.category="KCClass" metadata.category=Access.PUBLIC elif service_name == "flickr": metadata.category="KCClass" metadata.category=Access.PUBLIC else: log.error("Unknown service name: %s" % service_name) raise Exception("Unknown service name: " % service_name) return metadata