-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from unb-mds/task/search-api
api(search): implementação do sistema de busca por matéria
- Loading branch information
Showing
9 changed files
with
540 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated by Django 4.2.5 on 2023-11-13 23:29 | ||
|
||
from django.db import migrations | ||
from django.contrib.postgres.operations import UnaccentExtension | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
UnaccentExtension() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from rest_framework.serializers import ModelSerializer | ||
from api.models import Department, Discipline, Class | ||
|
||
class DepartmentSerializer(ModelSerializer): | ||
class Meta: | ||
model = Department | ||
fields = '__all__' | ||
class ClassSerializer(ModelSerializer): | ||
class Meta: | ||
model = Class | ||
fields = '__all__' | ||
|
||
class DisciplineSerializer(ModelSerializer): | ||
department = DepartmentSerializer() | ||
classes = ClassSerializer(many=True) | ||
|
||
class Meta: | ||
model = Discipline | ||
fields = '__all__' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from django.urls import path | ||
from api import views | ||
|
||
app_name = 'api' | ||
|
||
urlpatterns = [ | ||
path('', views.Search.as_view(), name="search") | ||
] |
Oops, something went wrong.