from django.contrib.auth.models import User
class Drink(models.Model):
owner = models.ForeignKey(User)
name = models.CharField(max_length=50)
用户注销后如何删除所有饮料?
def delete_drink(request):
user = request.user
drink = Drink.objects.filter(owner=user)
drink.delete()