以数据表User
为例:
class User(models.Model):
username = models.CharField(max_length=200)
password = models.CharField(max_length=200)
增:
User.objects.create(username='Isabella', password='123456')
查:
User.objects.filter(username='Isabella')
改:
User.objects.filter(username='Isabella').update(password='1234')
删:
User.objects.filter(username='Isabella').delete()