update: add author url field

This commit is contained in:
Matthieu Fesselier 2019-02-28 08:21:03 +07:00
parent 41f15006db
commit 5efe57f366
3 changed files with 7 additions and 5 deletions

View File

@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-01-15 10:40
# Generated by Django 1.11 on 2019-02-28 01:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import djangoldp.fields
class Migration(migrations.Migration):
@ -20,7 +21,7 @@ class Migration(migrations.Migration):
name='Notification',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('author_user', models.URLField()),
('author_user', djangoldp.fields.LDPUrlField()),
('object', models.URLField()),
('type', models.CharField(max_length=255)),
('summary', models.TextField()),

View File

@ -4,6 +4,7 @@
# from threading import Thread
from django.db import models
from django.conf import settings
from djangoldp.fields import LDPUrlField
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
@ -11,7 +12,7 @@ from django.contrib.admin.models import LogEntry
class Notification(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='inbox')
author_user = models.URLField()
author_user = LDPUrlField()
object = models.URLField()
type = models.CharField(max_length=255)
summary = models.TextField()

View File

@ -2,9 +2,9 @@
from django.conf.urls import url
from .models import Notification, Subscription
from djangoldp.views import LDPViewSet
from djangoldp.permissions import InboxPermissions
#from djangoldp.permissions import InboxPermissions
urlpatterns = [
url(r'^notifications/', LDPViewSet.urls(model=Notification, permission_classes=(InboxPermissions,))),
url(r'^notifications/', LDPViewSet.urls(model=Notification)), #permission_classes=(InboxPermissions,))),
url(r'^subscriptions/', LDPViewSet.urls(model=Subscription)),
]