10 changed files with 343 additions and 63 deletions
-
57apps/account/migrations/0008_auto_20250316_1247.py
-
31apps/account/migrations/0009_auto_20250316_1319.py
-
18apps/account/migrations/0010_loginhistory_timezone.py
-
15apps/account/models/notification.py
-
77apps/account/models/user.py
-
6apps/account/serializers/notification.py
-
38apps/account/serializers/user.py
-
1apps/account/urls.py
-
58apps/account/views/notification.py
-
105apps/account/views/user.py
@ -0,0 +1,57 @@ |
|||
# Generated by Django 3.2.7 on 2025-03-16 12:47 |
|||
|
|||
from django.conf import settings |
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('account', '0007_notification'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='notification', |
|||
name='service', |
|||
field=models.CharField(choices=[('imam-javad', 'Imam Javad'), ('doboodi', 'Doboodi')], default='imam-javad', max_length=20, verbose_name='service'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='user', |
|||
name='device_os', |
|||
field=models.CharField(choices=[('android', 'android'), ('apple', 'apple')], max_length=16, null=True), |
|||
), |
|||
migrations.AddField( |
|||
model_name='user', |
|||
name='username', |
|||
field=models.CharField(blank=True, max_length=150, null=True, unique=True), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='user', |
|||
name='email', |
|||
field=models.EmailField(blank=True, help_text="Enter the user's email address.", max_length=254, null=True, unique=True, verbose_name='Email Address'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='user', |
|||
name='fullname', |
|||
field=models.CharField(blank=True, help_text='Enter the full name of the user.', max_length=255, null=True, verbose_name='Full Name'), |
|||
), |
|||
migrations.AlterUniqueTogether( |
|||
name='user', |
|||
unique_together={('email', 'device_id')}, |
|||
), |
|||
migrations.CreateModel( |
|||
name='LocationHistory', |
|||
fields=[ |
|||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('lat', models.FloatField(blank=True, null=True, verbose_name='lat')), |
|||
('lon', models.FloatField(blank=True, null=True, verbose_name='lon')), |
|||
('country', models.CharField(blank=True, max_length=255, null=True, verbose_name='country')), |
|||
('city', models.CharField(blank=True, max_length=255, null=True, verbose_name='city')), |
|||
('ip', models.CharField(max_length=255, null=True)), |
|||
('at_time', models.DateTimeField(auto_now_add=True)), |
|||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='location_history', to=settings.AUTH_USER_MODEL)), |
|||
], |
|||
), |
|||
] |
|||
@ -0,0 +1,31 @@ |
|||
# Generated by Django 3.2.7 on 2025-03-16 13:19 |
|||
|
|||
from django.conf import settings |
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('account', '0008_auto_20250316_1247'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='LoginHistory', |
|||
fields=[ |
|||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('lat', models.FloatField(blank=True, null=True, verbose_name='lat')), |
|||
('lon', models.FloatField(blank=True, null=True, verbose_name='lon')), |
|||
('country', models.CharField(blank=True, max_length=255, null=True, verbose_name='country')), |
|||
('city', models.CharField(blank=True, max_length=255, null=True, verbose_name='city')), |
|||
('ip', models.CharField(max_length=255, null=True)), |
|||
('at_time', models.DateTimeField(auto_now_add=True)), |
|||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='login_history', to=settings.AUTH_USER_MODEL)), |
|||
], |
|||
), |
|||
migrations.DeleteModel( |
|||
name='LocationHistory', |
|||
), |
|||
] |
|||
@ -0,0 +1,18 @@ |
|||
# Generated by Django 3.2.7 on 2025-03-16 13:54 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('account', '0009_auto_20250316_1319'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='loginhistory', |
|||
name='timezone', |
|||
field=models.CharField(blank=True, max_length=100, null=True), |
|||
), |
|||
] |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue