From b67116771dd83a80657b6b7906bb4b88512534fc Mon Sep 17 00:00:00 2001 From: chrismvelez97 Date: Mon, 4 Jul 2022 18:47:23 -0700 Subject: [PATCH] So far we have set up our models for a question and a choice. We've also set up the admin site and imported our question model over to admin site so it can be modified from there. Here are the next couple of steps Im going to take. 1. Merge this branch to the main GitHub repo. 2. Create a seperate branch for making changes, specifically to views and returning HTML files. --- websiteProj/db.sqlite3 | Bin 0 -> 143360 bytes .../polls/__pycache__/admin.cpython-310.pyc | Bin 0 -> 280 bytes .../polls/__pycache__/apps.cpython-310.pyc | Bin 0 -> 442 bytes .../polls/__pycache__/models.cpython-310.pyc | Bin 0 -> 1249 bytes websiteProj/polls/admin.py | 3 ++ websiteProj/polls/migrations/0001_initial.py | 32 ++++++++++++++++++ .../__pycache__/0001_initial.cpython-310.pyc | Bin 0 -> 1034 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 176 bytes websiteProj/polls/models.py | 19 ++++++++++- .../__pycache__/settings.cpython-310.pyc | Bin 2309 -> 2333 bytes websiteProj/websiteProj/settings.py | 1 + 11 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 websiteProj/polls/__pycache__/admin.cpython-310.pyc create mode 100644 websiteProj/polls/__pycache__/apps.cpython-310.pyc create mode 100644 websiteProj/polls/__pycache__/models.cpython-310.pyc create mode 100644 websiteProj/polls/migrations/0001_initial.py create mode 100644 websiteProj/polls/migrations/__pycache__/0001_initial.cpython-310.pyc create mode 100644 websiteProj/polls/migrations/__pycache__/__init__.cpython-310.pyc diff --git a/websiteProj/db.sqlite3 b/websiteProj/db.sqlite3 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bef85be0b729289297eaa7231392befae10c3bcb 100644 GIT binary patch literal 143360 zcmeI5du$uYeaE>X#fK$w^{~ym^Fu4jI-AkSUcO0Pu6MLd%R0-FElai)^srr$D~d8j zQY7`TQ?#Y*ONyi|&;$+80&R)_MO(Cgv}u8$NCOlpiu9eJ$Q5Xs6m9=W8#G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#*`|SfvlKB$>0hxXgY5KB!8V literal 0 HcmV?d00001 diff --git a/websiteProj/polls/__pycache__/apps.cpython-310.pyc b/websiteProj/polls/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93006e38410dce7608b59abf484475b2db7352a0 GIT binary patch literal 442 zcmYjOy-ve05VqqKrGE?Rio}{F4}cJAX$4z_gjk|TR+@98R8Ab?1OzLrY`g@|!CQD> zVd52-xN9rXlkR*!pFiK7&3HUuC|_@%t9LxVDL51#gDI*#MFR}DW+jg~XV(lo5U&h` z;x8ihz`tc-?*~yV$$1cMV?XSP&futR69YVSj>UpZ5|8oVjl#u_-=S(w6;5f z=M&hZRc<0!MWq3yZFE`Wv#vE)h0+lBYQiqVo(rU`(o#w322vul)8vn&yzf%IuN;F~ zr=4zPiUe{^49=(82W$G+(ANAe=4Z*BRgF!u2c=cAFj-fssZe8^AMMW`p$VAJ1HR2IL*a(|p$OY}^f00STiAK@H!e8e&2mAT KvqU&z6Y&QYSZ}}p literal 0 HcmV?d00001 diff --git a/websiteProj/polls/__pycache__/models.cpython-310.pyc b/websiteProj/polls/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f88ae3facf74e02b5c508b81fecf17fcb345b4e GIT binary patch literal 1249 zcmZuxJ#Q015Z%4=eb})>6hsI?h_r4}P@)JWatJ~QD=5&MEUnJBgJW~POLo^uY|)W6 z9rQ_=pFmB+Z`hV9H60Z*cXs3`+0)L=%+Afuym@xsXw(?4pFe(ezdMZmA!B}3(AdJQ zH&I9?dCG=7;+%9Rbt2~tldi0sFlY}1MO?DT0e4W5Tsr4G^1!|DrF+SvKvtx8#-dRAGQf9LhIm8Oh95?t zO+U}Be`AU(ZfnE%RHTsg%)w-FCpNIYH|nN+eE>4y7&2R=({ADZ>!bL}25cWQw6WmE z(KM?taB47XMML`eim5sV{@ZQ6?0nLobSF866goS3G8#f=bf=Zee%9-pKzC2&14s<1 zx^IBY&S9RWx>I7YaX7Yt5ZWjqLMj1A!F)bhn)S0WJ-k!2hk;bIUPD1e8-C$jGIN94 zD*NIgHg5Zx`onH2G9K%uXT!r$S4f1!hNeG+NuGgqv;4${JW; zH62YL;d4An&7CRFsHp;qCWc_9g`~(?kn+Cy6j(f@4<4YHES4qAnAC1I)G8f5AwldZ zL9XrQ3i`e59gGWDY|z@?Z*A|qj>6f`Ks}}CbriP#HZ#zJaw^t4&JE~t2KT}L3_qa( zP2peSb$T2{{-$rMau8>|d_#7NQq&{5!Fx~t7DXvV+}ucuD+(rtnPKmNg=;SS z3it=yx$qnI%BjBq2|>lIlh7iu){gg^)y(Yo&2HN5wlo@FK7Jj&F*NPF0@nxmv`w0M zpA2ZgA}wY%i@D92!aUM#2>r#8m2x;AM-Q&`W)ENjhL?Q~JDm#D^OaK#KP+?AmWqVL* zv#TyfrYle9sR*`6wQY5D*&K|$Y_{wwu7@JV8SLyN1qL|ZY;C6*iXeGG%GM$Dk|32F zM$)W~tGdz{Y#j`?hR%k-E6*VPy{1f8n3{$_1F)4Cqkb+18 z=N*prvou7%P|I8tsGw7+}WBj*q zX_yOioAF=9rTL?ZvFfrpqtb^_CD%-$JAa-1*@NmYNM`pG8&&U$*KGBGeA0Y8>(CR` N^Sn-GnVW1~{{x}%F8%-j literal 0 HcmV?d00001 diff --git a/websiteProj/polls/migrations/__pycache__/__init__.cpython-310.pyc b/websiteProj/polls/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d194cc599cab14a83d7b7595ca857e3f908b0d4 GIT binary patch literal 176 zcmd1j<>g`kf_uG(lR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_;vsFxJacWU< zOmbOjPHK!xesXDUYFHx@=j0T}16fwg1SD7(0B)x)$^ZZW literal 0 HcmV?d00001 diff --git a/websiteProj/polls/models.py b/websiteProj/polls/models.py index 71a8362..f211d59 100644 --- a/websiteProj/polls/models.py +++ b/websiteProj/polls/models.py @@ -1,3 +1,20 @@ from django.db import models - +import datetime # Create your models here. +class Question(models.Model): + question_text = models.CharField(max_length = 200) + pub_date = models.DateTimeField('Date Published') + + def __str__(self): + return self.question_text + + def was_published_recently(self): + return self.pub_date >= timezone.now() - datetime.timedelta(days = 1) + +class Choice(models.Model): + question = models.ForeignKey(Question, on_delete = models.CASCADE) + choice_text = models.CharField(max_length = 200) + votes = models.IntegerField(default = 0) + + def __str__(self): + return self.choice_text diff --git a/websiteProj/websiteProj/__pycache__/settings.cpython-310.pyc b/websiteProj/websiteProj/__pycache__/settings.cpython-310.pyc index 1dd32b50dee6b3f636d27220fa88eba7207253d0..dde7bba07598d10b20fe286bdf1fc8755544a829 100644 GIT binary patch delta 59 zcmZn_nk&Sc&&$ij00g0v4ky`d*~l&0z%q>5vh; delta 35 pcmbO$)GEZA&&$ij00fhJ4=2fQ