コード例 #1
0
ファイル: _edit_postcode_v2.py プロジェクト: ckSchool/bucky
    def insertPostcode(self, post, kal, kec, kab, prov): 
	sql = "INSERT INTO postcodes \
		      (kelurahan, kecamatan, kabupaten, province, postcode) \
	       VALUES (?, ?, ?, ?, ?)"
	data =  [kal, kec, kab, prov, post]
	#rint'insertPostcode ', sql, data; return
	fetch.updateDB_data(sql, data)
コード例 #2
0
ファイル: _edit_postcode_v2.py プロジェクト: ckSchool/bucky
    def updatePostcode(self, post, kal, kec, kab, prov): 
        sql = "UPDATE postcodes \
		      (kelurahan, kecamatan, kabupaten, province) \
	       VALUES (?, ?, ?, ?) \
		WHERE postcode =%d" % post
	data = [kal, kec, kab, prov]
	#rint'updatePostcode' , sql, data; return
	fetch.updateDB_data(sql, data)
コード例 #3
0
ファイル: _edit_address_v2.py プロジェクト: ckSchool/bucky
    def insertAddress(self):
        house, street, estate, block, road, post, kal, kec, kab, prov = self.getValues()
        if house and (street or road) and post:
            sql = """INSERT INTO addresses \
			  (house, street, estate, block, road, postcode) \
		   VALUES (?,  ?,   ?,   ?,  ?,  ?) """
            data = [house, street, estate, block, road, post]
            ##rintsql, data; return
            fetch.updateDB_data(sql, data)
        else:
            fetch.msg("house, post code street or road missing")
コード例 #4
0
ファイル: _edit_address_v2.py プロジェクト: ckSchool/bucky
    def insertPostcode(self):
        house, street, estate, block, road, post, kal, kec, kab, prov = self.getValues()
        if post:
            sql = (
                "INSERT INTO postcodes \
		      SET kelurahan, kecamatan, kabupaten, province \
		   VALUES (?, ?, ?, ?, ?)\
		    WHERE postcode = %d"
                % post
            )
            data = [kal, kec, kab, prov]
            # rint'insertPostcode ', sql, data; return
            fetch.updateDB_data(sql, data)
コード例 #5
0
ファイル: _edit_address_v2.py プロジェクト: ckSchool/bucky
    def updateAddress(self):
        house, street, estate, block, road, post, kal, kec, kab, prov = self.getValues()
        sql = "UPDATE addresses \
                  SET number, street, estate, block, road, postcode \
               VALUES (%,     %,      %,      %,     %,    %) \
                WHERE self.addr_id=%d"
        data = (house, street, estate, block, road, post, self.addr_id)
        # rintsql, data; return
        fetch.updateDB_data(sql, data)

        if self.postcodeExists(postcode):
            self.updatePostcode()
        else:
            self.insertPostcode()
コード例 #6
0
ファイル: _edit_address_v2.py プロジェクト: ckSchool/bucky
    def updatePostcode(self):
        house, street, estate, block, road, post, kal, kec, kab, prov = self.getValues()
        if post:
            sql = (
                "UPDATE postcodes \
		      (kelurahan, kecamatan, kabupaten, province) \
		   VALUES (?, ?, ?, ?) \
		    WHERE postcode =%d"
                % post
            )
            data = [kal, kec, kab, prov]
            # rint'updatePostcode' , sql, data; return
            fetch.updateDB_data(sql, data)

        else:
            fetch.msg("house, post code street or road missing")