From c02f8626dd688e4b9bc2072619b8ea8d95d460d2 Mon Sep 17 00:00:00 2001 From: Brandon Lee Date: Tue, 7 Sep 2021 10:21:29 -0500 Subject: [PATCH] added alphabetical ordering to models --- db.sqlite3 | Bin 258048 -> 258048 bytes forum/__pycache__/models.cpython-39.pyc | Bin 3698 -> 3705 bytes forum/migrations/0023_auto_20210907_1016.py | 17 +++++++++++++++++ .../0023_auto_20210907_1016.cpython-39.pyc | Bin 0 -> 575 bytes forum/models.py | 2 +- .../views_assignments.cpython-39.pyc | Bin 6617 -> 6617 bytes .../__pycache__/views_courses.cpython-39.pyc | Bin 1962 -> 1983 bytes .../__pycache__/views_modules.cpython-39.pyc | Bin 2316 -> 2327 bytes forum/views_folder/views_courses.py | 2 +- forum/views_folder/views_modules.py | 2 +- 10 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 forum/migrations/0023_auto_20210907_1016.py create mode 100644 forum/migrations/__pycache__/0023_auto_20210907_1016.cpython-39.pyc diff --git a/db.sqlite3 b/db.sqlite3 index 98f4390aca05fc171a377efc4611e5cfc4f455fe..b35ebffc01a1035c724d7e6427b6db6cf72aa23d 100644 GIT binary patch delta 698 zcmY+BO-NKx6vxlKcixQeIpc94w2#dbS~TJ4dvD%+YUZ@Ch_o>Ztj+kc56YUE#Pzo5_r-17@0?y&pImGsW4wKD*J>34ITli8=@DI>E5e~qWR)R@AYI{ zQ#4fxE5W#`r~zx^Rl;5+D69U68i?qDx=={hgW-a!itQp&)?HuAdsF=+@w`;*osthK zUb%*x-Q~W5D%X@tr17rbCbSOrN3+-RayD__p51ydakQ-~8Hi*uXF6Kj)6tf6@>1sX ziS(6o(T8)4&P7;TQabA2{(lPBP7@HPJlw zn%=bAEdoi(&Ap)^o^cBBJ8s}-{K&}{Iq@t`@u!|*$w#H!> zhGRIweYa66lk7kUfJDu)4SGH%aAc@0xCb_HI3|q8m`!$4+$yQoJk81!TSo@aX#Tvz w+%j>R&WG$rg^Y9Hr~wEu5vqAYJ|Lr~C*k`)B-xQ`$+LUbboQF_d8Rb~0r~p7j{pDw delta 566 zcmYk2L1+_E5Qg8|m)&HOY$gGTN)fi6f;M({o1{qy+9;$&8%bIO@zSPAsU=#|T2VZh zXvKr4mK^qygS3JdA!x7*UQ!Q&ngvmW=2Ba#5ELQyprRFYf)@|-nEC&o;hR_5g3=Z& zc1a2$akeQpEzje^UCl^NJ<=LuSE>~(NPiHR??H5y%&DtZj<2NukaZ@!h2}KTQHF%AR5Cjx$A;3ox3tKFYD%OE{xO- z0^gtwpWp)$uOmkTIclIcHn|Ae%LJ`=@Cr6z4OZbHETerFjO8{rnc^uj^wd11HY}z1 z)fBVHP71pyk{I5WGu#E%0wxjB_*G;cnVN?49{cICV<6s5$jvUQ(<1ZgPhD)Eexu4n RJyB(MbhF3~8$WOy_zTnOr9S`w diff --git a/forum/__pycache__/models.cpython-39.pyc b/forum/__pycache__/models.cpython-39.pyc index 5c90ba084ad98acaa1f5f4a6ff89689f55bc8b73..f0820cb906b1aa81ca82f11a4005b3fd1fc871b9 100644 GIT binary patch delta 111 zcmew)^HYX5k(ZZ?0SE${%oC?<EjCz}8IJPpfK>3oJ-*Mhz1PY$yUdaRi DOu`yI delta 105 zcmew<^GSv`k(ZZ?0SLPC%@Vse@?K|CWCZdYfVfx)NTf1EF{Us?F{Lo3Ge$9|FaX< z!e4Sr#b2P{m}C##G181?#xu|FjoRNY7}=XI$Lcd@?B`fqx0H$#a({;cFyI~QdCfU{ z&Oku&jX{EZBfciJfbV9=3m+SR97Rr0w znjTGvxpja}n>H@cfCLpV=pJJhbm)-4QlqGx+hL-7R?cHC<=B%l7E<;Ww%wR7r2M#5 z-Q~*ya3DN1=Ni2eBqts`?gF|~3)sEffyKfOczKH-%pK6w6n?*b`k;C3(fQ_yQwFTL z{Q|LhhW<{9 literal 0 HcmV?d00001 diff --git a/forum/models.py b/forum/models.py index 6469037..4f9e6d0 100644 --- a/forum/models.py +++ b/forum/models.py @@ -60,7 +60,7 @@ class Assignment(models.Model): description = QuillField() total_points = models.FloatField(null=True, blank=True) class Meta: - ordering = ['end_datetime'] + ordering = ['end_datetime', 'title'] def __str__(self): return self.title diff --git a/forum/views_folder/__pycache__/views_assignments.cpython-39.pyc b/forum/views_folder/__pycache__/views_assignments.cpython-39.pyc index 60ad9655b9dd8c5f6c0b3da4d57396fd4292c1cb..9e55654a25c5bf384000b7f4e8c426ce3963fe15 100644 GIT binary patch delta 19 Zcmca>}B1)%@{ diff --git a/forum/views_folder/__pycache__/views_courses.cpython-39.pyc b/forum/views_folder/__pycache__/views_courses.cpython-39.pyc index 1ef860a5dcd6f687c6196f51906926a96f6bdad0..80a797f1f57cd3f3e1f4d9c21a7a592c23b15c01 100644 GIT binary patch delta 475 zcmZ9IzfZzI6vul#di;=5rJwgvdZ#Ty%GGa3LX;Hi`k7yp}{w7o)3#UfjVA zS4R`w9d+aHa5E;}D<+CJeD2-L_kG{H_h7sjx~1z0MV`ltEh~Maf09=bC*$(awC6@7 zAa-(F@wFivDKge&oCy>=6_881uW&=WkwA;|t)3(H)K!udUG*+8iMe1q&^kO5gyypu zX%4!?gtgrPc+OaXlGvn8Vv1{8VKtH@V2USt)X1WA5kXNO^&HRZxP7j|I=h=WLhaB&*B-+{DDOEq3Fk1!B8!TCZP9Lsm67PVu)*X1dgZ3s)EsTFo}Si=y@ z5_0OW5b~J8Re>tOX*g5p4MoiU9qCzXkgE95PUK2jESLY+CyIJBhZS+lifi~gs7Op= i1J425@~s)Wcg9Iwe6e=PL?uU55p~3G8z6rL##n9YYk%xk0iqa;S!-5)+`Yq z<}KmQV$EW!VX9$G;qGNxAezFvkg=J0AtNJ0;h7S#8io|U8X!NIL6d*-F6Q>hZY*=f l*b)m0Qu9)Zc!1X2;>a&bNiB*`s+|0jC5KUHa~kVLW&nC)CIA2c diff --git a/forum/views_folder/views_courses.py b/forum/views_folder/views_courses.py index 1f6476f..78ee48c 100644 --- a/forum/views_folder/views_courses.py +++ b/forum/views_folder/views_courses.py @@ -22,7 +22,7 @@ def courses(request): return redirect("forum:courses") else: context["error"] = "Course not found." - context["courses"] = Course.objects.filter(Q(owner=request.user) | Q(students=request.user)).distinct() + context["courses"] = Course.objects.filter(Q(owner=request.user) | Q(students=request.user)).distinct().order_by("name") context["form"] = forms.JoinCourseForm() return render(request, "courses.html", context) diff --git a/forum/views_folder/views_modules.py b/forum/views_folder/views_modules.py index 17967d0..fbf2777 100644 --- a/forum/views_folder/views_modules.py +++ b/forum/views_folder/views_modules.py @@ -25,7 +25,7 @@ def modules(request): assn.module = AssignmentModule.objects.get(id=moduleid) assn.save() context["modules"] = [ModuleWrapper("No module", 0, Assignment.objects.filter(course=course, module=None))] - for module in AssignmentModule.objects.filter(course=course): + for module in AssignmentModule.objects.filter(course=course).order_by("name"): context["modules"].append(ModuleWrapper(module.name, module.id, Assignment.objects.filter(course=course, module=module).order_by("end_datetime"))) return render(request, "modules.html", context)