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()