mirror of
https://github.com/Rushilwiz/SkoolOS.git
synced 2025-04-16 02:10:19 -04:00
getStudents()
This commit is contained in:
parent
444c5a94f0
commit
8b4010c66b
31
CLI/s-git.py
31
CLI/s-git.py
|
@ -12,7 +12,7 @@ import pyperclip
|
||||||
|
|
||||||
#get teacher info from api
|
#get teacher info from api
|
||||||
def getStudent(ion_user):
|
def getStudent(ion_user):
|
||||||
URL = "http://127.0.0.1:8000/students/" + ion_user + "/"
|
URL = "http://127.0.0.1:8000/api/students/" + ion_user + "/"
|
||||||
r = requests.get(url = URL, auth=('raffukhondaker','hackgroup1'))
|
r = requests.get(url = URL, auth=('raffukhondaker','hackgroup1'))
|
||||||
if(r.status_code == 200):
|
if(r.status_code == 200):
|
||||||
data = r.json()
|
data = r.json()
|
||||||
|
@ -69,7 +69,7 @@ class Student:
|
||||||
self.last_name=data['last_name']
|
self.last_name=data['last_name']
|
||||||
self.git=data['git']
|
self.git=data['git']
|
||||||
self.username=data['ion_user']
|
self.username=data['ion_user']
|
||||||
self.url= "http://127.0.0.1:8000/students/" + self.username + "/"
|
self.url= "http://127.0.0.1:8000/api/students/" + self.username + "/"
|
||||||
self.email = data['email']
|
self.email = data['email']
|
||||||
self.grade = data['grade']
|
self.grade = data['grade']
|
||||||
self.student_id=data['student_id']
|
self.student_id=data['student_id']
|
||||||
|
@ -87,7 +87,7 @@ class Student:
|
||||||
pass
|
pass
|
||||||
classes=[]
|
classes=[]
|
||||||
for c in cid:
|
for c in cid:
|
||||||
url = "http://127.0.0.1:8000/classes/" + str(c) + "/"
|
url = "http://127.0.0.1:8000/api/classes/" + str(c) + "/"
|
||||||
classes.append(getDB(url))
|
classes.append(getDB(url))
|
||||||
|
|
||||||
self.classes = classes
|
self.classes = classes
|
||||||
|
@ -105,7 +105,7 @@ class Student:
|
||||||
pass
|
pass
|
||||||
nclasses=[]
|
nclasses=[]
|
||||||
for c in nid:
|
for c in nid:
|
||||||
url = "http://127.0.0.1:8000/classes/" + str(c) + "/"
|
url = "http://127.0.0.1:8000/api/classes/" + str(c) + "/"
|
||||||
nclasses.append(getDB(url))
|
nclasses.append(getDB(url))
|
||||||
|
|
||||||
self.new = nclasses
|
self.new = nclasses
|
||||||
|
@ -154,8 +154,8 @@ class Student:
|
||||||
os.chdir(self.username)
|
os.chdir(self.username)
|
||||||
for c in self.classes:
|
for c in self.classes:
|
||||||
print("UPDATING CLASS: " + str(c['name']))
|
print("UPDATING CLASS: " + str(c['name']))
|
||||||
data = getDB("http://127.0.0.1:8000/classes/" + str(c['name']))
|
data = getDB("http://127.0.0.1:8000/api/classes/" + str(c['name']))
|
||||||
command("git checkout master")
|
# command("git checkout master")
|
||||||
command("git checkout " + data['name'])
|
command("git checkout " + data['name'])
|
||||||
command("git add .")
|
command("git add .")
|
||||||
command("git commit -m " + data['name'])
|
command("git commit -m " + data['name'])
|
||||||
|
@ -173,7 +173,7 @@ class Student:
|
||||||
#add classes from 'new' field
|
#add classes from 'new' field
|
||||||
def addClass(self, cid):
|
def addClass(self, cid):
|
||||||
|
|
||||||
data = getDB('http://127.0.0.1:8000/classes/'+ str(cid))
|
data = getDB('http://127.0.0.1:8000/api/classes/'+ str(cid))
|
||||||
if((cid in self.snew) == False or (self.username in data['confirmed'])):
|
if((cid in self.snew) == False or (self.username in data['confirmed'])):
|
||||||
print("Already enrolled in this class.")
|
print("Already enrolled in this class.")
|
||||||
return None
|
return None
|
||||||
|
@ -184,7 +184,7 @@ class Student:
|
||||||
#add class teacher as cocllaborator to student repo
|
#add class teacher as cocllaborator to student repo
|
||||||
print(os.getcwd())
|
print(os.getcwd())
|
||||||
pwd= input("Enter Github password: ")
|
pwd= input("Enter Github password: ")
|
||||||
tgit = getDB("http://127.0.0.1:8000/teachers/" + data['teacher'] + "/")['git']
|
tgit = getDB("http://127.0.0.1:8000/api/teachers/" + data['teacher'] + "/")['git']
|
||||||
url= "curl -i -u " + self.git + ":" + pwd + " -X PUT -d '' " + "'https://api.github.com/repos/" + self.git + "/" + self.username + "/collaborators/" + tgit + "'"
|
url= "curl -i -u " + self.git + ":" + pwd + " -X PUT -d '' " + "'https://api.github.com/repos/" + self.git + "/" + self.username + "/collaborators/" + tgit + "'"
|
||||||
print(url)
|
print(url)
|
||||||
os.system(url)
|
os.system(url)
|
||||||
|
@ -215,7 +215,7 @@ class Student:
|
||||||
# if(data['confirmed'][0] == ','):
|
# if(data['confirmed'][0] == ','):
|
||||||
# data['confirmed'] = data['confirmed'][1:]
|
# data['confirmed'] = data['confirmed'][1:]
|
||||||
# print(data['confirmed'])
|
# print(data['confirmed'])
|
||||||
# print(putDB(data, 'http://127.0.0.1:8000/classes/'+ str(cid) + "/"))
|
# print(putDB(data, 'http://127.0.0.1:8000/api/classes/'+ str(cid) + "/"))
|
||||||
|
|
||||||
#add teacher as collaborator
|
#add teacher as collaborator
|
||||||
#curl -i -u "USER:PASSWORDD" -X PUT -d '' 'https://api.github.com/repos/USER/REPO/collaborators/COLLABORATOR'
|
#curl -i -u "USER:PASSWORDD" -X PUT -d '' 'https://api.github.com/repos/USER/REPO/collaborators/COLLABORATOR'
|
||||||
|
@ -236,7 +236,7 @@ class Student:
|
||||||
#recreate sclass field, using ids
|
#recreate sclass field, using ids
|
||||||
for c in self.new:
|
for c in self.new:
|
||||||
snew = snew + str(c['name']) + ","
|
snew = snew + str(c['name']) + ","
|
||||||
new.append(getDB("http://127.0.0.1:8000/classes/" + str(cid)))
|
new.append(getDB("http://127.0.0.1:8000/api/classes/" + str(cid)))
|
||||||
self.snew=snew
|
self.snew=snew
|
||||||
self.new=new
|
self.new=new
|
||||||
break
|
break
|
||||||
|
@ -298,9 +298,10 @@ class Student:
|
||||||
'grade':self.grade,
|
'grade':self.grade,
|
||||||
'completed':self.completed
|
'completed':self.completed
|
||||||
}
|
}
|
||||||
#print(putDB(data, "http://127.0.0.1:8000/students/" + self.username + "/"))
|
#print(putDB(data, "http://127.0.0.1:8000/api/students/" + self.username + "/"))
|
||||||
|
|
||||||
def viewClass(self, courses):
|
def viewClass(self, courses):
|
||||||
|
self.update()
|
||||||
cdir = os.getcwd()
|
cdir = os.getcwd()
|
||||||
os.chdir(self.username)
|
os.chdir(self.username)
|
||||||
for c in self.classes:
|
for c in self.classes:
|
||||||
|
@ -311,6 +312,10 @@ class Student:
|
||||||
os.chdir(cdir)
|
os.chdir(cdir)
|
||||||
print("Class not found")
|
print("Class not found")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def exitCLI(self):
|
||||||
|
self.update()
|
||||||
|
command("git checkout master")
|
||||||
|
|
||||||
def submit(self, course, assignment):
|
def submit(self, course, assignment):
|
||||||
cdir = os.getcwd()
|
cdir = os.getcwd()
|
||||||
|
@ -342,5 +347,5 @@ class Student:
|
||||||
|
|
||||||
data = getStudent("2022rkhondak")
|
data = getStudent("2022rkhondak")
|
||||||
s = Student(data)
|
s = Student(data)
|
||||||
#s.viewClass("English11_eharris1")
|
# s.viewClass("English11_eharris1")
|
||||||
s.submit("English11_eharris1", "Entry1")
|
s.exitCLI()
|
||||||
|
|
101
CLI/t-git.py
101
CLI/t-git.py
|
@ -1,5 +1,5 @@
|
||||||
import subprocess
|
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import requests
|
import requests
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import pprint
|
import pprint
|
||||||
|
@ -14,7 +14,7 @@ from datetime import datetime
|
||||||
|
|
||||||
#get teacher info from api
|
#get teacher info from api
|
||||||
def getTeacher(ion_user):
|
def getTeacher(ion_user):
|
||||||
URL = "http://127.0.0.1:8000/teachers/" + ion_user + "/"
|
URL = "http://127.0.0.1:8000/api/teachers/" + ion_user + "/"
|
||||||
r = requests.get(url = URL, auth=('raffukhondaker','hackgroup1'))
|
r = requests.get(url = URL, auth=('raffukhondaker','hackgroup1'))
|
||||||
if(r.status_code == 200):
|
if(r.status_code == 200):
|
||||||
data = r.json()
|
data = r.json()
|
||||||
|
@ -70,7 +70,7 @@ class Teacher:
|
||||||
self.last_name=data['last_name']
|
self.last_name=data['last_name']
|
||||||
self.git=data['git']
|
self.git=data['git']
|
||||||
self.username=data['ion_user']
|
self.username=data['ion_user']
|
||||||
self.url= "http://127.0.0.1:8000/teachers/" + self.username + "/"
|
self.url= "http://127.0.0.1:8000/api/teachers/" + self.username + "/"
|
||||||
self.email = data['email']
|
self.email = data['email']
|
||||||
#classes in id form (Example: 4,5)
|
#classes in id form (Example: 4,5)
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class Teacher:
|
||||||
pass
|
pass
|
||||||
classes=[]
|
classes=[]
|
||||||
for c in cid:
|
for c in cid:
|
||||||
url = "http://127.0.0.1:8000/classes/" + str(c) + "/"
|
url = "http://127.0.0.1:8000/api/classes/" + str(c) + "/"
|
||||||
classes.append(getDB(url))
|
classes.append(getDB(url))
|
||||||
|
|
||||||
self.classes = classes
|
self.classes = classes
|
||||||
|
@ -95,6 +95,10 @@ class Teacher:
|
||||||
else:
|
else:
|
||||||
os.makedirs(self.username + "/Students")
|
os.makedirs(self.username + "/Students")
|
||||||
|
|
||||||
|
#2020-05-11 12:25:00
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#class name format: <course-name>_<ion_user>
|
#class name format: <course-name>_<ion_user>
|
||||||
|
|
||||||
#turn existing directory into class, Pre-condition: directory exists
|
#turn existing directory into class, Pre-condition: directory exists
|
||||||
|
@ -162,7 +166,7 @@ class Teacher:
|
||||||
"unconfirmed": ""
|
"unconfirmed": ""
|
||||||
}
|
}
|
||||||
#make class instance in db
|
#make class instance in db
|
||||||
data = postDB(data, 'http://127.0.0.1:8000/classes/')
|
data = postDB(data, 'http://127.0.0.1:8000/api/classes/')
|
||||||
#add to instance
|
#add to instance
|
||||||
#upate self.classes
|
#upate self.classes
|
||||||
self.classes.append(data)
|
self.classes.append(data)
|
||||||
|
@ -193,7 +197,7 @@ class Teacher:
|
||||||
#check if class exists
|
#check if class exists
|
||||||
path = self.username + "/" + cname
|
path = self.username + "/" + cname
|
||||||
isclass = False
|
isclass = False
|
||||||
acourses = getDB("http://127.0.0.1:8000/classes/")['results']
|
acourses = getDB("http://127.0.0.1:8000/api/classes/")['results']
|
||||||
for c in acourses:
|
for c in acourses:
|
||||||
if c['name'] == cname:
|
if c['name'] == cname:
|
||||||
isclass=True
|
isclass=True
|
||||||
|
@ -255,7 +259,7 @@ class Teacher:
|
||||||
'email':self.email
|
'email':self.email
|
||||||
}
|
}
|
||||||
print(putDB(data, self.url))
|
print(putDB(data, self.url))
|
||||||
delDB("http://127.0.0.1:8000/classes/" + cname + "/")
|
delDB("http://127.0.0.1:8000/api/classes/" + cname + "/")
|
||||||
break
|
break
|
||||||
|
|
||||||
#remove locally
|
#remove locally
|
||||||
|
@ -268,7 +272,7 @@ class Teacher:
|
||||||
|
|
||||||
|
|
||||||
def isStudent(self, student):
|
def isStudent(self, student):
|
||||||
r = requests.get(url = "http://127.0.0.1:8000/students/" + student + "/", auth=('raffukhondaker','hackgroup1'))
|
r = requests.get(url = "http://127.0.0.1:8000/api/students/" + student + "/", auth=('raffukhondaker','hackgroup1'))
|
||||||
if(r.status_code != 200):
|
if(r.status_code != 200):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -277,7 +281,7 @@ class Teacher:
|
||||||
if(self.isStudent(sname) == False):
|
if(self.isStudent(sname) == False):
|
||||||
print(sname + " does not exist.")
|
print(sname + " does not exist.")
|
||||||
return
|
return
|
||||||
course = getDB("http://127.0.0.1:8000/classes/" + cname)
|
course = getDB("http://127.0.0.1:8000/api/classes/" + cname)
|
||||||
if(sname in course['unconfirmed']):
|
if(sname in course['unconfirmed']):
|
||||||
print (sname + " already requested.")
|
print (sname + " already requested.")
|
||||||
return
|
return
|
||||||
|
@ -285,7 +289,7 @@ class Teacher:
|
||||||
print (sname + " alredy enrolled.")
|
print (sname + " alredy enrolled.")
|
||||||
return
|
return
|
||||||
|
|
||||||
student = getDB("http://127.0.0.1:8000/students/" + sname)
|
student = getDB("http://127.0.0.1:8000/api/students/" + sname)
|
||||||
try:
|
try:
|
||||||
if(student['added_to']==""):
|
if(student['added_to']==""):
|
||||||
student['added_to']=course['name']
|
student['added_to']=course['name']
|
||||||
|
@ -333,8 +337,8 @@ class Teacher:
|
||||||
print(sname + " does not exist.")
|
print(sname + " does not exist.")
|
||||||
return
|
return
|
||||||
|
|
||||||
student = getDB("http://127.0.0.1:8000/students/" + sname)
|
student = getDB("http://127.0.0.1:8000/api/students/" + sname)
|
||||||
course = getDB("http://127.0.0.1:8000/classes/" + cname)
|
course = getDB("http://127.0.0.1:8000/api/classes/" + cname)
|
||||||
|
|
||||||
if((student['ion_user'] in course['unconfirmed']) == False):
|
if((student['ion_user'] in course['unconfirmed']) == False):
|
||||||
print("Student has not been requested to join yet.")
|
print("Student has not been requested to join yet.")
|
||||||
|
@ -383,6 +387,7 @@ class Teacher:
|
||||||
}
|
}
|
||||||
print(putDB(cinfo, course['url']))
|
print(putDB(cinfo, course['url']))
|
||||||
|
|
||||||
|
#add local path to student directory, make new instance in api
|
||||||
def addAssignment(self, path, course, due):
|
def addAssignment(self, path, course, due):
|
||||||
parts = path.split("/")
|
parts = path.split("/")
|
||||||
aname = parts[len(parts)-1]
|
aname = parts[len(parts)-1]
|
||||||
|
@ -398,15 +403,61 @@ class Teacher:
|
||||||
if len(folder) == 0:
|
if len(folder) == 0:
|
||||||
print("Assignment is completely empty, need a file.")
|
print("Assignment is completely empty, need a file.")
|
||||||
return
|
return
|
||||||
|
aname = parts[len(parts)-1]
|
||||||
|
p1 = course.split("_")[0]
|
||||||
|
if(p1 in aname == False):
|
||||||
|
print(aname + "incorrectly formated: must be " + aname + "_" + p1 + ".")
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
datetime.strptime(due, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
except:
|
||||||
|
print("Due-date format is incorrect")
|
||||||
|
return
|
||||||
|
|
||||||
ass = {
|
ass = {
|
||||||
'name': parts[len(parts)-1],
|
'name': aname,
|
||||||
'path':path,
|
'path':path,
|
||||||
'classes':course,
|
'classes':course,
|
||||||
'teacher':self.username,
|
'teacher':self.username,
|
||||||
'due_date':due
|
'due_date':due
|
||||||
}
|
}
|
||||||
course = getDB("http://127.0.0.1:8000/classes/" + course)
|
postDB(ass, 'http://127.0.0.1:8000/api/assignments/' + aname + "/")
|
||||||
|
course = getDB("http://127.0.0.1:8000/api/classes/" + course)
|
||||||
|
slist = os.listdir(os.getcwd() + "/" + self.username + "/Students/" + course['name'])
|
||||||
|
cdir = os.getcwd()
|
||||||
|
for st in slist:
|
||||||
|
if st in course['confirmed']:
|
||||||
|
spath = os.path.join(os.getcwd() + "/" + self.username + "/Students/" + course['name'], st)
|
||||||
|
if(os.path.exists(spath + "/" + aname) == False):
|
||||||
|
os.mkdir(spath + "/" + aname)
|
||||||
|
print(st)
|
||||||
|
print(copy_tree(path, spath + "/" + aname))
|
||||||
|
os.chdir(spath)
|
||||||
|
command('git checkout ' + course['name'])
|
||||||
|
command('git pull origin ' + course['name'])
|
||||||
|
command('git add .')
|
||||||
|
command('git commit -m Hello')
|
||||||
|
command('git push -u origin ' + course['name'])
|
||||||
|
os.chdir(cdir)
|
||||||
|
else:
|
||||||
|
print(st + " already has assignment")
|
||||||
|
|
||||||
|
#try to avoid
|
||||||
|
#copy modified assignments to student directories
|
||||||
|
def updateAssignment(self, path, course, due):
|
||||||
|
if(os.path.isdir(path) == False):
|
||||||
|
print(path + " is not an assignment.")
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
if(due != None or due == ""):
|
||||||
|
datetime.strptime(due, '%Y-%m-%d %H:%M:%S.%f')
|
||||||
|
except:
|
||||||
|
print("Due-date format is incorrect")
|
||||||
|
return
|
||||||
|
input()
|
||||||
|
parts = path.split("/")
|
||||||
|
aname = parts[len(parts)-1]
|
||||||
|
course = getDB("http://127.0.0.1:8000/api/classes/" + course)
|
||||||
slist = os.listdir(os.getcwd() + "/" + self.username + "/Students/" + course['name'])
|
slist = os.listdir(os.getcwd() + "/" + self.username + "/Students/" + course['name'])
|
||||||
cdir = os.getcwd()
|
cdir = os.getcwd()
|
||||||
for st in slist:
|
for st in slist:
|
||||||
|
@ -426,8 +477,22 @@ class Teacher:
|
||||||
else:
|
else:
|
||||||
print(st + " already has assignment")
|
print(st + " already has assignment")
|
||||||
|
|
||||||
|
#pull student's work, no modifications
|
||||||
|
def getStudents(self, course):
|
||||||
|
if((course in self.sclass) == False):
|
||||||
|
print(course + " not a class.")
|
||||||
|
return
|
||||||
|
path = self.username + "/Students/" + course
|
||||||
|
slist = os.listdir(path)
|
||||||
|
cdir = os.getcwd()
|
||||||
|
for st in slist:
|
||||||
|
os.chdir(path + "/" + st)
|
||||||
|
command('git checkout ' + course)
|
||||||
|
command('git pull origin ' + course)
|
||||||
|
os.chdir(cdir)
|
||||||
|
|
||||||
def getHistory(self, student, course):
|
def getHistory(self, student, course):
|
||||||
course = getDB("http://127.0.0.1:8000/classes/" + course)
|
course = getDB("http://127.0.0.1:8000/api/classes/" + course)
|
||||||
try:
|
try:
|
||||||
if((student in course['confirmed']) == False):
|
if((student in course['confirmed']) == False):
|
||||||
print("Student not in class")
|
print("Student not in class")
|
||||||
|
@ -502,10 +567,8 @@ class Teacher:
|
||||||
|
|
||||||
def comment(self):
|
def comment(self):
|
||||||
print("heheheh")
|
print("heheheh")
|
||||||
|
|
||||||
def updateAssignnment():
|
|
||||||
print()
|
|
||||||
|
|
||||||
data = getTeacher("eharris1")
|
data = getTeacher("eharris1")
|
||||||
t = Teacher(data)
|
t = Teacher(data)
|
||||||
t.addAssignment("English11_eharris1", "Entry1", '2022rkhondak',"2020-05-11 12:25:00")
|
t.getStudents("English11_eharris1")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 3.0.7 on 2020-06-09 02:03
|
# Generated by Django 3.0.7 on 2020-06-12 01:34
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
@ -14,10 +14,9 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Assignment',
|
name='Assignment',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
|
||||||
('name', models.CharField(max_length=100)),
|
|
||||||
('due_date', models.DateTimeField()),
|
('due_date', models.DateTimeField()),
|
||||||
('files', models.CharField(max_length=100)),
|
('files', models.CharField(blank=True, default='', max_length=100)),
|
||||||
('path', models.CharField(max_length=100)),
|
('path', models.CharField(max_length=100)),
|
||||||
('classes', models.CharField(max_length=100)),
|
('classes', models.CharField(max_length=100)),
|
||||||
('teacher', models.CharField(max_length=100)),
|
('teacher', models.CharField(max_length=100)),
|
||||||
|
@ -26,13 +25,14 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Classes',
|
name='Classes',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
|
||||||
('name', models.CharField(max_length=100)),
|
|
||||||
('repo', models.URLField(default='')),
|
('repo', models.URLField(default='')),
|
||||||
('path', models.CharField(default='', max_length=100)),
|
('path', models.CharField(default='', max_length=100)),
|
||||||
('teacher', models.CharField(default='', max_length=100)),
|
('teacher', models.CharField(default='', max_length=100)),
|
||||||
('assignments', models.CharField(default='', max_length=100)),
|
('assignments', models.CharField(default='', max_length=100)),
|
||||||
('default_file', models.CharField(default='', max_length=100)),
|
('default_file', models.CharField(default='', max_length=100)),
|
||||||
|
('confirmed', models.TextField(blank=True, default='')),
|
||||||
|
('unconfirmed', models.TextField(blank=True, default='')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
|
@ -46,17 +46,6 @@ class Migration(migrations.Migration):
|
||||||
('teacher', models.CharField(max_length=100)),
|
('teacher', models.CharField(max_length=100)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
|
||||||
name='Teacher',
|
|
||||||
fields=[
|
|
||||||
('created', models.DateTimeField(auto_now_add=True)),
|
|
||||||
('first_name', models.CharField(max_length=100)),
|
|
||||||
('last_name', models.CharField(max_length=100)),
|
|
||||||
('classes', models.CharField(default='', max_length=100)),
|
|
||||||
('ion_user', models.CharField(max_length=100, primary_key=True, serialize=False)),
|
|
||||||
('git', models.CharField(max_length=100)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Student',
|
name='Student',
|
||||||
fields=[
|
fields=[
|
||||||
|
@ -65,11 +54,25 @@ class Migration(migrations.Migration):
|
||||||
('last_name', models.CharField(max_length=100)),
|
('last_name', models.CharField(max_length=100)),
|
||||||
('student_id', models.IntegerField()),
|
('student_id', models.IntegerField()),
|
||||||
('ion_user', models.CharField(max_length=100, primary_key=True, serialize=False)),
|
('ion_user', models.CharField(max_length=100, primary_key=True, serialize=False)),
|
||||||
('webmail', models.EmailField(blank=True, max_length=254)),
|
('email', models.CharField(blank=True, default='', max_length=100)),
|
||||||
('grade', models.IntegerField()),
|
('grade', models.IntegerField()),
|
||||||
('git', models.CharField(max_length=100)),
|
('git', models.CharField(max_length=100)),
|
||||||
('repo', models.URLField(default='')),
|
('repo', models.URLField(blank=True, default='')),
|
||||||
('classes', models.ManyToManyField(default='', to='api.Classes')),
|
('classes', models.CharField(blank=True, default='', max_length=100)),
|
||||||
|
('added_to', models.CharField(blank=True, default='', max_length=100)),
|
||||||
|
('completed', models.TextField(blank=True, default='')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Teacher',
|
||||||
|
fields=[
|
||||||
|
('created', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('first_name', models.CharField(max_length=100)),
|
||||||
|
('last_name', models.CharField(max_length=100)),
|
||||||
|
('classes', models.CharField(blank=True, default='', max_length=100)),
|
||||||
|
('ion_user', models.CharField(max_length=100, primary_key=True, serialize=False)),
|
||||||
|
('git', models.CharField(max_length=100)),
|
||||||
|
('email', models.CharField(blank=True, default='', max_length=100)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,89 +0,0 @@
|
||||||
# Generated by Django 3.0.7 on 2020-06-12 00:10
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('api', '0001_initial'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='assignment',
|
|
||||||
name='id',
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='classes',
|
|
||||||
name='id',
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='student',
|
|
||||||
name='webmail',
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='classes',
|
|
||||||
name='confirmed',
|
|
||||||
field=models.TextField(blank=True, default=''),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='classes',
|
|
||||||
name='unconfirmed',
|
|
||||||
field=models.TextField(blank=True, default=''),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='student',
|
|
||||||
name='added_to',
|
|
||||||
field=models.CharField(blank=True, default='', max_length=100),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='student',
|
|
||||||
name='completed',
|
|
||||||
field=models.TextField(blank=True, default=''),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='student',
|
|
||||||
name='email',
|
|
||||||
field=models.CharField(blank=True, default='', max_length=100),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='teacher',
|
|
||||||
name='email',
|
|
||||||
field=models.CharField(blank=True, default='', max_length=100),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='assignment',
|
|
||||||
name='files',
|
|
||||||
field=models.CharField(blank=True, default='', max_length=100),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='assignment',
|
|
||||||
name='name',
|
|
||||||
field=models.CharField(max_length=100, primary_key=True, serialize=False),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='classes',
|
|
||||||
name='name',
|
|
||||||
field=models.CharField(max_length=100, primary_key=True, serialize=False),
|
|
||||||
),
|
|
||||||
migrations.RemoveField(
|
|
||||||
model_name='student',
|
|
||||||
name='classes',
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='student',
|
|
||||||
name='classes',
|
|
||||||
field=models.CharField(blank=True, default='', max_length=100),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='student',
|
|
||||||
name='repo',
|
|
||||||
field=models.URLField(blank=True, default=''),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='teacher',
|
|
||||||
name='classes',
|
|
||||||
field=models.CharField(blank=True, default='', max_length=100),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 3.0.7 on 2020-06-12 00:12
|
# Generated by Django 3.0.7 on 2020-06-12 01:35
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
@ -6,19 +6,18 @@ from django.db import migrations, models
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('api', '0002_auto_20200612_0010'),
|
('api', '0001_initial'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AddField(
|
|
||||||
model_name='assignment',
|
|
||||||
name='id',
|
|
||||||
field=models.AutoField(auto_created=True, default=0, primary_key=True, serialize=False, verbose_name='ID'),
|
|
||||||
preserve_default=False,
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='assignment',
|
model_name='assignment',
|
||||||
name='name',
|
name='name',
|
||||||
field=models.CharField(max_length=100),
|
field=models.CharField(max_length=100),
|
||||||
),
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='assignment',
|
||||||
|
name='path',
|
||||||
|
field=models.CharField(max_length=100, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
]
|
]
|
23
Website/api/migrations/0003_auto_20200612_0135.py
Normal file
23
Website/api/migrations/0003_auto_20200612_0135.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.0.7 on 2020-06-12 01:35
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('api', '0002_auto_20200612_0135'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='assignment',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=100, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='assignment',
|
||||||
|
name='path',
|
||||||
|
field=models.CharField(max_length=100),
|
||||||
|
),
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user