diff --git a/apps/notifications/admin.py b/apps/notifications/admin.py index 8c38f3f..a530bb8 100644 --- a/apps/notifications/admin.py +++ b/apps/notifications/admin.py @@ -1,3 +1,8 @@ from django.contrib import admin +from apps.notifications.models import Notification +from core.mixins import TabbedTranslationAdmin -# Register your models here. + +@admin.register(Notification) +class NotificationAdmin(TabbedTranslationAdmin): + pass diff --git a/apps/notifications/migrations/0001_initial.py b/apps/notifications/migrations/0001_initial.py new file mode 100644 index 0000000..adf524e --- /dev/null +++ b/apps/notifications/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# Generated by Django 5.0.7 on 2024-08-30 14:57 + +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')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('message', models.CharField(max_length=256)), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/apps/notifications/models.py b/apps/notifications/models.py index 71a8362..c7959af 100644 --- a/apps/notifications/models.py +++ b/apps/notifications/models.py @@ -1,3 +1,9 @@ from django.db import models +from apps.common.models import BaseModel -# Create your models here. + +class Notification(BaseModel): + message = models.CharField(max_length=256) + + def __str__(self): + return self.message diff --git a/apps/notifications/translations.py b/apps/notifications/translations.py new file mode 100644 index 0000000..7c606aa --- /dev/null +++ b/apps/notifications/translations.py @@ -0,0 +1,7 @@ +from modeltranslation.translator import TranslationOptions, register +from apps.notifications.models import Notification + + +@register(Notification) +class NotificationTranslationOptions(TranslationOptions): + fields = ("message",)