Commit 9fa7c58b authored by Alice's avatar Alice

Patch the brokenLinks class.

parent fa61a51c
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-10-02 18:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('coopstarter_data', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='request',
name='organisation',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='coopstarter_data.Organisation'),
),
migrations.RemoveField(
model_name='resource',
name='format',
),
migrations.AddField(
model_name='resource',
name='format',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='coopstarter_data.Format'),
),
migrations.AlterField(
model_name='resource',
name='language',
field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='coopstarter_data.Language', verbose_name='Language'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-10-03 11:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import djangoldp.fields
class Migration(migrations.Migration):
dependencies = [
('coopstarter_data', '0002_auto_20191002_1840'),
]
operations = [
migrations.CreateModel(
name='Country',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('urlid', djangoldp.fields.LDPUrlField(blank=True, null=True, unique=True)),
('code', models.CharField(max_length=2, verbose_name='ISO Code')),
('name', models.CharField(max_length=64, verbose_name='Country name')),
],
options={
'abstract': False,
'default_permissions': ('add', 'change', 'delete', 'view', 'control'),
},
),
migrations.AlterField(
model_name='mentor',
name='country',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Country'),
),
migrations.AlterField(
model_name='request',
name='country',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Country'),
),
migrations.AlterField(
model_name='resource',
name='country',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Country'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-10-03 14:59
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('coopstarter_data', '0003_auto_20191003_1155'),
]
operations = [
migrations.AlterField(
model_name='entrepreneur',
name='organisation',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='entrepreneurs', to='coopstarter_data.Organisation'),
),
migrations.AlterField(
model_name='mentor',
name='country',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mentors', to='coopstarter_data.Country'),
),
migrations.AlterField(
model_name='mentor',
name='organisation',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mentors', to='coopstarter_data.Organisation'),
),
migrations.AlterField(
model_name='review',
name='reviewer',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reviews', to=settings.AUTH_USER_MODEL),
),
]
......@@ -219,7 +219,7 @@ class Request (Model):
return self.name
class BrokenLink(Model):
submitter = models.OneToOneField(settings.AUTH_USER_MODEL, related_name="brokenlink_submitter")
submitter = models.ForeignKey(settings.AUTH_USER_MODEL, related_name="brokenlink_submitter")
resource_id = models.ForeignKey(Resource, null=True, on_delete=models.CASCADE, related_name="resource_id")
class Meta:
......@@ -230,8 +230,8 @@ class BrokenLink(Model):
authenticated_perms = ['inherit', 'add']
serializer_fields=["@id", "submitter", "resource_id"]
nested_fields=["submitter", "resource_id"]
container_path = 'brokenlink/'
rdf_type = 'coopstarter:brokenlink'
container_path = 'brokenlinks/'
rdf_type = 'coopstarter:brokenlinks'
def __str__(self):
return self.user.get_full_name()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment