e4378ddc530abc356c8ca4e3e6a317562b104c96,gb/node.py,Node,create,#Node#Any#Any#Any#,14

Before Change


        DbObj.__init__(self)

    def create(self, data, graph, node_type=0):
        self.data = data
        self.graph = graph
        self.node_type = node_type

        self.execute("INSERT INTO node (data, graph, node_type) VALUES (%s, %s, %s)", (data, graph.id, node_type))
        self.id = self.insert_id()
        self.commit()

        return self

After Change


        self.collection = "nodes"

    def create(self, label, graph, node_type="text"):
        self.d["label"] = label
        self.d["type"] = node_type
        self.d["graph"] = graph.d["_id"]
        self.d["creation_ts"] = datetime.now()
        self.d["origs"] = []
        self.d["targs"] = {}

        self._insert()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 23

Instances


Project Name: graphbrain/graphbrain
Commit Name: e4378ddc530abc356c8ca4e3e6a317562b104c96
Time: 2011-10-26
Author: telmo@telmomenezes.net
File Name: gb/node.py
Class Name: Node
Method Name: create


Project Name: graphbrain/graphbrain
Commit Name: e4378ddc530abc356c8ca4e3e6a317562b104c96
Time: 2011-10-26
Author: telmo@telmomenezes.net
File Name: gb/user.py
Class Name: User
Method Name: create


Project Name: graphbrain/graphbrain
Commit Name: e4378ddc530abc356c8ca4e3e6a317562b104c96
Time: 2011-10-26
Author: telmo@telmomenezes.net
File Name: gb/node.py
Class Name: Node
Method Name: create


Project Name: graphbrain/graphbrain
Commit Name: e4378ddc530abc356c8ca4e3e6a317562b104c96
Time: 2011-10-26
Author: telmo@telmomenezes.net
File Name: gb/graph.py
Class Name: Graph
Method Name: create