Python CRUD

Let’s do the same thing with MySql

pip install MySQL-python
import MySQLdb

class mydbconn():
    def __init__(self):
        self.con = MySQLdb.connect('x', 'x', 'x', 'x')

    def get_columns(self,table):
        cuc = self.con.cursor()
        cursData = cuc.execute("SHOW columns FROM " + table)
        HEADERS = cuc.fetchall()
        keyName = HEADERS[0][0]
        keyLen = self.lenFunction(HEADERS[0][1])
        return keyName, keyLen, HEADERS

    def lenFunction(self,varCharString):
        x = varCharString.find("(")
        varCharString = varCharString[x+1:]
        x = varCharString.find(")")
        varCharString = varCharString[:x]
        return int(varCharString)

if __name__=="__main__":
    con = mydbconn()
    keyName, keyLen, h = con.get_columns("customer")
    for i in h:
        print i

On the fifth line of the program, use your MySql credentials. Sometimes the first parameter is localhost, the second x is the username for the database, the password is third and the name of the database is fourth.

You also have to change the parameter in line 2 of the main section to the name of the table you are using. This routine also has been used with databases that had a key other than named id for the first field, and it was important to have the name of the key and its length to proceed with scaffolding

In the Sqlite3 sqlalchemy example, we got a list of field names. In this example, we get a tuple of tuples. At this point, tuples might be a preferred format, they are immutable and hashable, and a utility crud function would not need to add and remove things from the tuple. However, in a more sophisticated scaffolding environment, you would add things like a field for password verification or especially remove things, like the ability to change certain fields.

Linux CRM

CRM, or Customer Relationship Management is a class of collaborative applications for enterprises that keep track of prospects, leads, customers, customer complaints, orders and shipments.

CRM, or Customer Relationship Management is a class of collaborative applications for enterprises that keep track of prospects, leads, customers, customer complaints, orders and shipments. Companies wishing to better serve customers in support situations as well as equip their sales force with tools to manage leads and prospects have turned to CRM tools for some time. Many varied computer applications, from ACT for the PC to the ultra sophisticated Siebel Systems corporate customer service applications for mainframes can be categorized under this banner.

Small companies looking for CRM solutions under a linux or Mac platform environment first need to consider how long they can operate in a lone-wolf mode. Applications like ACT, although as portable as their PC, and with ACT’s creation of links to Blackberry, Palm and Windows CE, lacked the integration when a second sales person or customer service person joined the force. For the umteenth time, when it comes to using computers, there are two modes, solo and everything else. With contact management and CRM the Cloud is the ideal environment for contact management.

While there are probably sophisticated contact managers for groups using iPhones, we evaluation programs more along the lines of SugarCRM, an intense cloud based prospect and contact manager that has capabilities to manage every phase of prospecting, closing and selling. While SugarCRM can be downloaded and installed on your Mac or Ubuntu PC, it is an ideal candidate for the cloud. It can be scaled to the growth of your organization for less that $ 1000 per year per user and that is a small price compared to the cost of a years salary. For more information on Atlanta ERP visit MSincs Linux and open source ERP and CRM surveys.