more pythonic

Temoto temotor at
Thu Feb 28 12:40:44 CET 2008


There is a Django application, i need to place all its data into
Access mdb file and send it to user.
It seems to me that params filling for statement could be expressed in
a more beautiful way.
Since i'm very new to Python, i don't feel that, though.

Could you tell your opinion on that snippet?

    sql = """insert into salesmanager
        (employeeid, name, officelocation, departmentname, salary)
        values (?, ?, ?, ?, ?);"""
    params = []
    for manager in Manager.objects.all():
        params.append( (,,,
manager.department, manager.salary) )
    curs.executemany(sql, params)

More information about the Python-list mailing list