示例#1
0
    def load_from_db(self, dt=None, dn=None):
        """
			Load doclist from dt
		"""
        from webnotes.model.doc import getchildren

        if not dt: dt = self.doc.doctype
        if not dn: dn = self.doc.name

        doc = Document(dt, dn)

        # get all children types
        tablefields = webnotes.model.meta.get_table_fields(dt)

        # load chilren
        doclist = webnotes.doclist([
            doc,
        ])
        for t in tablefields:
            doclist += getchildren(doc.name, t[0], t[1], dt)

        self.set_doclist(doclist)

        if dt == dn:
            self.convert_type(self.doc)
示例#2
0
    def load_from_db(self, dt=None, dn=None, prefix="tab"):
        """
			Load doclist from dt
		"""
        from webnotes.model.doc import getchildren

        if not dt:
            dt = self.doc.doctype
        if not dn:
            dn = self.doc.name

        doc = Document(dt, dn, prefix=prefix)

        # get all children types
        tablefields = webnotes.model.meta.get_table_fields(dt)

        # load chilren
        doclist = webnotes.doclist([doc])
        for t in tablefields:
            doclist += getchildren(doc.name, t[0], t[1], dt, prefix=prefix)

        self.set_doclist(doclist)

        if dt == dn:
            self.convert_type(self.doc)
示例#3
0
	def load_from_db(self, dt, dn):
		"""
			Load doclist from dt
		"""
		from webnotes.model.doc import Document, getchildren

		doc = Document(dt, dn, prefix=prefix)

		# get all children types
		tablefields = webnotes.model.meta.get_table_fields(dt)

		# load chilren
		doclist = [doc,]
		for t in tablefields:
			doclist += getchildren(doc.name, t[0], t[1], dt, prefix=prefix)

		self.docs = docs
示例#4
0
	def load_from_db(self, dt=None, dn=None, prefix='tab'):
		
		from webnotes.model.doc import Document, getchildren

		if not dt: dt = self.doc.doctype
		if not dn: dn = self.doc.name

		doc = Document(dt, dn, prefix=prefix)

		# get all children types
		tablefields = webnotes.model.meta.get_table_fields(dt)

		# load chilren
		doclist = webnotes.doclist([doc,])
		for t in tablefields:
			doclist += getchildren(doc.name, t[0], t[1], dt, prefix=prefix)

		self.set_doclist(doclist)
		self.run_method("onload")
示例#5
0
    def load_from_db(self, dt, dn):
        """
			Load doclist from dt
		"""
        from webnotes.model.doc import Document, getchildren

        doc = Document(dt, dn, prefix=prefix)

        # get all children types
        tablefields = webnotes.model.meta.get_table_fields(dt)

        # load chilren
        doclist = [
            doc,
        ]
        for t in tablefields:
            doclist += getchildren(doc.name, t[0], t[1], dt, prefix=prefix)

        self.docs = docs
示例#6
0
    def load_from_db(self, dt=None, dn=None, prefix='tab'):
        """
			Load doclist from dt
		"""
        from webnotes.model.doc import Document, getchildren

        if not dt: dt = self.doc.doctype
        if not dn: dn = self.doc.name

        doc = Document(dt, dn, prefix=prefix)

        # get all children types
        tablefields = webnotes.model.meta.get_table_fields(dt)

        # load chilren
        doclist = webnotes.doclist([
            doc,
        ])
        for t in tablefields:
            doclist += getchildren(doc.name, t[0], t[1], dt, prefix=prefix)

        self.set_doclist(doclist)
        self.run_method("onload")