# Simple mixin
module Loggable
def log(message)
puts "[#{Time.now}] #{self.class.name}: #{message}"
end
end
from django.core.exceptions import PermissionDenied
class UserOwnershipMixin:
"""Ensure the object belongs to the current user."""
from django.conf import settings
from django.db import models
from django.utils import timezone
class InvoiceQuerySet(models.QuerySet):