Skip to content

Commit

Permalink
Merged in feature/project (pull request #10)
Browse files Browse the repository at this point in the history
Feature/project
  • Loading branch information
daniel-gray-tangent committed Mar 26, 2024
2 parents 444a58f + 771c292 commit dd20e96
Show file tree
Hide file tree
Showing 18 changed files with 152 additions and 185 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ ruff-fix:

load-fixtures:
clear
@docker-compose run --rm web python manage.py loaddata fixtures/contributing-centre.json
@docker-compose run --rm web python manage.py loaddata fixtures/institution.json
@docker-compose run --rm web python manage.py loaddata fixtures/projects.json
@docker-compose run --rm web python manage.py loaddata fixtures/language.json
@docker-compose run --rm web python manage.py loaddata fixtures/subjects.json

Expand Down
1 change: 1 addition & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.contrib import admin
from django.urls import path

Expand Down
20 changes: 0 additions & 20 deletions app/fixtures/contributing-centre.json

This file was deleted.

75 changes: 25 additions & 50 deletions app/fixtures/institution.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"abbreviation": "UNISA",
"url": "https://www.unisa.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -19,8 +18,7 @@
"abbreviation": "NWU",
"url": "https://www.nwu.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -31,8 +29,7 @@
"abbreviation": "UP",
"url": "https://www.up.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -43,8 +40,7 @@
"abbreviation": "UJ",
"url": "https://www.uj.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -55,8 +51,7 @@
"abbreviation": "UKZN",
"url": "https://www.ukzn.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -67,8 +62,7 @@
"abbreviation": "UFS",
"url": "https://www.ufs.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -79,8 +73,7 @@
"abbreviation": "CPUT",
"url": "https://www.cput.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -91,8 +84,7 @@
"abbreviation": "WITS",
"url": "https://www.wits.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -103,8 +95,7 @@
"abbreviation": "US",
"url": "http://www.sun.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -115,8 +106,7 @@
"abbreviation": "UCT",
"url": "https://uct.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -127,8 +117,7 @@
"abbreviation": "NMU",
"url": "https://www.mandela.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -139,8 +128,7 @@
"abbreviation": "WSU",
"url": "https://www.wsu.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -151,8 +139,7 @@
"abbreviation": "DUT",
"url": "https://www.dut.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -163,8 +150,7 @@
"abbreviation": "UL",
"url": "https://www.ul.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -175,8 +161,7 @@
"abbreviation": "VUT",
"url": "https://www.vut.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -187,8 +172,7 @@
"abbreviation": "UniZulu",
"url": "https://www.unizulu.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -199,8 +183,7 @@
"abbreviation": "UWC",
"url": "https://www.uwc.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -211,8 +194,7 @@
"abbreviation": "CUT",
"url": "https://www.cut.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -223,8 +205,7 @@
"abbreviation": "UFH",
"url": "https://www.ufh.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -235,8 +216,7 @@
"abbreviation": "RU",
"url": "https://www.ru.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -247,8 +227,7 @@
"abbreviation": "Venda",
"url": "https://www.univen.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -259,8 +238,7 @@
"abbreviation": "MUT",
"url": "https://www.mut.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -271,8 +249,7 @@
"abbreviation": "FMHSU",
"url": "https://www.smu.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -283,8 +260,7 @@
"abbreviation": "UMP",
"url": "https://www.ump.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
},
{
Expand All @@ -295,8 +271,7 @@
"abbreviation": "SPU",
"url": "https://www.spu.ac.za/",
"email": "[email protected]",
"logo": "logo",
"contributing_centre_id": "1"
"logo": "logo"
}
}
]
26 changes: 26 additions & 0 deletions app/fixtures/projects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"model": "general.Project",
"pk": 1,
"fields": {
"name": "Study Centre",
"url": "https://example.dev",
"logo": "logo.png",
"start_date": "2020-01-01",
"end_date": "2020-01-01",
"Institution": 1
}
},
{
"model": "general.Project",
"pk": 2,
"fields": {
"name": "Research Centre",
"url": "https://example.dev",
"logo": "logo.png",
"start_date": "2020-01-01",
"end_date": "2020-01-01",
"Institution": 2
}
}
]
15 changes: 8 additions & 7 deletions app/general/admin.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
from django.contrib import admin

from .models import ContributingCentre, Institution, Language, Subject
from .models import Institution, Language, Project, Subject


class SubjectInline(admin.TabularInline):
model = Subject.contributing_centre.through
class ProjectAdminInline(admin.TabularInline):
model = Project
extra = 0


class ContributingCentreAdmin(admin.ModelAdmin):
inlines = [SubjectInline]
class ProjectAdmin(admin.ModelAdmin):
inlines = [ProjectAdminInline]


admin.site.register(ContributingCentre, ContributingCentreAdmin)
admin.site.register(Institution)
admin.site.register(Project)
admin.site.register(Institution, ProjectAdmin)
admin.site.register(Language)
admin.site.register(Subject)
Loading

0 comments on commit dd20e96

Please sign in to comment.