From 69bdfb2ca6d850a2748af1de855f217e1c28f17d Mon Sep 17 00:00:00 2001 From: Matthieu Fesselier Date: Tue, 7 May 2019 17:01:26 +0800 Subject: [PATCH] syntax: rename author_user in author --- djangoldp_notification/factories.py | 2 +- .../migrations/0005_auto_20190507_0858.py | 20 +++++++++++++++++++ djangoldp_notification/models.py | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 djangoldp_notification/migrations/0005_auto_20190507_0858.py diff --git a/djangoldp_notification/factories.py b/djangoldp_notification/factories.py index a3aa207..e36dd62 100644 --- a/djangoldp_notification/factories.py +++ b/djangoldp_notification/factories.py @@ -11,7 +11,7 @@ class NotificationFactory(factory.django.DjangoModelFactory): type = factory.Faker('text', max_nb_chars=50) summary = factory.Faker('paragraph', nb_sentences=3, variable_nb_sentences=True) - author_user = factory.Faker('url') + author = factory.Faker('url') user = factory.Iterator(settings.AUTH_USER_MODEL.objects.all()) date = factory.Faker('past_datetime') unread = factory.Faker('boolean') diff --git a/djangoldp_notification/migrations/0005_auto_20190507_0858.py b/djangoldp_notification/migrations/0005_auto_20190507_0858.py new file mode 100644 index 0000000..5fcaaa8 --- /dev/null +++ b/djangoldp_notification/migrations/0005_auto_20190507_0858.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11 on 2019-05-07 08:58 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_notification', '0004_auto_20190425_1141'), + ] + + operations = [ + migrations.RenameField( + model_name='notification', + old_name='author_user', + new_name='author', + ), + ] diff --git a/djangoldp_notification/models.py b/djangoldp_notification/models.py index 1f92f14..7e02b7e 100644 --- a/djangoldp_notification/models.py +++ b/djangoldp_notification/models.py @@ -19,7 +19,7 @@ from djangoldp.permissions import InboxPermissions class Notification(Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='inbox', on_delete=models.deletion.CASCADE) - author_user = LDPUrlField() + author = LDPUrlField() object = LDPUrlField() type = models.CharField(max_length=255) summary = models.TextField()