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
admin.site.register(Resource)
admin.site.register(Step)
admin.site.register(Field)
admin.site.register(Format)
admin.site.register(Mentor)
admin.site.register(Organisation)
admin.site.register(Entrepreneur)
admin.site.register(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):
return self.name
class Organisation (Model):
name = models.CharField(max_length=128, verbose_name="Name")
website = models.CharField(max_length=4096, verbose_name="Website")
def __str__(self):
return self.name
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)
......
[metadata]
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: README.md
url = http://git.happy-dev.fr/startinblox/applications/coopstarter/coopstarter-data
author = Startin'blox
author_email = benoit@happy-dev.fr
license = MIT
classifiers =
Programming Language :: Python :: 3
[options]
packages = find:
install_requires =
djangoldp~=0.5
[semantic_release]
version_source = tag
version_variable = coopstarter/__init__.py:__version__
version_variable = coopstarter_data/__init__.py:__version__
commit_parser = commit_parser.parse
......@@ -2,25 +2,5 @@
"""Setup script."""
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="coopstarter_data",
version="0.0.1",
author="Benoit Alessandroni",
author_email="benoit@happy-dev.fr",
description="CoopStarter Application",
long_description=long_description,
version_variable = coopstarter/__init__.py:__version__,
long_description_content_type="text/markdown",
url="https://git.happy-dev.fr/startinblox/applications/coop-starter/coopstarter-data",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)
from setuptools import setup
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