def add_document(): p = Patient.query.filter_by(node_id=57).first() s = Staff.query.filter_by(node_id=49).first() d = Document(type = DocumentType.OBSERVATION, status = DocumentStatus.VALIDATED, patient_id = p.id, author_id = s.id) d.description = generate_random_string(5) d.url_image = generate_random_string(15) db.session.add(d)
def selection_as_document(document): # Get a copy of the currently selected objects as a group # If no object is selected the method returns None selection = document.CopyForClipboard() if selection is not None: # create a new document seldoc = Document(create_layer = 1) # and insert the group seldoc.Insert(selection) # The group is now the selected object in the document. Ungroup # it. seldoc.UngroupSelected() return seldoc return None
def NewDocument(self): doc = Document(create_layer=1) self.counter += 1 doc.meta.filename = 'New Document %u.sk1' % self.counter doc.meta.view = None self.SetActiveDocument(doc) if self.tabspanel: self.tabspanel.addNewTab(self.activedoc)
def createDocuments(mnd_dataset, texts): # Create Documents mnd_document_texts = texts mnd_documents = [] for dt in mnd_document_texts[0:5]: document = Document(text=dt, dataset=mnd_dataset) mnd_documents.append(document) db.session.add(document) db.session.commit()
def createDocuments(mnd_dataset, allergies_dataset): # Create Documents mnd_document_texts = [ ' '.join(['I am an mnd document', str(i + 1)]) for i in range(300) ] mnd_documents = [] for dt in mnd_document_texts: document = Document(text=dt, dataset=mnd_dataset) mnd_documents.append(document) db.session.add(document) allergies_document_texts = [ ' '.join(['I am an allergies document', str(i + 1)]) for i in range(300) ] allergies_documents = [] for dt in allergies_document_texts: document = Document(text=dt, dataset=allergies_dataset) allergies_documents.append(document) db.session.add(document) db.session.commit()
def __init__(self, master=None, toplevel=None, document=None, show_visible=0, show_printable=1, resolution=None, **kw): apply(PyWidget.__init__, (self, master), kw) Viewport.__init__(self, resolution) QueueingPublisher.__init__(self) self.toplevel = toplevel self.move_window_count = 0 self.show_page_outline = 1 self.show_visible = show_visible self.show_printable = show_printable self.gcs_initialized = 0 self.gc = GraphicsDevice() self.renderer = DocRenderer(self) self.widget_size = () self.init_transactions() if document is not None: self.SetDocument(document) else: self.SetDocument(Document(create_layer=1))