pedagogy: structure of the app

This commit is contained in:
Antoine Bartuccio 2019-05-16 16:51:30 +02:00
parent f922ab9272
commit 17a375f89c
Signed by: klmp200
GPG Key ID: E7245548C53F904B
9 changed files with 335 additions and 0 deletions

23
pedagogy/__init__.py Normal file
View File

@ -0,0 +1,23 @@
# -*- coding:utf-8 -*
#
# Copyright 2019
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#

27
pedagogy/admin.py Normal file
View File

@ -0,0 +1,27 @@
# -*- coding:utf-8 -*
#
# Copyright 2019
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
from django.contrib import admin
# Register your models here.

View File

67
pedagogy/models.py Normal file
View File

@ -0,0 +1,67 @@
# -*- coding:utf-8 -*
#
# Copyright 2019
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
from django.db import models
# Create your models here.
class UV(models.Model):
"""
Contains infos about an UV (course)
"""
pass
class UVComment(models.Model):
"""
A comment about an UV
"""
pass
class UVCommentReport(models.Model):
"""
Report an inapropriate comment
"""
pass
class TeachingDepartment(models.Model):
"""
Teaching department of the school
"""
pass
class Study(models.Model):
"""
Speciality inside a Teaching Department
"""
pass

27
pedagogy/tests.py Normal file
View File

@ -0,0 +1,27 @@
# -*- coding:utf-8 -*
#
# Copyright 2019
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
from django.test import TestCase
# Create your tests here.

62
pedagogy/urls.py Normal file
View File

@ -0,0 +1,62 @@
# -*- coding:utf-8 -*
#
# Copyright 2019
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
from django.conf.urls import url
from pedagogy.views import *
urlpatterns = [
url(r"^$", UVListView.as_view(), name="guide"),
url(r"^uv/(?P<uv_id>[0-9]+)$", UVDetailFormView.as_view(), name="uv_detail"),
url(
r"^comment/(?P<comment_id>[0-9]+)$",
UVCommentDetailView.as_view(),
name="comment_detail",
),
url(
r"^comment/(?P<comment_id>[0-9]+)/report$",
UVCommentReportCreateView.as_view(),
name="comment_report",
),
url(r"^reported$", UVCommentReportListView.as_view(), name="comment_report_list"),
url(r"^moderation$", UVModerationFormView.as_view(), name="moderation"),
url(r"^uv/create$", UVCreateView.as_view(), name="uv_create"),
url(r"^uv/(?P<uv_id>[0-9]+)/delete$", UVDeleteView.as_view(), name="uv_delete"),
url(
r"^department/create$",
TeachingDepartmentCreateView.as_view(),
name="department_create",
),
url(
r"^department/(?P<department_id>[0-9]+)/delete$",
TeachingDepartmentDeleteView.as_view(),
name="department_delete",
),
url(r"^study/create$", StudyCreateView.as_view(), name="study_create"),
url(
r"^study/(?P<study_id>[0-9]+)/delete$",
StudyDeleteView.as_view(),
name="study_delete",
),
]

124
pedagogy/views.py Normal file
View File

@ -0,0 +1,124 @@
# -*- coding:utf-8 -*
#
# Copyright 2017
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
# http://ae.utbm.fr.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License a published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Sofware Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
from django.views.generic import CreateView, DeleteView, DetailView, ListView, FormView
from core.views import DetailFormView
class UVDetailFormView(DetailFormView):
"""
Dispaly every comment of an UV and detailed infos about it
Allow to comment the UV
"""
pass
class UVCommentDetailView(DetailView):
"""
Display a specified UVComment (for easy sharing of the comment)
"""
pass
class UVListView(ListView):
"""
UV guide main page
"""
pass
class UVCommentReportCreateView(CreateView):
"""
Create a new report for an inapropriate comment
"""
pass
class UVCommentReportListView(ListView):
"""
List all UV reports for moderation (Privileged)
"""
pass
class UVModerationFormView(FormView):
"""
List all UVs to moderate and allow to moderate them (Privileged)
"""
pass
class UVCreateView(CreateView):
"""
Add a new UV (Privileged)
"""
pass
class UVDeleteView(DeleteView):
"""
Allow to delete an UV (Privileged)
"""
pass
class TeachingDepartmentCreateView(CreateView):
"""
Add a new TeachingDepartment (Privileged)
"""
pass
class TeachingDepartmentDeleteView(DeleteView):
"""
Allow to delete an TeachingDepartment (Privileged)
"""
pass
class StudyCreateView(CreateView):
"""
Add a new Study (Privileged)
"""
pass
class StudyDeleteView(DeleteView):
"""
Allow to delete an Study (Privileged)
"""
pass

View File

@ -93,6 +93,7 @@ INSTALLED_APPS = (
"stock",
"trombi",
"matmat",
"pedagogy",
)
MIDDLEWARE_CLASSES = (

View File

@ -84,6 +84,10 @@ urlpatterns = [
url(
r"^matmatronch/", include("matmat.urls", namespace="matmat", app_name="matmat")
),
url(
r"^pedagogy/",
include("pedagogy.urls", namespace="pedagogy", app_name="pedagogy"),
),
url(r"^admin/", include(admin.site.urls)),
url(r"^ajax_select/", include(ajax_select_urls)),
url(r"^i18n/", include("django.conf.urls.i18n")),