This commit is contained in:
Data-Name-ID
2024-04-01 18:00:52 +03:00
parent 1b84b746d1
commit 268a541466
14 changed files with 126 additions and 32 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
from django.contrib import admin
from notifications import models
from notifications.forms import (
from api.notifications import models
from api.notifications.forms import (
CreateNotificationAdminForm,
EditNotificationAdminForm,
)
+1 -1
View File
@@ -1,5 +1,5 @@
from django import forms
from notifications.models import Notification
from api.notifications.models import Notification
class EditNotificationAdminForm(forms.ModelForm):
@@ -0,0 +1,24 @@
# Generated by Django 5.0.3 on 2024-04-01 14:59
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Notification',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=150)),
('content', models.TextField(verbose_name='content')),
('read', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
]
@@ -0,0 +1,23 @@
# Generated by Django 5.0.3 on 2024-04-01 14:59
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('notifications', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='notification',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL),
),
]