-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b8a299a
Showing
245 changed files
with
38,552 additions
and
0 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,33 @@ | ||
# Production switch | ||
PRODUCTION=False | ||
|
||
DJANGO_SECRET_KEY=''' | ||
ALLOWED_HOSTS='' | ||
|
||
# Database settings | ||
POSTGRES_PASSWORD='' | ||
POSTGRES_USER='' | ||
|
||
# PowerSchool server information | ||
POWERSCHOOL_URL= | ||
POWERSCHOOL_CLIENT_ID= | ||
POWERSCHOOL_CLIENT_SECRET= | ||
|
||
# Django ADFS auth settings | ||
ADFS_AUDIENCE='' | ||
ADFS_CLIENT_ID='' | ||
ADFS_RELYING_PARTY_ID='' | ||
ADFS_TENANT_ID='' | ||
|
||
# Email settings | ||
EMAIL_HOST='' | ||
EMAIL_HOST_PASSWORD='' | ||
EMAIL_HOST_USER='' | ||
EMAIL_PORT='' | ||
EMAIL_USE_TLS='' | ||
SERVER_EMAIL='' | ||
DEFAULT_FROM_EMAIL='' | ||
|
||
# Cafeteria app settings | ||
ORDER_CUTOFF='' | ||
HOMEROOM_CUTOFF= |
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,90 @@ | ||
.DS_Store | ||
.vscode/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ |
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 @@ | ||
# KnightsLunchManager |
Empty file.
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,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
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,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ApiConfig(AppConfig): | ||
name = 'api' |
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,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
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,22 @@ | ||
from django.contrib.auth.models import User | ||
from rest_framework import serializers | ||
|
||
from menu.models import MenuItem | ||
|
||
|
||
class MenuItemSerializer(serializers.ModelSerializer): | ||
class Meta: | ||
model = MenuItem | ||
fields = ['id', 'cost', 'days_available', 'schools_available', 'name', 'sequence'] | ||
|
||
|
||
class StudentSerializer(serializers.ModelSerializer): | ||
|
||
name = serializers.SerializerMethodField() | ||
|
||
def get_name(self, obj): | ||
return obj.first_name + ' ' + obj.last_name + ' - ' + str(obj.profile.grade_level) | ||
|
||
class Meta: | ||
model = User | ||
fields = ['id', 'name'] |
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,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
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,11 @@ | ||
from django.urls import path | ||
|
||
from api.views import DetailMenuItem | ||
from api.views import ListMenuItem | ||
from api.views import StudentSearch | ||
|
||
urlpatterns = [ | ||
path('menu/', ListMenuItem.as_view()), | ||
path('menu/<int:pk>/', DetailMenuItem.as_view()), | ||
path('students/basic/', StudentSearch.as_view(), name='basic-student-search'), | ||
] |
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,28 @@ | ||
from django.contrib.auth.models import User | ||
|
||
from rest_framework import filters | ||
from rest_framework import generics | ||
from rest_framework.views import APIView | ||
from rest_framework.response import Response | ||
|
||
from api.serializers import MenuItemSerializer | ||
from api.serializers import StudentSerializer | ||
from menu.models import MenuItem | ||
from profiles.models import Profile | ||
|
||
|
||
class ListMenuItem(generics.ListCreateAPIView): | ||
queryset = MenuItem.objects.all() | ||
serializer_class = MenuItemSerializer | ||
|
||
|
||
class DetailMenuItem(generics.RetrieveUpdateDestroyAPIView): | ||
queryset = MenuItem.objects.all() | ||
serializer_class = MenuItemSerializer | ||
|
||
|
||
class StudentSearch(generics.ListCreateAPIView): | ||
search_fields = ['first_name', 'last_name'] | ||
filter_backends = [filters.SearchFilter] | ||
queryset = User.objects.filter(profile__role=Profile.STUDENT) | ||
serializer_class = StudentSerializer |
Empty file.
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,30 @@ | ||
from django.contrib import admin | ||
|
||
from cafeteria.models import School | ||
from cafeteria.models import Weekday | ||
|
||
|
||
@admin.register(School) | ||
class SchoolAdmin(admin.ModelAdmin): | ||
fields = ['display_name', 'active', 'name', 'school_number'] | ||
readonly_fields = ['name', 'school_number'] | ||
list_filter = ['active'] | ||
list_display = ('__str__', 'school_number', 'active') | ||
|
||
def has_add_permission(self, request): | ||
return False | ||
|
||
def has_delete_permission(self, request, obj=None): | ||
return False | ||
|
||
|
||
@admin.register(Weekday) | ||
class WeekdayAdmin(admin.ModelAdmin): | ||
fields = ['name', 'abbreviation'] | ||
list_display = ['name', 'abbreviation'] | ||
|
||
def has_add_permission(self, request): | ||
return False | ||
|
||
def has_delete_permission(self, request, obj=None): | ||
return False |
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,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class CafeteriaConfig(AppConfig): | ||
name = 'cafeteria' | ||
verbose_name = 'Cafeteria Administration' |
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,42 @@ | ||
[ | ||
{ | ||
"model": "cafeteria.weekday", | ||
"pk": 1, | ||
"fields": { | ||
"abbreviation": "Mon", | ||
"name": "Monday" | ||
} | ||
}, | ||
{ | ||
"model": "cafeteria.weekday", | ||
"pk": 2, | ||
"fields": { | ||
"abbreviation": "Tue", | ||
"name": "Tuesday" | ||
} | ||
}, | ||
{ | ||
"model": "cafeteria.weekday", | ||
"pk": 3, | ||
"fields": { | ||
"abbreviation": "Wed", | ||
"name": "Wednesday" | ||
} | ||
}, | ||
{ | ||
"model": "cafeteria.weekday", | ||
"pk": 4, | ||
"fields": { | ||
"abbreviation": "Thr", | ||
"name": "Thursday" | ||
} | ||
}, | ||
{ | ||
"model": "cafeteria.weekday", | ||
"pk": 5, | ||
"fields": { | ||
"abbreviation": "Fri", | ||
"name": "Friday" | ||
} | ||
} | ||
] |
Empty file.
Empty file.
Oops, something went wrong.