test/sabron/mixins/abstract_model.py
zakhy 8c4f160253 Форматирование кода под PEP8
Не убраны неиспользованные импорты
2025-02-26 11:50:11 +07:00

16 lines
479 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import uuid
from django.db import models
class AbstractUUID(models.Model):
"""Абстрактная модель для использования UUID в качестве PK."""
# Параметр blank=True позволяет работать с формами, он никогда не
# будет пустым, см. метод save()
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
class Meta:
abstract = True