Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement linking in information display pages #35

Merged
merged 8 commits into from
Jan 2, 2020
Merged
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Requirements
1. python-mysqldb
1. django 3.0
1. libldap2-dev
1. libmysqlclient-dev
```

#### Installation
Expand All @@ -34,7 +35,7 @@ chmod +x setup.sh
Installation of Requirements

```bash
sudo apt install apache2 mysql-server python python3-pip python-mysqldb libldap2-dev
sudo apt install apache2 mysql-server python python3-pip python-mysqldb libldap2-dev libmysqlclient-dev
sudo python3 -m pip install -r requirements.txt
```

Expand Down Expand Up @@ -62,7 +63,7 @@ DATABASES = {
```bash
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py runserver 127.0.0.1:8000
python3 manage.py runserver 127.0.0.1:8090
```
1. Open "http://127.0.0.1:8090" in your browser.

Expand Down
49 changes: 48 additions & 1 deletion course/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,40 +39,87 @@ class Meta:


class LevelFilter(django_filters.FilterSet):
institute_id = django_filters.ModelChoiceFilter(
field_name="institute",
lookup_expr="exact",
empty_label="Select Institute",
queryset=Institute.objects.all(),
)

class Meta:
model = Level
fields = {"level_name": ["icontains"]}


class ProgrammeFilter(django_filters.FilterSet):
level_id = django_filters.ModelChoiceFilter(
field_name="level",
lookup_expr="exact",
empty_label="Select Level",
queryset=Level.objects.all(),
)

class Meta:
model = Programme
fields = {"programme_code": ["exact"], "programme_name": ["icontains"]}


class DisciplineFilter(django_filters.FilterSet):
department_code = django_filters.ModelChoiceFilter(
field_name="department",
lookup_expr="exact",
empty_label="Select Department",
queryset=Department.objects.all(),
)
programme_code = django_filters.ModelChoiceFilter(
field_name="programme",
lookup_expr="exact",
empty_label="Select Programme",
queryset=Programme.objects.all(),
)

class Meta:
model = Discipline
fields = {
"discipline_code": ["exact"],
"discipline_name": ["icontains"],
"department__department_name": ["icontains"],
}


class CourseFilter(django_filters.FilterSet):
discipline_code = django_filters.ModelChoiceFilter(
field_name="discipline",
lookup_expr="exact",
empty_label="Select Discipline",
queryset=Discipline.objects.all(),
)

class Meta:
model = Course
fields = {"course_id": ["exact"], "course_title": ["icontains"]}


class ModuleFilter(django_filters.FilterSet):
course_id = django_filters.ModelChoiceFilter(
field_name="course",
lookup_expr="exact",
empty_label="Select Course",
queryset=Course.objects.all(),
)

class Meta:
model = Module
fields = {"module_title": ["icontains"]}


class UnitFilter(django_filters.FilterSet):
module_id = django_filters.ModelChoiceFilter(
field_name="module",
lookup_expr="exact",
empty_label="Select Module",
queryset=Module.objects.all(),
)

class Meta:
model = Unit
fields = {"unit_name": ["icontains"]}
Loading