Commit 21d0385b authored by Benoit Alessandroni's avatar Benoit Alessandroni

Merge branch 'feature/add-status-on-request' into 'master'

Add status on request.

See merge request !60
parents f6dfa0d9 5763c0f9
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-09-18 09:05
# Generated by Django 1.11.24 on 2019-10-04 11:03
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_countries.fields
import djangoldp.fields
......@@ -15,12 +14,25 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('djangoldp_conversation', '0002_auto_20190917_1056'),
('djangoldp_like', '0001_initial'),
('djangoldp_conversation', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
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.CreateModel(
name='Entrepreneur',
fields=[
......@@ -71,7 +83,6 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('urlid', djangoldp.fields.LDPUrlField(blank=True, null=True, unique=True)),
('phone', models.CharField(blank=True, max_length=25, null=True, verbose_name='Phone number')),
('country', django_countries.fields.CountryField(blank=True, max_length=2)),
('headline', models.CharField(blank=True, max_length=256, verbose_name='Headline or current position')),
('city', models.CharField(blank=True, max_length=256, verbose_name='City')),
('biography', models.TextField(blank=True, verbose_name='Tell us more about your activities')),
......@@ -79,6 +90,7 @@ class Migration(migrations.Migration):
('linkedin', models.CharField(blank=True, max_length=256, null=True, verbose_name='Linkedin account')),
('twitter', models.CharField(blank=True, max_length=256, null=True, verbose_name='Twitter account')),
('registered_on', models.DateTimeField(default=django.utils.timezone.now)),
('country', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mentors', to='coopstarter_data.Country')),
('fields', models.ManyToManyField(blank=True, to='coopstarter_data.Field')),
('languages', models.ManyToManyField(blank=True, to='coopstarter_data.Language')),
],
......@@ -103,13 +115,14 @@ class Migration(migrations.Migration):
('urlid', djangoldp.fields.LDPUrlField(blank=True, null=True, unique=True)),
('name', models.CharField(max_length=32, verbose_name='Title')),
('description', models.TextField(verbose_name='Description')),
('country', django_countries.fields.CountryField(blank=True, max_length=2, verbose_name='Country of publication')),
('status', models.TextField(default='untreated', verbose_name='Status')),
('skills', models.TextField(verbose_name='Learning outcomes/skills')),
('target', models.CharField(blank=True, choices=[('mentor', 'Mentor'), ('entrepreneur', 'Entrepreneur'), ('public', 'Public')], max_length=32, null=True, verbose_name='Target audience')),
('created_on', models.DateTimeField(default=django.utils.timezone.now)),
('country', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Country')),
('fields', models.ManyToManyField(blank=True, to='coopstarter_data.Field')),
('language', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Language', verbose_name='Language')),
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Organisation')),
('organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='coopstarter_data.Organisation')),
('submitter', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='requests', to=settings.AUTH_USER_MODEL)),
],
options={
......@@ -123,7 +136,6 @@ class Migration(migrations.Migration):
('urlid', djangoldp.fields.LDPUrlField(blank=True, null=True, unique=True)),
('name', models.CharField(max_length=32, verbose_name='Title')),
('publication_year', models.IntegerField(verbose_name='Publication Year')),
('country', django_countries.fields.CountryField(blank=True, max_length=2, verbose_name='Country of publication')),
('uri', models.CharField(max_length=4086, verbose_name='Location/weblink')),
('author', models.CharField(max_length=32, verbose_name='Author')),
('skills', models.TextField(verbose_name='Learning outcomes/skills')),
......@@ -133,9 +145,10 @@ class Migration(migrations.Migration):
('target', models.CharField(blank=True, choices=[('mentor', 'Mentor'), ('entrepreneur', 'Entrepreneur'), ('public', 'Public')], max_length=32, null=True, verbose_name='Target audience')),
('sharing', models.CharField(blank=True, choices=[('private', 'Private (nobody)'), ('public', 'Public (everybody)')], max_length=32, null=True, verbose_name='Sharing profile')),
('conversations', models.ManyToManyField(blank=True, related_name='resources', to='djangoldp_conversation.Conversation')),
('country', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Country')),
('fields', models.ManyToManyField(blank=True, related_name='resources', to='coopstarter_data.Field')),
('format', models.ManyToManyField(blank=True, related_name='resources', to='coopstarter_data.Format')),
('language', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Language', verbose_name='Language')),
('format', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='coopstarter_data.Format')),
('language', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='coopstarter_data.Language', verbose_name='Language')),
('likes', models.ManyToManyField(blank=True, related_name='resources', to='djangoldp_like.Like')),
('related', models.ManyToManyField(blank=True, related_name='_resource_related_+', to='coopstarter_data.Resource')),
],
......@@ -147,7 +160,7 @@ class Migration(migrations.Migration):
('urlid', djangoldp.fields.LDPUrlField(blank=True, null=True, unique=True)),
('comment', models.TextField(blank=True, verbose_name='Comment')),
('status', models.CharField(blank=True, choices=[('pending', 'Pending'), ('inappropriate', 'Inappropriate'), ('validated', 'Validated'), ('to_improve', 'Improvement required')], max_length=32, null=True, verbose_name='Resource status')),
('reviewer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reviews', to=settings.AUTH_USER_MODEL)),
('reviewer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reviews', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
......@@ -194,7 +207,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='mentor',
name='organisation',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Organisation'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mentors', to='coopstarter_data.Organisation'),
),
migrations.AddField(
model_name='mentor',
......@@ -204,7 +217,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='entrepreneur',
name='organisation',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='coopstarter_data.Organisation'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='entrepreneurs', to='coopstarter_data.Organisation'),
),
migrations.AddField(
model_name='entrepreneur',
......
# -*- 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-04 11:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coopstarter_data', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='request',
name='status',
field=models.TextField(choices=[('untreated', 'Untreated'), ('dealt-with', 'Dealt With')], default='untreated', verbose_name='Status'),
),
]
# -*- 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-09 09:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coopstarter_data', '0002_auto_20191004_1106'),
]
operations = [
migrations.AlterField(
model_name='request',
name='status',
field=models.TextField(choices=[('pending', 'Pending'), ('validated', 'Validated')], default='pending', verbose_name='Status'),
),
]
# -*- 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),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-10-09 09:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coopstarter_data', '0003_auto_20191009_0922'),
]
operations = [
migrations.AlterField(
model_name='request',
name='status',
field=models.CharField(choices=[('pending', 'Pending'), ('validated', 'Validated')], default='pending', max_length=32, verbose_name='Status'),
),
]
......@@ -188,6 +188,7 @@ class Request (Model):
# Mandatory Fields
name = models.CharField(max_length=128, verbose_name="Title")
description = models.TextField(verbose_name="Description")
status = models.CharField(max_length=32, verbose_name="Status", choices=(('pending', 'Pending'), ('validated', 'Validated')), default="pending")
language = models.ForeignKey(Language, blank=True, verbose_name="Language")
fields = models.ManyToManyField(Field, blank=True)
......@@ -204,10 +205,9 @@ class Request (Model):
ordering = ['-created_on']
auto_author='submitter'
anonymous_perms = ['view']
authenticated_perms = ['inherit', 'add']
authenticated_perms = ['inherit', 'add', 'change']
owner_field = 'submitter'
serializer_fields=["@id", "name", "description", "skills", "fields", "language",\
"organisation", "submitter", "created_on", "target", "country"]
serializer_fields=["@id", "name", "description", "status", "skills", "fields", "language", "organisation", "submitter", "created_on", "target", "country"]
owner_perms = ['inherit', 'change', 'control', 'delete']
nested_fields=["language", "fields", "organisation", "submitter", "country"]
container_path = 'requests/'
......
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