Commit 01e8af6d authored by Benoit Alessandroni's avatar Benoit Alessandroni

Updating the model and testing a CI/CD fix

parent 07b1ef5c
......@@ -2,6 +2,18 @@ from django.contrib import admin
from .models import Resource
from .models import Step
from .models import Field
from .models import Format
from .models import Entrepreneur
from .models import Mentor
from .models import Organisation
from .models import Language
from django.db import models
from djangoldp.models import Model
from django.conf import settings
from django_countries.fields import CountryField
class Language (Model):
code = models.CharField(max_length=2, verbose_name="ISO Code")
name = models.CharField(max_length=64, verbose_name="Language name")
def __str__(self):
class Organisation (Model):
name = models.CharField(max_length=128, verbose_name="Name")
website = models.CharField(max_length=4096, verbose_name="Website")
def __str__(self):
class Entrepreneur(Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
organisation = models.ForeignKey(Organisation, on_delete=models.CASCADE)
def __str__(self):
return self.user.get_full_name()
class Mentor(Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
phone = models.CharField(max_length=25, null=True, blank=True, verbose_name='Phone number')
organisation = models.ForeignKey(Organisation, on_delete=models.CASCADE)
country = CountryField(blank=True)
language = models.ForeignKey(Language, blank=True)
def __str__(self):
return self.user.get_full_name()
class Step (Model):
title = models.CharField(max_length=128, verbose_name="Title")
......@@ -8,14 +41,27 @@ class Step (Model):
def __str__(self):
return self.title
class Format (Model):
title = models.CharField(max_length=128, verbose_name="Title")
def __str__(self):
return self.title
class Field (Model):
title = models.CharField(max_length=128, verbose_name="Title")
def __str__(self):
return self.title
class Resource (Model):
# Mandatory Fields
title = models.CharField(max_length=32, verbose_name="Title")
format = models.CharField(max_length=10, choices=(('pdf', 'PDF'), ('video', 'Vidéo'),('document', 'Document'),('image', 'Image') ), verbose_name="Format")
format = models.ManyToManyField(Format, blank=True)
publication_year = models.IntegerField(verbose_name="Publication Year")
language = models.CharField(max_length=32, verbose_name="Language")
field = models.CharField(max_length=32, verbose_name="Field")
country = models.CharField(max_length=32, verbose_name="Country of publication")
language = models.ForeignKey(Language, blank=True, verbose_name="Language")
field = models.ManyToManyField(Field, blank=True)
country = CountryField(verbose_name="Country of publication", blank=True)
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")
......@@ -28,7 +74,7 @@ class Resource (Model):
#image = models.ImageField(blank=True, null=True, verbose_name="Photo")
#Classification Fields
target = models.CharField(max_length=32, choices=(('mentor', 'Mentor'), ('entrepreneur', 'Entrepreneur'), ('public', 'public')), verbose_name="Target audience")
target = models.CharField(max_length=32, choices=(('mentor', 'Mentor'), ('entrepreneur', 'Entrepreneur'), ('public', 'public')), verbose_name="Target audience", blank=True)
type = models.CharField(max_length=32, choices=(('mentor', 'Mentor'), ('entrepreneur', 'Entrepreneur')), verbose_name="Type of content", blank=True)
steps = models.ManyToManyField(Step, blank=True)
sharing = models.CharField(max_length=32, choices=(('private', 'Private (nobody)'), ('public', 'Public (everybody)')), verbose_name="Sharing profile", blank=True, null=True)
name = coopstarter_data
# points to the variable in the code
version = attr: coopstarter.__version__
version = attr: coopstarter_data.__version__
description = CoopStarter Application
long_description = file:
url =
author = Startin'blox
author_email =
license = MIT
classifiers =
Programming Language :: Python :: 3
packages = find:
install_requires =
version_source = tag
version_variable = coopstarter/
version_variable = coopstarter_data/
commit_parser = commit_parser.parse
......@@ -2,25 +2,5 @@
"""Setup script."""
import setuptools
with open("", "r") as fh:
long_description =
author="Benoit Alessandroni",
description="CoopStarter Application",
version_variable = coopstarter/,
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
from setuptools import setup
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