-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ [#990] Refactor some code based on feedback
- Loading branch information
Showing
7 changed files
with
39 additions
and
41 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
18 changes: 18 additions & 0 deletions
18
src/sdg/producten/migrations/0060_alter_notificationviewed_last_viewed_date.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 3.2.23 on 2024-11-15 16:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("producten", "0059_notificationviewed"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="notificationviewed", | ||
name="last_viewed_date", | ||
field=models.DateTimeField(auto_now=True), | ||
), | ||
] |
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.db import models | ||
from django.utils import timezone | ||
|
||
User = get_user_model() | ||
|
||
|
||
class NotificationViewed(models.Model): | ||
gebruiker = models.OneToOneField(User, on_delete=models.CASCADE) | ||
last_viewed_date = models.DateTimeField(null=True, blank=True) | ||
last_viewed_date = models.DateTimeField(auto_now=True) | ||
|
||
def __str__(self): | ||
return ( | ||
f"{self.gebruiker} - Notification last viewed on: {self.last_viewed_date}" | ||
) | ||
return f"User: {self.gebruiker_id} - Notification last viewed on: {self.last_viewed_date}" |
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