Commit 67bbe465 authored by Benoit Alessandroni's avatar Benoit Alessandroni

Initial commit to the data repository

parents
/hd_data/__pycache__
---
image: python:3.6
stages:
- test
- release
test:
stage: test
script:
- echo 'Make your tests here !'
except:
- master
tags:
- sib
publish:
stage: release
before_script:
- git config user.name "${GITLAB_USER_NAME}"
- git config user.email "${GITLAB_USER_EMAIL}"
- git remote set-url origin "https://gitlab-ci-token:${GL_TOKEN}@git.happy-dev.fr/${CI_PROJECT_PATH}.git"
- pip install git+https://github.com/plup/python-semantic-release
- pip install sib-commit-parser
script:
- semantic-release publish
only:
- master
tags:
- sib
# CoopStarter Application data repository
This project is a Python module, compatible with Django REST Framework and DjangoLDP additional module, describing the models and the API needed and available on the future coopstarter application.
## installation
`pip install sib-manager`
`sib startproject mysite -m coopstarter_data`
## run project
`cd mysite`
`python manage.py runserver`
__version__ = '0.1.0'
\ No newline at end of file
from django.contrib import admin
from .models import Faq, Collective, Testimony, Event
admin.site.register(Faq)
admin.site.register(Collective)
admin.site.register(Testimony)
admin.site.register(Event)
\ No newline at end of file
from django.apps import AppConfig
class CoopstarterConfig(AppConfig):
name = 'coopstarter'
from django.db import models
from djangoldp.models import Model
class Faq (Model):
question = models.TextField(verbose_name="Question")
answer = models.TextField(verbose_name="Réponse")
category = models.CharField(max_length=50, blank=True, null=True, verbose_name="Catégorie de question")
def __str__(self):
return self.question
class Collective (Model):
name = models.CharField(max_length=50, verbose_name="Nom")
email = models.CharField(max_length=50, verbose_name="Mail")
website = models.CharField(max_length=50, blank=True, null=True, verbose_name="Site web")
facebook = models.CharField(max_length=50, blank=True, null=True, verbose_name="Lien Facebook")
twitter = models.CharField(max_length=50, blank=True, null=True, verbose_name="Lien Twitter")
def __str__(self):
return self.name
class Testimony (Model):
name = models.CharField(max_length=50, verbose_name="Nom de l'indépendant")
statut = models.CharField(max_length=50, verbose_name="Statut")
porteur = models.BooleanField(default=False, verbose_name="Porteur de cellule")
img = models.ImageField(blank=True, null=True, verbose_name="Photo")
def __str__(self):
return self.name
class Event (Model):
name = models.CharField(max_length=50, verbose_name="Nom de l'évènement")
city = models.CharField(max_length=50, verbose_name="Ville")
type = models.CharField(max_length=10, choices=(('apero', 'Apéro'), ('coworking', 'Coworking'),('coliving', 'Coliving'),('other', 'Autre') ), verbose_name="Type d'évènement")
startdate = models.DateTimeField(verbose_name="Date et heure de début")
enddate = models.DateTimeField(verbose_name="Date et heure de fin")
img = models.ImageField(blank=True, null=True, verbose_name="Illustration de l'évènement")
address = models.CharField(max_length=225, blank=True, null=True, verbose_name="Adresse")
description = models.TextField(verbose_name="Description")
link = models.CharField(max_length=50, blank=True, null=True, verbose_name="Lien internet")
facebook = models.CharField(max_length=50, blank=True, null=True, verbose_name="Lien Facebook")
def __str__(self):
return self.name
from django.test import TestCase
# Create your tests here.
[metadata]
name = coopstarter
# points to the variable in the code
version = attr: hd_data.__version__
description = CoopStarter Application
long_description = file: README.md
license = MIT
classifiers =
Programming Language :: Python :: 3
[options]
packages = find:
[semantic_release]
version_source = tag
# points to the variable in the code
version_variable = coopstarter/__init__.py:__version__
commit_parser = commit_parser.parse
#!/usr/bin/env python
"""Setup script."""
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