video player and model and video guide routing and stuff

This commit is contained in:
Parsa Nazer
2025-02-16 21:42:29 +03:30
parent d8f7be7772
commit 81df30c806
28 changed files with 531 additions and 25 deletions
+2 -1
View File
@@ -9,7 +9,7 @@ from django.contrib.postgres.fields import ArrayField
from django.contrib.auth.models import Group
from unfold.forms import AdminPasswordChangeForm
from unfold.forms import AdminPasswordChangeForm, UserChangeForm, UserCreationForm
from utils.admin import ModelAdmin
class UserAddressInLine(TabularInline):
model = UserAddressModel
extra = 0
@@ -36,6 +36,7 @@ class UserAdmin(BaseUserAdmin, ModelAdmin, ImportExportModelAdmin):
fieldsets = (
('اطلاعات شخصی', {'fields': ('first_name', 'last_name', 'profile_photo', 'password', 'gender', 'birth_date'),}),
('اطلاعات ارتباطی', {'fields': ('phone', 'email'),}),
('دسترسی های وبسایت', {'fields': ('is_superuser', 'video_uploader'),}),
)
empty_value_display = 'ثبت نشده'
add_fieldsets = (
@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2025-02-14 22:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0010_useraddressmodel_is_main'),
]
operations = [
migrations.AddField(
model_name='user',
name='video_uploader',
field=models.BooleanField(default=False),
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2025-02-14 23:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0011_user_video_uploader'),
]
operations = [
migrations.AlterField(
model_name='user',
name='video_uploader',
field=models.BooleanField(default=False, help_text='اپلود کننده ی ویدیویی اموزشی پنل ادمین', verbose_name='اپلودر اموزش'),
),
]
+1
View File
@@ -50,6 +50,7 @@ class User(AbstractBaseUser, PermissionsMixin):
date_joined = models.DateTimeField(auto_now_add=True, verbose_name='تاریخ ثبتنام')
otp_hash = models.CharField(max_length=64, null=True, blank=True, verbose_name='کد یک بار مصرف')
otp_expiry = models.DateTimeField(null=True, blank=True, verbose_name='تاریخ تمام شدن کد یک بار مصرف')
video_uploader = models.BooleanField(default=False, help_text='اپلود کننده ی ویدیویی اموزشی پنل ادمین', verbose_name='اپلودر اموزش')
objects = UserManager()
USERNAME_FIELD = 'phone'