Commit 55e35f6d authored by Florent Chehab's avatar Florent Chehab
Browse files

Merge branch 'work_on_models' into 'master'

Most backend models created, will need testing and tweaks !

See merge request chehabfl/outgoing_rex!11
parents 3a5a0f12 1926238c
......@@ -3,10 +3,9 @@
package AbstractModels #lightgrey{
abstract class Module{
+ icon : string
+ name : string
+ description : string
abstract class VersionnedModule <Will be versionned\n in the app>{
+ modified_by : user
+ modified_date : date
}
abstract class BasicModule{
......@@ -21,13 +20,13 @@ package AbstractModels #lightgrey{
}
abstract class Photo{
+ file : image
+ tile : string
+ photo : image
+ title : string
+ description : MD
}
BasicModule -left-|> Module
Photo -right-|> Module
BasicModule -left-|> VersionnedModule
Photo -right-|> VersionnedModule
ScholarShip -left-|> BasicModule
}
......
......@@ -2,9 +2,10 @@
!include AbstractModules.pu
!include Core.pu
!include CityModules.pu
!include UniversityModules.pu
!include CountryModules.pu
!include Campus.pu
!include IndiFunctions.pu
!include CampusAndModules.pu
!include UserFunctions.pu
@enduml
......@@ -21,14 +21,17 @@ package Campus {
class CultureAndStudentLife
class Accomodation
class Transport
class CampusOtherStuff
CultureAndStudentLife -up-|> BasicModuleCopyCampusExtra
Accomodation -up-|> BasicModuleCopyCampusExtra
Transport -up-|> BasicModuleCopyCampusExtra
CampusOtherStuff -up-|> BasicModuleCopyCampusExtra
CultureAndStudentLife -- Campus
Accomodation -- Campus
Transport -- Campus
CultureAndStudentLife "1" -down[bold,#green]- "1" Campus
Accomodation "1" -down[bold,#green]- "1" Campus
Transport "1" -down[bold,#green]- "1" Campus
CampusOtherStuff "1" -down[bold,#green]- "1" Campus
}
Campus "1..n" -- "1" University
......
@startuml
package CityModule{
abstract class PhotoCopyCity as "Photo" #red
abstract class BasicModuleCopyCity as "BasicModule" #red
class CityOtherStuff
class CityTransport
class CityTourism
class CityPhoto
CityOtherStuff -up-|> BasicModuleCopyCity
CityTransport -up-|> BasicModuleCopyCity
CityTourism -up-|> BasicModuleCopyCity
CityPhoto -up-|> PhotoCopyCity
class CityVirtualCopy as "City" < copy for\n cleaner UML> #lightgrey
CityOtherStuff "1" -down[bold,#green]- "1" CityVirtualCopy
CityTransport "1" -down[bold,#green]- "1" CityVirtualCopy
CityTourism "1" -down[bold,#green]- "1" CityVirtualCopy
CityPhoto "1" -down[bold,#green]- "1" CityVirtualCopy
}
CityVirtualCopy -down[bold,#green]- City
@enduml
\ No newline at end of file
......@@ -2,47 +2,47 @@
package Core {
' note as notePackageCore
' <b>Write access is restricted to site admins and the members of the DRI group.</b>
' On some models, users can make requests for modifications (for this a copy of the model is used for storing).
' end note
' note as notePackageCore
' <b>Write access is restricted to site admins and the members of the DRI group.</b>
' On some models, users can make requests for modifications (for this a copy of the model is used for storing).
' end note
class City #white {
+ name : string
+ local_name : string
+ area : string
}
class City #white {
+ name : string
+ local_name : string
+ area : string
}
class Country #white {
# iso_alpha2_code : string{2}
+ name : string
+ region_code : string{3}
+ region_name : string
+ sub_region_code : string{3}
+ sub_region_name : string
+ intermediate_region_code : string{3}
+ intermediate_region_name : string
}
class Country #white {
# iso_alpha2_code : string{2}
+ name : string
+ region_code : string{3}
+ region_name : string
+ sub_region_code : string{3}
+ sub_region_name : string
+ intermediate_region_code : string{3}
+ intermediate_region_name : string
}
City "*" -left-* Country
City "*" -left-* Country
note "Countries are intially \n hardcoded in the db." as N2
N2 .up. Country
note "Countries are intially \n hardcoded in the db." as N2
N2 .up. Country
class University #wheat {
+ name : string
+ accronyme : string
+ logo : image
+ website : url
}
class University #wheat {
+ name : string
+ accronyme : string
+ logo : image
+ website : url
}
University "1" .right. "1" City
note on link #white
This link is acheived
through the campus module
(where is_main = true)
University "*" .right. "1" City
note on link #white
This link is acheived
through the campus module
(where is_main = true)
end note
Class Offer {
......@@ -50,38 +50,54 @@ note on link #white
}
Class Semester{
+ name : string
+ searchable : bool
+ code : string {key}
}
Class Departement{
Class Department{
+ code : string
+ name : string
+ accronyme : string
+ searchable : bool
+ active : bool
}
Class Specialty {
+ code : string
+ name : string
+ accronyme : string
+ searchable : bool
+ active : bool
}
Offer "*" -right- "1" University
Offer "*" -down- "1" Semester
Offer "*" -left- "1..n" Departement
Specialty "1..n" -left- "1" Departement
Offer "*" -left- "1..n" Specialty
Specialty "1..n" -left- "1" Department
note "Initial data inserted in db." as N3
Semester .. N3
N3 .. Specialty
N3 .. Departement
N3 .. Department
class UsefullLinks #green{
+ content : MD
}
note left of UsefullLinks: It will be a dynamic page \n on the website
note right of UsefullLinks: It will be a dynamic page \n on the website
abstract class BasicModuleCopyCore as "BasicModule" #red
class UniversityDri
class CountryDri
UniversityDri -down-|> BasicModuleCopyCore
CountryDri -down-|> BasicModuleCopyCore
Country "*"-down-"*" CountryDri
University "*"-down-"*" UniversityDri
note "Edit right reserved\n to DRI members." as N4
N4 .. UniversityDri
N4 .. CountryDri
}
' End of Core block
......
......@@ -5,34 +5,44 @@ package CountryModule{
abstract class BasicModuleCopyCountry as "BasicModule" #red
abstract class ScholarShipCopyCountry as "Scholarship" #red
class CultureCountry as "Culture"
class CountryCulture as "Culture"
class VisaAdministrative
class HealthAssurance
class TransportCountry
class PhotoCountry
class ScholarshipCountry
class HealthInsurance
class OtherInsurance
class CountryOtherStuff
class CountryTransport
class CountryTourism
class CountryPhoto
class ScholarshipCountry
CultureCountry -up-|> BasicModuleCopyCountry
CountryCulture -up-|> BasicModuleCopyCountry
VisaAdministrative -up-|> BasicModuleCopyCountry
HealthAssurance -up-|> BasicModuleCopyCountry
TransportCountry -up-|> BasicModuleCopyCountry
OtherInsurance -up-|> BasicModuleCopyCountry
HealthInsurance -up-|> BasicModuleCopyCountry
CountryOtherStuff -up-|> BasicModuleCopyCountry
CountryTransport -up-|> BasicModuleCopyCountry
CountryTourism -up-|> BasicModuleCopyCountry
PhotoCountry -up-|> PhotoCopyCountry
ScholarshipCountry -up-|> ScholarShipCopyCountry
CountryPhoto -left-|> PhotoCopyCountry
CountryPhoto "*" -right- "1" CountryVirtualCopy
class CountryModules #grey
ScholarshipCountry -right-|> ScholarShipCopyCountry
ScholarshipCountry "*" -left- "*" CountryVirtualCopy
class CountryVirtualCopy as "Country" < copy for\n cleaner UML> #lightgrey
CultureCountry "1" -down[bold,#green]- "1" CountryModules
VisaAdministrative "1" -down[bold,#green]- "1" CountryModules
HealthAssurance "1" -down[bold,#green]- "1" CountryModules
TransportCountry "1" -down[bold,#green]- "1" CountryModules
PhotoCountry "1" -down[bold,#green]- "1" CountryModules
CountryCulture "1" -down[bold,#green]- "1" CountryVirtualCopy
VisaAdministrative "1" -down[bold,#green]- "1" CountryVirtualCopy
HealthAssurance "1" -down[bold,#green]- "1" CountryVirtualCopy
HealthInsurance "1" -down[bold,#green]- "1" CountryVirtualCopy
OtherInsurance "1" -down[bold,#green]- "1" CountryVirtualCopy
CountryOtherStuff "1" -down[bold,#green]- "1" CountryVirtualCopy
CountryTransport "1" -down[bold,#green]- "1" CountryVirtualCopy
CountryTourism "1" -down[bold,#green]- "1" CountryVirtualCopy
ScholarshipCountry "*" -down- "*" CountryModules
}
CountryModules -down[bold,#green]- Country
CountryVirtualCopy -down[bold,#green]- Country
@enduml
\ No newline at end of file
......@@ -3,9 +3,10 @@ TARGET=\
generated/Core.svg \
generated/UniversityModules.svg \
generated/CountryModules.svg \
generated/CityModules.svg \
generated/AbstractModules.svg \
generated/Campus.svg \
generated/IndiFunctions.svg
generated/CampusAndModules.svg \
generated/UserFunctions.svg
all: $(TARGET)
......
......@@ -10,13 +10,13 @@ package UniversityModule{
abstract class ScholarShipCopyUniversity as "Scholarship" #red
class CultureUniversity as "Culture"
class PhotoUniversity
class ScholarshipUniversity
class UniversityPhoto
class Courses
class SpecialOffer
class OtherStuff
class UniversityOtherStuff
class Insurances
class SemesterDate{
class SemestersDates{
+ autumn_begin : date
+ autumn_end : date
+ spring_begin : date
......@@ -24,36 +24,36 @@ package UniversityModule{
}
class UniversityInfo{
+ can_exchange : bool
+ can_double_degree : bool
+ cost_exchange : float
+ cost_double_degree : float
+ cost_exchange : float
+ cost_double_degree : float
}
CultureUniversity -up-|> BasicModuleCopyUniversity
Courses -up-|> BasicModuleCopyUniversity
SpecialOffer -up-|> BasicModuleCopyUniversity
OtherStuff -up-|> BasicModuleCopyUniversity
SemesterDate -up-|> BasicModuleCopyUniversity
UniversityOtherStuff -up-|> BasicModuleCopyUniversity
Insurances -up-|> BasicModuleCopyUniversity
SemestersDates -up-|> BasicModuleCopyUniversity
UniversityInfo -up-|> BasicModuleCopyUniversity
PhotoUniversity -left-|> PhotoCopyUniversity
UniversityPhoto -left-|> PhotoCopyUniversity
ScholarshipUniversity -right-|> ScholarShipCopyUniversity
UniversityScholarship -right-|> ScholarShipCopyUniversity
class UniversityModules #grey
class UniversityVirtualCopy as "University" < copy for\n cleaner UML> #lightgrey
CultureUniversity "1" -down[bold,#green]- "1" UniversityModules
PhotoUniversity "1" -right[bold,#green]- "1" UniversityModules
Courses "1" -down[bold,#green]- "1" UniversityModules
OtherStuff "1" -down[bold,#green]- "1" UniversityModules
SpecialOffer "1" -down[bold,#green]- "1" UniversityModules
UniversityInfo "1" -down[bold,#green]- "1" UniversityModules
SemesterDate "1" -down[bold,#green]- "1" UniversityModules
CultureUniversity "1" -down[bold,#green]- "1" UniversityVirtualCopy
UniversityPhoto "*" -right- "1" UniversityVirtualCopy
Courses "1" -down[bold,#green]- "1" UniversityVirtualCopy
UniversityOtherStuff "1" -down[bold,#green]- "1" UniversityVirtualCopy
Insurances "1" -down[bold,#green]- "1" UniversityVirtualCopy
SpecialOffer "1" -down[bold,#green]- "1" UniversityVirtualCopy
UniversityInfo "1" -down[bold,#green]- "1" UniversityVirtualCopy
SemestersDates "1" -down[bold,#green]- "1" UniversityVirtualCopy
ScholarshipUniversity "*" -left- "1" UniversityModules
UniversityScholarship "*" -left- "1" UniversityVirtualCopy
}
UniversityModules -down[bold,#green]- University
UniversityVirtualCopy -down[bold,#green]- University
@enduml
@startuml
package IndividualizedFunctionalities #lightblue{
package UserFunctionalities #lightblue{
class UniversityCopy1 as "University" #red
class SpecialtyCopy1 as "Specialty" #red
class UserCopy1 as "User" #red
class SemesterCopy1 as "Semester" #red
class RecommendationList{
+ name : string
class RecommendationsList{
+ title : string
+ public : bool
+ content : JSON array \n \t University : FK \n \t comment : MD \n \t adequation_grate : integer
}
UniversityCopy1 "*" -up- "*" RecommendationList
SpecialtyCopy1 "1..n" -up- "*" RecommendationList
UserCopy1 "1" -left- "*" RecommendationList
class Recommendation{
+ order_in_list : integer
+ comment : MD
+ grade : int in [0,20]
}
note as N4
Adequation_grade null or [1,6]
tags for custom list
List can be copied by other user if public.
Presentation like ipython notebook.
endnote
N4 .right. RecommendationList
RecommendationsList "1"-right-"*" Recommendation
UniversityCopy1 "*" -up- "*" RecommendationsList
SpecialtyCopy1 "1..n" -up- "*" RecommendationsList
UserCopy1 "1" -left- "*" RecommendationsList
UserCopy1 "1" -right- "*" Recommendation
note on link #white
User <-> Recommendation
Required to controll access
end note
class PreviousDeparture{
+ is_anonymous : bool
+ courses : JSON
+ Utc_departure_id : int
}
class PreviousDepartureFeedback{
+ adequation_comment : MD
+ integration_comment : MD
+ adequation_grade : integer
+ adequation_grade : integer
+ courses_and_courses_feedback : JSON
}
PreviousDeparture "1" -right- "1" PreviousDepartureFeedback
PreviousDeparture "*" -left- "1" UserCopy1
PreviousDeparture "*" -up- "1" SpecialtyCopy1
PreviousDeparture "*" -up- "1" UniversityCopy1
PreviousDeparture "*" -up- "1..n" SemesterCopy1
}
' End of IndividualiedFunctionalities packages
class UserData{
+ contact_info : JSON
+ contact_info_is_public : bool
+ config : JSON
+ other_data : JSON
}
UserData "1"-up-"1" UserCopy1
}
@enduml
\ No newline at end of file
......@@ -9,7 +9,8 @@ Vue complète :
Vue plus précise :
![Core](UML/generated/Core.svg)
![AbstractModules](UML/generated/UniversityModules.svg)
![Architecture](UML/generated/Campus.svg)
![Architecture](UML/generated/CampusAndModules.svg)
![Architecture](UML/generated/CountryModules.svg)
![Architecture](UML/generated/CityModules.svg)
![Architecture](UML/generated/AbstractModules.svg)
![Architecture](UML/generated/IndiFunctions.svg)
\ No newline at end of file
![Architecture](UML/generated/UserFunctions.svg)
\ No newline at end of file
......@@ -43,7 +43,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'general.middleware.LoginRequiredMiddleware',
# 'general.middleware.LoginRequiredMiddleware',
]
LOGIN_URL = '/user/login'
......
from django.contrib import admin
from reversion_compare.admin import CompareVersionAdmin
from rex.models.university import University, Campus
from rex.models.location import Country, City
from rex.models.location import CountryCulture
from rex.models.location import CountryHealthInsurance
from rex.models.location import CountryOtherInsurance
from rex.models.location import CountryTransport
from rex.models.location import CountryTourism
from rex.models.location import CountryOtherStuff
from rex.models.location import CountryVisaAdministrative
from rex.models.location import CountryPhoto
from rex.models.location import CountryScholarship
from rex.models.location import CountryDri
admin.site.register(Country)
admin.site.register(City)
from rex.models.location import CityTransport
from rex.models.location import CityTourism
from rex.models.location import CityOtherStuff
admin.site.register(University, CompareVersionAdmin)
admin.site.register(Campus, CompareVersionAdmin)
from rex.models.university import University, Campus, UniversityScholarship
from rex.models.university import UniversityInfo
from rex.models.university import UniversitySemestersDates
from rex.models.university import UniversityInsurance
from rex.models.university import UniversityCourses
from rex.models.university import UniversityCulture
from rex.models.university import UniversityOtherStuff
from rex.models.university import UniversitySpecialOffer
from rex.models.university import UniversityPhoto
from rex.models.university import UniversityDri
from rex.models.university import CampusTransport
from rex.models.university import CampusAccommodation
from rex.models.university import CampusCultureAndStudentLife
from rex.models.university import CampusOtherStuff
from rex.models.module import Currency
from rex.models.otherCore import Department
from rex.models.otherCore import Offer
from rex.models.otherCore import Semester
from rex.models.otherCore import Specialty
from rex.models.user import Recommendation
from rex.models.user import RecommendationList
from rex.models.user import PreviousDeparture
from rex.models.user import PreviousDepartureFeedback
from rex.models.user import UserData
CLASSIC_MODELS = [
Country,
City,
Currency,
Department,
Offer,
Semester,
Specialty,
Recommendation,
RecommendationList,
PreviousDeparture,
PreviousDepartureFeedback,
UserData
]
VERSIONNED_MODELS = [
University,
Campus,
UniversityScholarship,
UniversityInfo,
UniversitySemestersDates,
UniversityInsurance,
UniversityCulture,
UniversityCourses,
UniversityOtherStuff,
UniversitySpecialOffer,
UniversityPhoto,
CountryCulture,
CountryHealthInsurance,
CountryOtherInsurance,
CountryTransport,
CountryTourism,
CountryOtherStuff,
CountryVisaAdministrative,
CountryPhoto,
CountryScholarship,
CityTransport,
CityTourism,
CityOtherStuff,
CampusTransport,
CampusAccommodation,
CampusCultureAndStudentLife,
CampusOtherStuff,
CountryDri,
UniversityDri,
]
for model in CLASSIC_MODELS:
admin.site.register(model)
for model in VERSIONNED_MODELS:
admin.site.register(model, CompareVersionAdmin)