Introduce the foundational accounts app: - Custom email-as-username User (AbstractBaseUser + PermissionsMixin) set as AUTH_USER_MODEL, decoupled from membership so children can be members without a login. - Member model holding personal/roster data (names, contact email, phone + emergency phone via django-phonenumber-field, license number, DOB) with an optional link to a User. - Family household grouping and directional Guardianship (guardian -> child) with uniqueness and no-self-guardian constraints. - Custom UserAdmin plus Member/Family admin with inlines and autocomplete. - Settings: register apps, AUTH_USER_MODEL, phonenumber defaults (BE/E164). - Add CLAUDE.md and a tracked static/ directory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
433 B
Python
17 lines
433 B
Python
from django.contrib.auth.forms import BaseUserCreationForm
|
|
from django.contrib.auth.forms import UserChangeForm as BaseUserChangeForm
|
|
|
|
from .models import User
|
|
|
|
|
|
class UserCreationForm(BaseUserCreationForm):
|
|
class Meta(BaseUserCreationForm.Meta):
|
|
model = User
|
|
fields = ("email",)
|
|
|
|
|
|
class UserChangeForm(BaseUserChangeForm):
|
|
class Meta(BaseUserChangeForm.Meta):
|
|
model = User
|
|
fields = "__all__"
|