python-mysqlobjectA Python class to convert a simple object in a MySQL connection driver | |
Download |
python-mysqlobject Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Rodrigo Fuentealba
- Publisher web site:
- http://github.com/rfc83/
python-mysqlobject Tags
python-mysqlobject Description
python-mysqlobject is a Python class to convert a simple object in a MySQL connection driver.It provides a set of functions to interact with a MySQL server directly from a class. These functions are designed in a natural way that allows an user to forget about implementation details.How to use itIt is pretty simple to instance it: from mysqlobject import mysqlobject class myclass (mysqlobject): def __init__(self): super(myclass, self).__init__() self.mysqlobject_params = "localhost", self.mysqlobject_params = 3306, self.mysqlobject_params = "root", self.mysqlobject_params = "$ecre7", self.mysqlobject_params = "test", self.mysqlobject_params = True, self.mysqlobject_params = "utf8", self.mysqlobject_params = False, self.mysqlobject_params = "DictCursor",It is also easy to use it: try: all = myclass.mysql_select("SELECT VERSION();") one = myclass.mysql_select_one("SELECT VERSION();") lastid = myclass.mysql_insert( "INSERT INTO test (name) VALUES ('test');" ) affected = myclass.mysql_update("UPDATE test SET name = 'test2';") deleted = myclass.mysql_delete("DELETE FROM test;") except Exception, e print eYou can also execute many queries: query = "INSERT INTO test (name) VALUES ('%s');" data = affected = mysql_query_many(query, data)Product's homepage
python-mysqlobject Related Software