Merge branch 'improve-model' into 'master'
update: Improve model naming See merge request startinblox/djangoldp-packages/djangoldp-notifications!2
This commit is contained in:
commit
0bed247ead
@ -1,5 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by Django 1.11 on 2019-01-08 08:32
|
# Generated by Django 1.11 on 2019-01-11 08:04
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -25,12 +25,12 @@ class Migration(migrations.Migration):
|
|||||||
('summary', models.TextField()),
|
('summary', models.TextField()),
|
||||||
('date', models.DateTimeField(auto_now_add=True)),
|
('date', models.DateTimeField(auto_now_add=True)),
|
||||||
('read', models.BooleanField()),
|
('read', models.BooleanField()),
|
||||||
('author_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='author', to=settings.AUTH_USER_MODEL)),
|
('author_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications_sent', to=settings.AUTH_USER_MODEL)),
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user', to=settings.AUTH_USER_MODEL)),
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications_received', to=settings.AUTH_USER_MODEL)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ['date'],
|
'ordering': ['date'],
|
||||||
'permissions': (('view_notification', 'Read'), ('control_notification', 'Control')),
|
'permissions': (('view_notification', 'Read'), ('control_notification', 'Control')),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
@ -3,14 +3,15 @@ from django.conf import settings
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
class Notification(models.Model):
|
class Notification(models.Model):
|
||||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='user')
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='notifications_received')
|
||||||
author_user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='author')
|
author_user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='notifications_sent')
|
||||||
object = models.URLField()
|
object = models.URLField()
|
||||||
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)
|
||||||
read = models.BooleanField()
|
read = models.BooleanField()
|
||||||
class Meta:
|
class Meta:
|
||||||
|
rdf_type = 'sib:source'
|
||||||
permissions = (
|
permissions = (
|
||||||
('view_notification', 'Read'),
|
('view_notification', 'Read'),
|
||||||
('control_notification', 'Control'),
|
('control_notification', 'Control'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user