3fefc550fe
- Django backend with DRF (clubs, wrestlers, trainers, exercises, templates, trainings, homework, locations, leistungstest) - Next.js 16 frontend with React, Shadcn UI, Tailwind - JWT authentication - Full CRUD for all entities - Calendar view for trainings - Homework management system - Leistungstest tracking
21 lines
635 B
Python
21 lines
635 B
Python
from django.db import models
|
|
|
|
|
|
class Location(models.Model):
|
|
name = models.CharField(max_length=200)
|
|
address = models.TextField(blank=True)
|
|
club = models.ForeignKey('clubs.Club', on_delete=models.CASCADE, related_name='locations', null=True, blank=True)
|
|
is_active = models.BooleanField(default=True)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
class Meta:
|
|
ordering = ['name']
|
|
verbose_name_plural = 'Locations'
|
|
indexes = [
|
|
models.Index(fields=['club']),
|
|
]
|
|
|
|
def __str__(self):
|
|
return self.name
|