开发者

Deleting a record from database using Python

I have created a Django app and tested the application's performance by populating some 10,0000 records. Now i want to delete it using a python script. Can somebody help me in doing this. This is the script i created to populate data into sql db.

def dumpdata():
    for i in rang开发者_如何学Ce(2,10):
        userName = "Bryan"    
        designation = 'Technician '
        employeeID = 2312         
        dateOfJoin = '2009-10-10'    
        EmployeeDetails(userName= "Bryan",designation= 'Technician',employeeID= 2312,dateOfJoin= '2009-10-10').save()

dumpdata() 


QuerySet.delete()

EmployeeDetails.objects.filter(...).delete()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜