Skip to content

Commit

Permalink
Merge pull request #5 from Tailorie/TA-3223
Browse files Browse the repository at this point in the history
TA-3223: Added Updated_at field in Device Models
  • Loading branch information
Taimoor-hassan authored Jul 5, 2023
2 parents 0046fbe + 728846b commit fa527ed
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion push_notifications/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def disable(self, request, queryset):

class GCMDeviceAdmin(DeviceAdmin):
list_display = (
"__str__", "user", "active", "date_created", "cloud_message_type"
"__str__", "user", "active", "date_created","updated_at","cloud_message_type"
)
list_filter = ("active", "cloud_message_type")
search_fields = ("registration_id", "user__username", "user__email")
Expand Down
33 changes: 33 additions & 0 deletions push_notifications/migrations/0010_auto_20230705_0813.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 3.2.17 on 2023-07-05 08:13

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('push_notifications', '0009_alter_apnsdevice_device_id'),
]

operations = [
migrations.AddField(
model_name='apnsdevice',
name='updated_at',
field=models.DateTimeField(auto_now=True, null=True, verbose_name='Update date'),
),
migrations.AddField(
model_name='gcmdevice',
name='updated_at',
field=models.DateTimeField(auto_now=True, null=True, verbose_name='Update date'),
),
migrations.AddField(
model_name='webpushdevice',
name='updated_at',
field=models.DateTimeField(auto_now=True, null=True, verbose_name='Update date'),
),
migrations.AddField(
model_name='wnsdevice',
name='updated_at',
field=models.DateTimeField(auto_now=True, null=True, verbose_name='Update date'),
),
]
3 changes: 3 additions & 0 deletions push_notifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class Device(models.Model):
),
blank=True, null=True
)
updated_at = models.DateTimeField(
verbose_name=_("Update date"), auto_now=True, null=True
)

class Meta:
abstract = True
Expand Down

0 comments on commit fa527ed

Please sign in to comment.