gestiojeux/inventory/migrations/0003_gameloan.py
sinavir c01ed7cb47 style(pre-commit): Add hook
Python:
- black
- isort (black profile)
- ruff

Nix:
- statix
- nixfmt-rfc-style
- deadnix
2024-07-04 20:47:46 +02:00

52 lines
1.6 KiB
Python

# Generated by Django 4.2.8 on 2024-05-02 09:30
import autoslug.fields
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("inventory", "0002_duration_range"),
]
operations = [
migrations.CreateModel(
name="GameLoan",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"slug",
autoslug.fields.AutoSlugField(
editable=False, populate_from="lent_object", unique=True
),
),
("borrow_date", models.DateTimeField(auto_now_add=True)),
("return_date", models.DateTimeField(null=True)),
("mail", models.EmailField(max_length=254)),
(
"lent_object",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="inventory.game",
verbose_name="jeu emprunté",
),
),
],
options={
"verbose_name": "emprunt",
"verbose_name_plural": "emprunts",
"ordering": ["borrow_date"],
"abstract": False,
},
),
]