Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base models #24

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 77 additions & 2 deletions adaptive_hockey_federation/main/models.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Стилистические правки:

  1. Сделать переносы строк при передачи каждого параметра
  2. Добавить запятую у последнего параметра

Например:

team = models.ForeignKey(
    Team, on_delete=models.SET_NULL,
    blank=True, null=True,
    verbose_name='Команда'
)

переписать так:

team = models.ForeignKey(
    to=Team,
    on_delete=models.SET_NULL,
    blank=True,
    null=True,
    verbose_name='Команда',  # Тут запятая на конце
)  # Каждый параметр с новой стоки

Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
from django.db import models # noqa
from django.db import models

# Create your models here.

class Team(models.Model):
"""Класс команды
"""
name = models.CharField(
max_length=256,
verbose_name='Название',
)

class Meta:
verbose_name = 'Команда'
verbose_name_plural = 'Команды'

def __str__(self):
return self.name


class Position(models.Model):
"""Позиция в команде
"""
name = models.CharField(
max_length=256,
verbose_name='Название',
)

class Meta:
verbose_name = 'Позиция'
verbose_name_plural = 'Позиции'

def __str__(self):
return self.name


class BaseUserInfo(models.Model):
"""Класс игрока
"""
CLS_CHOICES = [
('A', 'A'),
('A2', 'A2'),
('B', 'B'),
('B2', 'B2'),
('C', 'C'),
('C2', 'C2'),
]
name = models.CharField(
max_length=56,
verbose_name='Имя',
)
surname = models.CharField(
max_length=56,
)
date_of_birth = models.DateTimeField(
verbose_name='Дата рождения',
)
team = models.ForeignKey(
to=Team,
on_delete=models.SET_NULL,
blank=True,
null=True,
verbose_name='Команда',
)
position = models.ForeignKey(
to=Team,
on_delete=models.SET_NULL,
blank=True,
null=True,
verbose_name='Позиция',
)
classification = models.CharField(
max_length=255,
choices=CLS_CHOICES,
default=None,
)

def __str__(self):
return self.name
Loading