feat: add progression models and service structure
This commit is contained in:
+38
-2
@@ -1,3 +1,39 @@
|
||||
from django.db import models
|
||||
# apps/accounts/models.py
|
||||
|
||||
# Create your models here.
|
||||
import uuid
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
||||
class User(AbstractUser):
|
||||
pass
|
||||
|
||||
class PlayerProfile(models.Model):
|
||||
class Visibility(models.TextChoices):
|
||||
PRIVATE = "private", "Privé"
|
||||
LOCAL = "local", "Instance locale"
|
||||
FEDERATED = "federated", "Public et fédéré"
|
||||
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
user = models.OneToOneField(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="player_profile",
|
||||
)
|
||||
handle = models.SlugField(max_length=50, unique=True)
|
||||
display_name = models.CharField(max_length=100)
|
||||
bio = models.TextField(blank=True)
|
||||
avatar = models.ImageField(upload_to="avatars/", blank=True)
|
||||
|
||||
visibility = models.CharField(
|
||||
max_length=16,
|
||||
choices=Visibility.choices,
|
||||
default=Visibility.PRIVATE,
|
||||
)
|
||||
|
||||
# Identifiant stable exposé à la fédération
|
||||
public_id = models.UUIDField(default=uuid.uuid4, unique=True, editable=False)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
Reference in New Issue
Block a user