-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(user notification): user should be able to recieve notification
- create app notifications - create directory tests - update urls.py - make migrations - add tests - update migrations - add get notification on new follow - add get notification on like or dislike [finishes#165273483]
- Loading branch information
Showing
20 changed files
with
568 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class NotificationsConfig(AppConfig): | ||
name = 'notifications' |
41 changes: 41 additions & 0 deletions
41
authors/apps/notifications/fixtures/notification_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[ | ||
{ | ||
"model": "authentication.user", | ||
"pk": 2, | ||
"fields": { | ||
"username": "ednan", | ||
"email": "3dnamargarita@gmail.com", | ||
"email_verified": true, | ||
"password": "pbkdf2_sha256$120000$hnVeYt1oA4Z9$F64DTDJ9ChmjxhMvZbJm0WGYmzpqg2+7oib+ZE5MV8E=", | ||
"created_at": "2013-03-23 00:03:00", | ||
"updated_at": "2013-03-23 01:02:00" | ||
} | ||
}, | ||
{ | ||
"model": "articles.article", | ||
"pk": 1, | ||
"fields": { | ||
"title": "Town hall at Andela", | ||
"description": "There was lots of fun", | ||
"body": "There was no TIA chant.", | ||
"slug": "town-hall-at-andela", | ||
"created_at": "2019-05-02T05:03:36.898328Z", | ||
"updated_at": "2019-05-02T05:03:36.898341Z", | ||
"favorited": false, | ||
"favorite_count": 0, | ||
"author": "ednan" | ||
} | ||
}, | ||
{ | ||
"model": "authentication.user", | ||
"pk": 1, | ||
"fields": { | ||
"username": "joell", | ||
"email": "joell@gmail.com", | ||
"email_verified": true, | ||
"password": "pbkdf2_sha256$120000$hnVeYt1oA4Z9$F64DTDJ9ChmjxhMvZbJm0WGYmzpqg2+7oib+ZE5MV8E=", | ||
"created_at": "2013-03-23 00:03:00", | ||
"updated_at": "2013-03-23 01:02:00" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 2.1 on 2019-05-09 07:37 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='UserNotification', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('message', models.CharField(max_length=255, null=True)), | ||
('link', models.CharField(max_length=255, null=True)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('reciever', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, to_field='username')), | ||
], | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
authors/apps/notifications/migrations/0002_notificationsetting.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 2.1 on 2019-05-10 01:30 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('notifications', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='NotificationSetting', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('get_notification', models.BooleanField(default=True)), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, to_field='username')), | ||
], | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
authors/apps/notifications/migrations/0003_usernotification_read.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.1 on 2019-05-14 11:17 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('notifications', '0002_notificationsetting'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='usernotification', | ||
name='read', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
Empty file.
Oops, something went wrong.