Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiANT8406 committed Nov 26, 2023
1 parent 32b1ce9 commit 5432259
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 deletions.
23 changes: 11 additions & 12 deletions adaptive_hockey_federation/main/admin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
from django.contrib import admin

from main.models import (
Anamnesis, Discipline, Health, Location, Player, Position,
RespiratoryFailure, Role, Team,
Anamnesis,
Discipline,
Health,
Location,
Player,
Position,
RespiratoryFailure,
Role,
Team,
)


Expand Down Expand Up @@ -32,15 +38,8 @@ class PlayerInline(admin.TabularInline):
@admin.register(Player)
class PlayerAdmin(admin.ModelAdmin):
inlines = [TeamInline, HealthInline]
fieldsets = [
(
'Персональные данные',
{
'fields': ['name', 'surname', 'patronymic', 'birth_date']
}
),
]
list_display = ['name', 'surname', ]
fields = ['name', 'surname', 'patronymic', 'birth_date']
list_display = ['name', 'surname']
search_fields = ['surname', 'name']


Expand Down
6 changes: 2 additions & 4 deletions adaptive_hockey_federation/main/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from django.db.models import (
BooleanField, CASCADE, CharField, DateField, ForeignKey, ManyToManyField,
Model,
SET_NULL,
UniqueConstraint,
Model, SET_NULL, UniqueConstraint,
)

SEX_CHOICES = (
Expand Down Expand Up @@ -145,7 +143,7 @@ class BasePerson(Model):
patronymic = CharField(
max_length=BASE_PERSON_FIELD_LENGTH,
blank=True,
null=True,
default='',
verbose_name='Отчество',
)

Expand Down
20 changes: 3 additions & 17 deletions adaptive_hockey_federation/users/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
from django.contrib.auth.models import AbstractUser
from django.db.models import (
CharField, DateTimeField, EmailField, ForeignKey, SET_NULL,
)

from django.db.models import SET_NULL, CharField, ForeignKey
from main.models import Team

NAME_MAX_LENGTH = 256
Expand All @@ -23,14 +20,6 @@


class User(AbstractUser):
# username = CharField(
# unique=True,
# max_length=NAME_MAX_LENGTH,
# )
# email = EmailField(
# unique=True,
# max_length=EMAIL_MAX_LENGTH,
# )
phone = CharField(
max_length=PHONE_MAX_LENGTH,
)
Expand All @@ -41,17 +30,14 @@ class User(AbstractUser):
)
first_name = CharField(
max_length=NAME_MAX_LENGTH,
blank=True,
default='',
null=True,
)
last_name = CharField(
max_length=NAME_MAX_LENGTH,
blank=True,
default='',
null=True,
)
# created = DateTimeField(
# auto_now_add=True,
# )
team = ForeignKey(
to=Team,
on_delete=SET_NULL,
Expand Down

0 comments on commit 5432259

Please sign in to comment.