Merge branch 'master' into 'subscription-system'
# Conflicts: # djangoldp_notification/urls.py
This commit is contained in:
commit
96ca91e90b
@ -1,10 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- 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 __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
import djangoldp.fields
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -20,7 +21,7 @@ class Migration(migrations.Migration):
|
|||||||
name='Notification',
|
name='Notification',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('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()),
|
('object', models.URLField()),
|
||||||
('type', models.CharField(max_length=255)),
|
('type', models.CharField(max_length=255)),
|
||||||
('summary', models.TextField()),
|
('summary', models.TextField()),
|
||||||
|
21
djangoldp_notification/migrations/0002_auto_20190301_0418.py
Normal file
21
djangoldp_notification/migrations/0002_auto_20190301_0418.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11 on 2019-03-01 04:18
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import djangoldp.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('djangoldp_notification', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='notification',
|
||||||
|
name='object',
|
||||||
|
field=djangoldp.fields.LDPUrlField(),
|
||||||
|
),
|
||||||
|
]
|
@ -4,6 +4,7 @@ import datetime
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from djangoldp.fields import LDPUrlField
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
@ -12,8 +13,8 @@ from djangoldp.models import Model
|
|||||||
|
|
||||||
class Notification(models.Model):
|
class Notification(models.Model):
|
||||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='inbox')
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='inbox')
|
||||||
author_user = models.URLField()
|
author_user = LDPUrlField()
|
||||||
object = models.URLField()
|
object = LDPUrlField()
|
||||||
type = models.CharField(max_length=255)
|
type = models.CharField(max_length=255)
|
||||||
summary = models.TextField()
|
summary = models.TextField()
|
||||||
date = models.DateTimeField(auto_now_add=True)
|
date = models.DateTimeField(auto_now_add=True)
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from .models import Notification, Subscription
|
from .models import Notification, Subscription
|
||||||
from djangoldp.views import LDPViewSet
|
from djangoldp.views import LDPViewSet
|
||||||
|
#from djangoldp.permissions import InboxPermissions
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^notifications/', LDPViewSet.urls(model=Notification, permission_classes=[])),
|
url(r'^notifications/', LDPViewSet.urls(model=Notification)), #permission_classes=(InboxPermissions,))),
|
||||||
url(r'^subscriptions/', LDPViewSet.urls(model=Subscription)),
|
url(r'^subscriptions/', LDPViewSet.urls(model=Subscription)),
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user