Refactor accounts app into authentication and club apps
- Split the accounts app into new authentication and club apps for better separation of concerns. - Migrate the custom User, Member, and Family models to the authentication app. - Introduce Club and ClubMembership models in the club app. - Refactor Family model to use UUID as the primary key and consolidate family-role relationships into a new FamilyMembership model. - Update tests, managers, and migrations to align with the new structure.
This commit is contained in:
0
club/__init__.py
Normal file
0
club/__init__.py
Normal file
3
club/admin.py
Normal file
3
club/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
5
club/apps.py
Normal file
5
club/apps.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ClubConfig(AppConfig):
|
||||
name = 'club'
|
||||
0
club/migrations/__init__.py
Normal file
0
club/migrations/__init__.py
Normal file
20
club/models.py
Normal file
20
club/models.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from clubmanager.base import ClubScopedModel, UUIDModel
|
||||
|
||||
|
||||
class Club(UUIDModel):
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("club")
|
||||
verbose_name_plural = _("clubs")
|
||||
ordering = ["name"]
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
|
||||
class ClubMembership(UUIDModel): ...
|
||||
3
club/tests.py
Normal file
3
club/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
club/views.py
Normal file
3
club/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user