-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RestAPI and rename django_curriculum by curriculum
- Loading branch information
1 parent
70e5f30
commit aab8e5e
Showing
18 changed files
with
204 additions
and
33 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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.1.12' | ||
__version__ = '0.1.13' |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
|
||
class DjangoCurriculumConfig(AppConfig): | ||
name = 'django_curriculum' | ||
name = 'curriculum' |
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,74 @@ | ||
from rest_framework import serializers | ||
from .models import (Overview, PersonalSocialMedia, PersonalPhone, | ||
EducationInfo, JobInfo, Accomplishment, Skillset, | ||
Skill, Language, LanguageInfo) | ||
|
||
|
||
class OverviewSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Overview | ||
fields = '__all__' | ||
|
||
|
||
class PersonalSocialMediaSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = PersonalSocialMedia | ||
fields = '__all__' | ||
|
||
|
||
class PersonalPhoneSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = PersonalPhone | ||
fields = '__all__' | ||
|
||
|
||
class EducationInfoSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = EducationInfo | ||
fields = '__all__' | ||
|
||
|
||
class JobInfoSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = JobInfo | ||
fields = '__all__' | ||
|
||
|
||
class AccomplishmentSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Accomplishment | ||
fields = '__all__' | ||
|
||
|
||
class SkillsetSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Skillset | ||
fields = '__all__' | ||
|
||
|
||
class SkillSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Skill | ||
fields = '__all__' | ||
|
||
|
||
class LanguageSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = Language | ||
fields = '__all__' | ||
|
||
|
||
class LanguageInfoSerializer(serializers.ModelSerializer): | ||
|
||
class Meta: | ||
model = LanguageInfo | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
from django.conf.urls import url | ||
from django.conf.urls import url, include | ||
from django.views.generic import TemplateView | ||
from rest_framework import routers | ||
|
||
from . import views | ||
|
||
router.register(r'projects', views.ProjectViewSet) | ||
router = routers.DefaultRouter() | ||
router.register(r'overview', views.OverviewViewSet) | ||
router.register(r'socialmedia', views.PersonalSocialMediaViewSet) | ||
router.register(r'education', views.EducationInfoViewSet) | ||
router.register(r'job', views.JobInfoViewSet) | ||
router.register(r'acomplishment', views.AccomplishmentViewSet) | ||
router.register(r'skillet', views.SkillsetViewSet) | ||
router.register(r'skill', views.SkillViewSet) | ||
router.register(r'language', views.LanguageViewSet) | ||
router.register(r'languageinfo', views.LanguageInfoViewSet) | ||
|
||
urlpatterns = [ | ||
url(r'', TemplateView.as_view(template_name="base.html")), | ||
url(r'^api/', include(router.urls)), | ||
url(r'^', include(router.urls)), | ||
] |
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 |
---|---|---|
@@ -1,12 +1,83 @@ | ||
from rest_framework import viewsets | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from .models import Overview | ||
from .models import (Overview, PersonalSocialMedia, PersonalPhone, | ||
EducationInfo, JobInfo, Accomplishment, Skillset, Skill, | ||
Language, LanguageInfo) | ||
from .serializers import (OverviewSerializer, PersonalSocialMediaSerializer, | ||
PersonalPhoneSerializer, EducationInfoSerializer, | ||
JobInfoSerializer, AccomplishmentSerializer, | ||
SkillsetSerializer, SkillSerializer, | ||
LanguageSerializer, LanguageInfoSerializer) | ||
|
||
|
||
class OverviewViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = Overview.objects.all().order_by('-created') | ||
serializer_class = ProjectSerializer | ||
queryset = Overview.objects.filter().order_by('-created') | ||
serializer_class = OverviewSerializer | ||
|
||
|
||
class PersonalSocialMediaViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = PersonalSocialMedia.objects.filter().order_by('-created') | ||
serializer_class = PersonalSocialMediaSerializer | ||
|
||
|
||
class EducationInfoViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = EducationInfo.objects.filter().order_by('-created') | ||
serializer_class = EducationInfoSerializer | ||
|
||
|
||
class JobInfoViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = JobInfo.objects.filter().order_by('-created') | ||
serializer_class = JobInfoSerializer | ||
|
||
|
||
class AccomplishmentViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = Accomplishment.objects.filter().order_by('-created') | ||
serializer_class = AccomplishmentSerializer | ||
|
||
|
||
class SkillsetViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = Skillset.objects.filter().order_by('-created') | ||
serializer_class = SkillsetSerializer | ||
|
||
|
||
class SkillViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = Skill.objects.filter().order_by('-created') | ||
serializer_class = SkillSerializer | ||
|
||
|
||
class LanguageViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = Language.objects.filter().order_by('-created') | ||
serializer_class = LanguageSerializer | ||
|
||
|
||
class LanguageInfoViewSet(viewsets.ModelViewSet): | ||
""" | ||
API endpoint that allows users to be viewed or edited. | ||
""" | ||
queryset = LanguageInfo.objects.filter().order_by('-created') | ||
serializer_class = LanguageInfoSerializer |
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
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
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
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
Oops, something went wrong.