Example #1
0
 def are_contained_publishable(self):
     """Flag to say whether any contained models are publishable.
     """
     has_publishable_docs = False
     for doc in cnxepub.flatten_to_documents(self):
         has_publishable_docs = has_publishable_docs or doc.is_publishable
     return has_publishable_docs
Example #2
0
 def publish_prep(self):
     license = self.metadata['license']
     self.metadata['license_url'] = license.url
     self.metadata['license_text'] = ' '.join([license.name, license.abbr, license.version])
     self.metadata['summary'] = self.metadata['abstract']
     self.set_uri('cnx-archive', self.id)
     documents = []
     for document in cnxepub.flatten_to_documents(self):
         if document.id not in documents:
             documents.append(document.id)
             document.publish_prep()