From ed7b21968a95fdb7f2dc8c468e6c9f775a3c9313 Mon Sep 17 00:00:00 2001 From: Aurva Jyoti Paul Date: Tue, 26 Jan 2021 14:03:55 +0530 Subject: [PATCH 1/4] added like and comment buttons --- instagram/__pycache__/__init__.cpython-36.pyc | Bin 130 -> 166 bytes instagram/__pycache__/settings.cpython-36.pyc | Bin 2924 -> 2946 bytes instagram/__pycache__/urls.cpython-36.pyc | Bin 1170 -> 1206 bytes instagram/__pycache__/wsgi.cpython-36.pyc | Bin 537 -> 573 bytes photoapp/__pycache__/__init__.cpython-36.pyc | Bin 129 -> 165 bytes photoapp/__pycache__/admin.cpython-36.pyc | Bin 334 -> 370 bytes photoapp/__pycache__/apps.cpython-36.pyc | Bin 349 -> 385 bytes photoapp/__pycache__/forms.cpython-36.pyc | Bin 2109 -> 2145 bytes photoapp/__pycache__/models.cpython-36.pyc | Bin 2656 -> 2692 bytes photoapp/__pycache__/urls.cpython-36.pyc | Bin 926 -> 962 bytes photoapp/__pycache__/views.cpython-36.pyc | Bin 5073 -> 5095 bytes .../migrations/0017_auto_20210126_1301.py | 20 ++++++++++++++++++ .../__pycache__/0001_initial.cpython-36.pyc | Bin 1278 -> 1314 bytes .../0002_auto_20191218_0717.cpython-36.pyc | Bin 564 -> 600 bytes .../0003_post_image.cpython-36.pyc | Bin 580 -> 616 bytes .../0004_auto_20191218_1037.cpython-36.pyc | Bin 581 -> 617 bytes .../0005_auto_20191218_1052.cpython-36.pyc | Bin 580 -> 616 bytes .../0006_auto_20191218_1106.cpython-36.pyc | Bin 581 -> 617 bytes .../0007_profile_followers.cpython-36.pyc | Bin 718 -> 754 bytes .../__pycache__/0008_comment.cpython-36.pyc | Bin 1168 -> 1204 bytes .../0009_auto_20191226_1000.cpython-36.pyc | Bin 926 -> 962 bytes .../0010_auto_20200117_1515.cpython-36.pyc | Bin 1062 -> 1098 bytes .../0011_auto_20200117_1519.cpython-36.pyc | Bin 1251 -> 1287 bytes .../0012_auto_20200122_1626.cpython-36.pyc | Bin 721 -> 757 bytes .../0013_auto_20200123_1409.cpython-36.pyc | Bin 721 -> 757 bytes .../0014_auto_20200125_0710.cpython-36.pyc | Bin 721 -> 757 bytes .../0015_auto_20200126_1011.cpython-36.pyc | Bin 735 -> 757 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 140 -> 176 bytes photoapp/templates/photoapp/postlist.html | 4 +++- photoapp/templates/photoapp/viewpost.html | 4 ++-- 30 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 photoapp/migrations/0017_auto_20210126_1301.py diff --git a/instagram/__pycache__/__init__.cpython-36.pyc b/instagram/__pycache__/__init__.cpython-36.pyc index 8115893b27a7033b71aa6f74ee628727e2437ffc..cc83c5fbb0f2ae1675c1069d9246161d32b820d3 100644 GIT binary patch delta 120 zcmZo-T*k;@%*)Gl{0M)-L=N-xU}vkC(Bjmh;u!Z(7njf&_h5hLc#rsiAb+nI&%EN2 yLNn(0YVy=EBoHemS F4gdtp6MO&w diff --git a/instagram/__pycache__/settings.cpython-36.pyc b/instagram/__pycache__/settings.cpython-36.pyc index af16132a21008235409bea521d03975cafb79ec7..30f893d52ee976f5dd1140ff823b7ab4d98da94c 100644 GIT binary patch delta 97 zcmaDO)+Ekl%*)Gl{0M)-6#k7|Gr2s2ovmU*i&Kk=W86bsTtZ{qgZ-W3J>mm`{Jmm4 d^NLFnA!K?{Vs1=cYI!D_5SR~^oP3RI8USCnBgg;% delta 75 zcmZn?e c6_+GJ$n>Jb+?c%7@=P=#Fdr;A`8%T$0873jNB{r; delta 60 zcmdnXGLwbVn3tF9b%91)_eRc>jH=rD8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`k8Rn IWN9WP0Akk^hX4Qo diff --git a/photoapp/__pycache__/__init__.cpython-36.pyc b/photoapp/__pycache__/__init__.cpython-36.pyc index 026aa9e55263cc1b01da157f28be35255b69afef..3fcf2568aa8c6083979bd05f5dcc25c4a2c0fa98 100644 GIT binary patch delta 119 zcmZoF4F DiwG!q delta 56 zcmZ3=*vQCX%*)I5xNn(0YVy=EcMt(_t LVnKoa#CACV@S+nO diff --git a/photoapp/__pycache__/admin.cpython-36.pyc b/photoapp/__pycache__/admin.cpython-36.pyc index 3a76b5c7a3596c91f386eba0d0d0531afdd6af74..d575932dd6c8302c92c1ebabe77e09fe964e8558 100644 GIT binary patch delta 94 zcmX@d^ofbnn3tF9#1a047ZW-Ec=$V8#e^2878S?1hq}0g#<&OjJI8y(2L$n&Ma41hp)M|=G48?s&hZ}c0YUy=F`jwF fC5aF+y(lp^CNH%-6HTZfBflg+v7jJk;=gzR=tv^o delta 58 zcmZoSk%;Ma{Jbll+;*!MlqQqSNf{gr< N{KSF+{mDv<@c=v76e$1z diff --git a/photoapp/__pycache__/forms.cpython-36.pyc b/photoapp/__pycache__/forms.cpython-36.pyc index 9b40b14db857fff694fb73ddc4888623c64bffa0..8654c40874f20895bbf93e2f8ddfb188c15e559a 100644 GIT binary patch delta 96 zcmdlh@KAu$n3tF9#1a04&l@=vnLPZRtztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` iic1n9WO`9zZcJWkc_x}rK}LQ_equpE%w|8P_pAU{QX@zJ delta 60 zcmaDTuvdW7n3tF9b%93Qm5rQ=Oe)&?8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J QCHaX31^SzdnBKDj0Bi^qb^rhX diff --git a/photoapp/__pycache__/models.cpython-36.pyc b/photoapp/__pycache__/models.cpython-36.pyc index b595347069c855ab54887ddcd03c8f61b19e2e1f..3384927d652c5a064c2916a05d8d30fb146a1413 100644 GIT binary patch delta 96 zcmaDL(jv-f%*)Gl;s}4jvyGf3OdbKwRxzQ)sYS&x?x8L&p)u~k{?73p@c}{pUNN3| i#U+UlGQB7eIUYV%*)I5x2Yn3tF9#1a04uNyhnFnRbpTg8MHrxq2*xQDv9gvPiB`#Z;b#0LcVd&PL> j6_+GJ$n>Jb+?c%7@=P?Lf{gr<{KSHSn9a|bUI_pIpk*Yy delta 74 zcmaE^eo>v%n3tF9!7IHut&N;(n2ap-GxBp&^%IMdGct>F6Z7<4Qj4=o@(c7c^NLFn b^*upkdQoDoenCclNq%BMf&S*dOs@n0?4TSN diff --git a/photoapp/migrations/0017_auto_20210126_1301.py b/photoapp/migrations/0017_auto_20210126_1301.py new file mode 100644 index 0000000..f9575d0 --- /dev/null +++ b/photoapp/migrations/0017_auto_20210126_1301.py @@ -0,0 +1,20 @@ +# Generated by Django 2.0.2 on 2021-01-26 07:31 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('photoapp', '0016_auto_20210125_1053'), + ] + + operations = [ + migrations.AlterField( + model_name='comment', + name='date', + field=models.DateTimeField(default=datetime.datetime(2021, 1, 26, 7, 31, 47, 436426, tzinfo=utc)), + ), + ] diff --git a/photoapp/migrations/__pycache__/0001_initial.cpython-36.pyc b/photoapp/migrations/__pycache__/0001_initial.cpython-36.pyc index 980b38c6c58dc93590e06ddfcefbe4e9ef79e422..62f11a807ed2909491b458188a7b427c2dc1bee0 100644 GIT binary patch delta 106 zcmeyzxrmF?n3tF9#1a04?;ANkFb5|(Tg8MHrxq2*xQDv9gvPiB`#Z;b#0LcVd&PL> r6_+GJ$n>Jb+?c%7@=P?Lf{gr<{KSHSnA}XDl9J5)yyBS28Z6fUATB6n delta 70 zcmZ3)^^cR&n3tF9b%93Q#f_XFnDuS-GxBp&^%IMdGct>F6Z7;v^NLFn(~A;w^$Rlc YOY##73iNX`f&7xp{JdiQ$v!OC0EJH)UjP6A diff --git a/photoapp/migrations/__pycache__/0002_auto_20191218_0717.cpython-36.pyc b/photoapp/migrations/__pycache__/0002_auto_20191218_0717.cpython-36.pyc index ddd76e0cfebd76d8f6f87ec1b90b4f33fa9063fc..4b5607b905c900dd3196d02d51cd530a7cc69b3b 100644 GIT binary patch delta 107 zcmdnOa)X7-n3tF9#1Z}kMy8Ei)r`S8&Q>v@#i>QbG47!*E}=2*!T!$i9`OM|{$4Sj sdBr7(5Hh_eF*hbJwLB9|s30T1BtNmBASO2xsH7w_Kd(4u@)pJh0Gc!>8vp r6_+GJ$n>Jb+?c%7@=P?Lf{gr<{KSHSnA}XDl9J5)yyBS2=NU@@F6Z7;v^NLFn(~A;w^$Rlc YOY##73iNX`f&7xp{JdiQ$)6cZ0cM;U3IG5A diff --git a/photoapp/migrations/__pycache__/0004_auto_20191218_1037.cpython-36.pyc b/photoapp/migrations/__pycache__/0004_auto_20191218_1037.cpython-36.pyc index 060235523b0f95e2f5c45ed72c4e64a61392ec60..3845f0c6242b00d05454e28300e68e3f218e5628 100644 GIT binary patch delta 106 zcmX@g@{)zqn3tF9#1a04*&8`0Fb3y1Tg8MHrxq2*xQDv9gvPiB`#Z;b#0LcVd&PL> r6_+GJ$n>Jb+?c%7@=P?Lf{gr<{KSHSnA}XDl9J5)yyBS2Cm3r1;zlR= delta 70 zcmaFKa+HPBn3tF9b%91)=SI#6jQSq>8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQu r6_+GJ$n>Jb+?c%7@=P?Lf{gr<{KSHSnA}XDl9J5)yyBS2Cm3r1;fyEu delta 70 zcmaFKa+HPBn3tF9b%91)`$o8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQuPPeqOQuWM=0506dQv#Q*>R diff --git a/photoapp/migrations/__pycache__/0010_auto_20200117_1515.cpython-36.pyc b/photoapp/migrations/__pycache__/0010_auto_20200117_1515.cpython-36.pyc index 23d3d0476c559e90826c7693af37ad8437d98c78..6d76ab7f0e3183657f90b86f1bdd6d216d3b12cc 100644 GIT binary patch delta 106 zcmZ3+af*Y}n3tF9#1a04&l@?}nS*njtztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` ric1n9WO`9zZcJWkc_x}rK}LQ_equpEOl~GnNl9jYUUAH1d*PPeqOQuH+cK`qY diff --git a/photoapp/migrations/__pycache__/0011_auto_20200117_1519.cpython-36.pyc b/photoapp/migrations/__pycache__/0011_auto_20200117_1519.cpython-36.pyc index 1c9ebef1e090e5ff1833b240e3e444c23b789c73..b3808a6206d541d2b83af737a61ab6a934273191 100644 GIT binary patch delta 106 zcmaFN+0Mmj%*)Gl;s}4jq>Y^0n1geitztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` ric1n9WO`9zZcJWkc_x}rK}LQ_equpEOl~GnNl9jYUUAIicg$Y_*AOUw delta 70 zcmZqYdd$gb%*)I5xmm`{Jmm4 s^NLFnA!K?{Vs1=cYI!D_P(en1Nq%BMK}>EYP)SK8i^fU5vQ}q*zk~1=ka})FQJ@bl764Q$kbM*@{ Z@=Nj)3kvjeGlBe)%>2A!{mCIr3jvIm8ae;~ diff --git a/photoapp/migrations/__pycache__/0013_auto_20200123_1409.cpython-36.pyc b/photoapp/migrations/__pycache__/0013_auto_20200123_1409.cpython-36.pyc index f159901291e6532f90425652ae4cc059c07521b7..3490ddfb8cb65da4ccc1ea9b6c2fc32c32b09212 100644 GIT binary patch delta 107 zcmcb}`jwT-n3tF9#1Z}k4yKJ<-x-5*oULL)i&Kk=W86bsTtZ{qgZ-W3J>mm`{Jmm4 s^NLFnA!K?{Vs1=cYI!D_P(en1Nq%BMK}>EYP)SK8i^fU5vQ}q*zk~1=ka})FQJ@bl764Q$kbM*@{ Z@=Nj)3kvjeGlBe)%>2A!{mCIr3jupE8S?-D diff --git a/photoapp/migrations/__pycache__/0014_auto_20200125_0710.cpython-36.pyc b/photoapp/migrations/__pycache__/0014_auto_20200125_0710.cpython-36.pyc index eaf01f9640e1bdcc0246432b360fddef089d4ac1..dd6fdfd0fa4d82295cfc6f61a7253e3d958a73b0 100644 GIT binary patch delta 107 zcmcb}`jwT-n3tF9#1Z}k4yKJ<-x-5*oULL)i&Kk=W86bsTtZ{qgZ-W3J>mm`{Jmm4 s^NLFnA!K?{Vs1=cYI!D_P(en1Nq%BMK}>EYP)SKmm`{Jmm4 s^NLFnA!K?{Vs1=cYI!D_P(en1Nq%BMK}>EYP)SKh($ delta 85 zcmey$dY_fcn3tF9cB*dNSH_K8-x+Pg^fU5vQ}q*zk~1=ka})FQT~dp)OY#f!GxLf| l67@YnWO`9zu6{vAeo1~}L4kg5CXio}nV(mzKRJYHApkklAMXGF diff --git a/photoapp/migrations/__pycache__/__init__.cpython-36.pyc b/photoapp/migrations/__pycache__/__init__.cpython-36.pyc index e3106dbf1f9282ac867c951d5c09d41cec4115b5..3b19618d50873069f6901788b5cb28445bbe0fca 100644 GIT binary patch delta 103 zcmeBS+`!0T%*)Gl;s}4jL=N-dSZAx4(Bjmh;u!Z(7njf&_h5hLc#rsiAb+nI&%EN2 oLNn(0YVy=EcMt(_t uVnKm^ZYGdll9``ZtREkrnU`4-AFo$Xd5gm)H$SB`C)JLTfq|hIh#3I%rXM)~ diff --git a/photoapp/templates/photoapp/postlist.html b/photoapp/templates/photoapp/postlist.html index 5d36fbd..1278a61 100644 --- a/photoapp/templates/photoapp/postlist.html +++ b/photoapp/templates/photoapp/postlist.html @@ -20,7 +20,9 @@

THE

{{i.author}}



- +
+
+add comment

{{i.caption}}


{{i.date_posted}}
diff --git a/photoapp/templates/photoapp/viewpost.html b/photoapp/templates/photoapp/viewpost.html index 4be2049..c173463 100644 --- a/photoapp/templates/photoapp/viewpost.html +++ b/photoapp/templates/photoapp/viewpost.html @@ -13,8 +13,8 @@

User is -{{posts.author}}


{{posts.caption}}



likes is -{{l}}
- - + +
add comment
{% for i in co %} From e770d482a1e38bab352372d76d997a2b83470be8 Mon Sep 17 00:00:00 2001 From: Aurva Jyoti Paul Date: Sat, 30 Jan 2021 03:30:09 +0530 Subject: [PATCH 2/4] Added User search page with further development in mind --- instagram/__pycache__/__init__.cpython-36.pyc | Bin 130 -> 150 bytes instagram/__pycache__/settings.cpython-36.pyc | Bin 2924 -> 2930 bytes instagram/__pycache__/urls.cpython-36.pyc | Bin 1170 -> 1190 bytes instagram/__pycache__/wsgi.cpython-36.pyc | Bin 537 -> 557 bytes photoapp/__pycache__/__init__.cpython-36.pyc | Bin 129 -> 149 bytes photoapp/__pycache__/admin.cpython-36.pyc | Bin 334 -> 354 bytes photoapp/__pycache__/apps.cpython-36.pyc | Bin 349 -> 369 bytes photoapp/__pycache__/forms.cpython-36.pyc | Bin 2109 -> 2455 bytes photoapp/__pycache__/models.cpython-36.pyc | Bin 2656 -> 2851 bytes photoapp/__pycache__/urls.cpython-36.pyc | Bin 926 -> 992 bytes photoapp/__pycache__/views.cpython-36.pyc | Bin 5073 -> 5596 bytes photoapp/forms.py | 8 +++- .../migrations/0017_auto_20210130_0138.py | 20 ++++++++++ .../migrations/0018_auto_20210130_0256.py | 20 ++++++++++ .../migrations/0019_auto_20210130_0257.py | 27 +++++++++++++ .../__pycache__/0001_initial.cpython-36.pyc | Bin 1278 -> 1298 bytes .../0002_auto_20191218_0717.cpython-36.pyc | Bin 564 -> 584 bytes .../0003_post_image.cpython-36.pyc | Bin 580 -> 600 bytes .../0004_auto_20191218_1037.cpython-36.pyc | Bin 581 -> 601 bytes .../0005_auto_20191218_1052.cpython-36.pyc | Bin 580 -> 600 bytes .../0006_auto_20191218_1106.cpython-36.pyc | Bin 581 -> 601 bytes .../0007_profile_followers.cpython-36.pyc | Bin 718 -> 738 bytes .../__pycache__/0008_comment.cpython-36.pyc | Bin 1168 -> 1188 bytes .../0009_auto_20191226_1000.cpython-36.pyc | Bin 926 -> 946 bytes .../0010_auto_20200117_1515.cpython-36.pyc | Bin 1062 -> 1082 bytes .../0011_auto_20200117_1519.cpython-36.pyc | Bin 1251 -> 1271 bytes .../0012_auto_20200122_1626.cpython-36.pyc | Bin 721 -> 741 bytes .../0013_auto_20200123_1409.cpython-36.pyc | Bin 721 -> 741 bytes .../0014_auto_20200125_0710.cpython-36.pyc | Bin 721 -> 741 bytes .../0015_auto_20200126_1011.cpython-36.pyc | Bin 735 -> 741 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 140 -> 160 bytes photoapp/models.py | 2 + photoapp/templates/photoapp/search.html | 6 +++ photoapp/templates/photoapp/show.html | 5 +++ photoapp/urls.py | 1 + photoapp/views.py | 36 +++++++++++++++++- 36 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 photoapp/migrations/0017_auto_20210130_0138.py create mode 100644 photoapp/migrations/0018_auto_20210130_0256.py create mode 100644 photoapp/migrations/0019_auto_20210130_0257.py create mode 100644 photoapp/templates/photoapp/search.html create mode 100644 photoapp/templates/photoapp/show.html diff --git a/instagram/__pycache__/__init__.cpython-36.pyc b/instagram/__pycache__/__init__.cpython-36.pyc index 8115893b27a7033b71aa6f74ee628727e2437ffc..dbe3ab6a978139f7d53b29770940099bd7639013 100644 GIT binary patch delta 104 zcmZo-oW{su%*)HQI8!8HB8Pdnv$Iu9XmM&$ag2MYi%V#Xd$7NAyhnUMkiS=qXI^nh wVvJ`9gppp9m>ZJ`5(2a0<1_OzOXB183My}L*yQG?l;)(`F)}bP6az5>0MtGqUH||9 delta 57 zcmbQn*u=Nn(0YVy=EBoHemR F4gdig6I=iQ diff --git a/instagram/__pycache__/settings.cpython-36.pyc b/instagram/__pycache__/settings.cpython-36.pyc index af16132a21008235409bea521d03975cafb79ec7..d33124bb879cf877c7f33e358df4dcbc0c0d4990 100644 GIT binary patch delta 81 zcmaDO_DPJ(n3tDpai&PZ6#k7|Gr26CovmU*i&Kk=W86bsTtZ{qgZ-W3J>mm`{Jmm4 b^NLFnV?0A3jP#4{$4XTFVGGr5dy^)vEwQ}q*zk~1=ka})FQT~dp)OY#f!GxLf| V67@YnWO`9zE`$$eO}@i54FK^>8|eT5 diff --git a/instagram/__pycache__/urls.cpython-36.pyc b/instagram/__pycache__/urls.cpython-36.pyc index fbcf44db0ef0e08eafbcf0702b15babadc583e28..4f7c365c6dd33cbe6cbdaa8539656f56445f0870 100644 GIT binary patch delta 80 zcmbQlxr~$3n3tDpai&Ou+(u3d7E60)tC-N@)S}`T_fQv?&=~h%f9H6Q_<$gPuNcp~ a;*!J|&kzVBy(lp^CKDtCW=&3G(E$L=#~M8V delta 60 zcmZ3+If;|gn3tD}bERe+!$wXE7FBKijQreG{luc=jLhQP#5{e^yyB9?^rFOE{Y*G( IautgX01K%T9RL6T diff --git a/instagram/__pycache__/wsgi.cpython-36.pyc b/instagram/__pycache__/wsgi.cpython-36.pyc index e398148185561c61a5a9e22db202397976f9700f..318b504ce1c9b0a0192985ab72e3cad79c4b074a 100644 GIT binary patch delta 80 zcmbQqvX+I@n3tDpai&PZ?2Vi!87=LdtztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` aic1n>JVPLi^rFPvm`somm^Jx3qY?lU`5Vvx delta 60 zcmZ3>GLwbVn3tF9b%91)_eRc>jH=rD8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`k8Rn IWNs!U0AA-5X8-^I diff --git a/photoapp/__pycache__/__init__.cpython-36.pyc b/photoapp/__pycache__/__init__.cpython-36.pyc index 026aa9e55263cc1b01da157f28be35255b69afef..fe66bb0c97c16c8c8148eec9f3c7764e4cd2f5e3 100644 GIT binary patch delta 103 zcmZoW}&kzbOZSWplXAD@|*SrQ+wS5SG2!zMRBr8Fnij*)?Zp%{o60Iz}| A{{R30 delta 56 zcmbQr*vQCX%*)I5xNn(0YVy=EcMt(_t LVnKoa#Bw?1A_d$Vm$MT dOA=!|Lm-UwqQu;of{gr<{KSHSn8})qssJYZ8*Tsq delta 58 zcmaFFbdHJBn3tF9b%93QgNdAfRJ8Ro@^e%56N{2FGK+H)^YlIQic1pHixPA73o`Oc O@)HXR^e5XgssaFQ02K@X diff --git a/photoapp/__pycache__/apps.cpython-36.pyc b/photoapp/__pycache__/apps.cpython-36.pyc index 00b64210d5f804deceff2e69392e19829381d898..4d294d5543af2de9004ee449a469058335b96473 100644 GIT binary patch delta 77 zcmcc1^pT0vn3tDpai&N@!bHxC7Iw~7F`>n&Ma41hp)M|=G48?s&hZ}c0YUy=F`jwF cC5bVfArMA-QDSaPK}LQ_equpE%*2230O{`=z@dHSAt#U+X9MTxok1sVAz N`H2Mu`jdqi;{jCA6o>!- diff --git a/photoapp/__pycache__/forms.cpython-36.pyc b/photoapp/__pycache__/forms.cpython-36.pyc index 9b40b14db857fff694fb73ddc4888623c64bffa0..91c161006be05f95d3c07d00ec63ac218547d43d 100644 GIT binary patch literal 2455 zcmbVNOK;Oa5cc|=SDUn@yrFROB@%E$2r9LrfJCT(3dxFO-0ZeZWyfLd29OG(q#N9f%-Hg+*!Jz%@txT9-F%D{HR7hzV=>8;HJZ^V8r{X{4JpEGoJ^imiV^aa z51~|`a)T71`HXA6PAg$trE}f92dC=8foIDWO(ok99f$>pMTjm5 z&sJ`brwjts41ze}vq+HM4uVg!Fv4U(AhB;{(MJ&}dv7cvp8n9}DzZTQezx&=h-Ih4 zt)0!yo#EEIHygo=VEgTxSHqW+Gz*6>-xtch4CCSSAjy(&IvwUU>QBEa6MJ}&ye7gya{oO1Xb;yU1MVsGs-Ive~~}4e*l9D z*GKR=MT00Mg0Sl%xHIKpb}@pe&pM{5AZQYTI6l_V^7;52!2%@UGw}3Nqc&LJRDG~+ zQ#6WHf(5%KSiOQS^IlY899q{pW~$(25MDak&CzNlML{|<6JN4{$K+i~P(=zS?h>@Z z`Kpi99f}5FOQc}eMQToqqKQ|Kx(u^cD=7-3jNNgPpFoi79xX99s*qXu^#79xn%0MG zjiS*FO2}Z>gshc{P>v2}Xtn23T!vQNGr`3f#BBmT;avsCCGRD`xlhCDgM(-ks00W0 zz*|x_KMW`Pi3AJOjl$@Ul1V1VyZvyM9rW`HEG=#`dv4_Q%-d^z7_b9%{i0w1n92ry z Mc#Z229F%C35)D9t+j0#8tGcL9EB6V_Oqc9a6d*+tYO^-G#@c$#%ApZ$hG_g{sjMr z(_T4M`~yzR*fDK!Bq}?~WMsR{p!w+54erneq6ZA2Bvu_}n#z?FQ z5)gvA9_zvg4A2c`#-^|WOW1)eoWLp8t=JV_;1TVu#%$(%)tJM*3nOTO?J^H+kCXE@ zcsk%|u{L>90L~Hh8c3TbHmi%_qv5B~oOdm?s&Rmju0r za*ky(i(;Vm%(k%OwNcQ|neKGNE*@9BCjiQ61i=v0355l*V8x|?UP_@EPBy1UT&^uxH zaY#h^F;6wmD72Y3Az})TVy#slT?h-d6FkI zO-Dr|hUph&;<+3M%aBJdF^Rkj%EUM20Dk2bift6=zN%7cd+75(AeI?06EYNb!$$Rr zW^?30tzCcHU27Mxnwiipd$n^jzHFK^r703fS&^V;T)A;FEf_WN4Y`jeKmy78AfQA4 zoEi@%cTiy2jps*Tu#wFXya&<9hYCTon<99UGMaBj5c@O6GBpHEKoGBrwc5EEUm#e5 zg!oK+{mN(z7SgFXSPvi?Sy_RFc0;hXO1i8EPK|LmpT=0JhL-_&={QCBve z&L=*Rk03!EDZFvFpcPW9IZ_WH8gFQY6xvOZTGOJO)HS4T!>qkpiV`W~G)jsah~#<# zTP%z^WEL*{|0W_GnnU&&qLJtoWN1(PfwI{-U7RHn52_AIV>nF~xr|PSbeYeG#XQc+ z;cTysV#~z@!G5d#O>xB}mM*LpgHw4&IM@+kiDN+Gc_emD;$AilAmzS-dhk#28VQ@> R0PBzr*(Du)U~gOa`2*@>i0uFX diff --git a/photoapp/__pycache__/models.cpython-36.pyc b/photoapp/__pycache__/models.cpython-36.pyc index b595347069c855ab54887ddcd03c8f61b19e2e1f..60d9e7e54074828ffd4c1727d09f0e941eb2bdff 100644 GIT binary patch delta 312 zcmaDLvRF*nn3tDpa;->$9yf#a_;~wnq9Pbey5ajO_V zCFaHyWaO9RCl(aMY+lH8p3N&6$x;Spn5_~(Mk+%TV+unQQz~;7OA2EOQ!ir_YYH>a zT9#X^$)!LGGrur0FlaIsaRC+kX|hdzz$#*0qzmNS;s8nKCFZ6U2?M!Egb0Xh4J0gq txR?n@a4>@Tewreai#azkT2EHsQj-B$&%+3Z%tBlutRk#JJVKm8>;S7uK?48) delta 135 zcmZ21_CQ40n3tF9b%93QS~doT#|%h-1;};);^I9Mm3OnHhy*ieif;TilTk%SKO;Xk zRX?#PIU}<;H!)A&Gq1QLF})};SHB=5za&4gpg@1~ai;TZ%zm1}ll8eaPJYUzBqatk TiiZ&nnT5DSSVdTcc!W3sF-stV diff --git a/photoapp/__pycache__/urls.cpython-36.pyc b/photoapp/__pycache__/urls.cpython-36.pyc index f346b9be229790cf3b8157570dbc8da7c6c192ab..2656045d74f3620b7244d062fb575e33f9aa0bc2 100644 GIT binary patch delta 240 zcmbQo{(xQCn3tDpf4NA)31$X{#|%h72*`E-;^HS0l`l%9GN#CjH0Tz0X;Dr= zVo6DAQC{&%h9W_r7?}8F=WG=d3RGSk;~whb5*p(k?C%`!5g!ob?-k>jS6q@9;~4^B zq!%UT#uQ}am*giF6vP0{E7mKhyv1RYo1apelWNBZa<3ea;9=xp=3|7x$rG6QnD`h0 DZ~H?H delta 157 zcmaFBK9615n3tF9b%91)B{KuVV+JH32xL0|aq+c@$``rPd7}hViTBR@A)Kd~q|BeOU+F;Cw!uec;J qy(lqPzaS&OBtNmBKp&{LSg)Y+7Kcr4eoARhsvRT9LYc|?ndJdr1}zx? diff --git a/photoapp/__pycache__/views.cpython-36.pyc b/photoapp/__pycache__/views.cpython-36.pyc index aa296ef64d8c409b2bd2b470a3fbe61c6fc219dc..fbf4db03050443fe7c3568f2b458ef8c11671d79 100644 GIT binary patch delta 2290 zcmZ8jO>7%Q6y8~T*XzIhI8Ndu&i`MxDT&h1mPY+co2E@m+d%q5x2}Tg*(7#$z3%LW zw2`AoO`&I)a^?yrR0IfB9JnBHKmv{|hzkb}NWF1^3-8UQt`kf1y|?eZeSh<2*1wGY zJ~lX&Ovb)_oPKwzU6THk>V6^M&%ko~J{-KgZKsSBk*GvftHn+mY2d>&Vzt_BMw{Jk zwA&dYV|N%G!bY#25s=g{B2RM6a~cHZT~b?KA^)gm%zQprf>lW`Q1{-Lwa&PJ3w|(1Wy}4geja zgLDY!Av#P)fWAgY7bX1wKS8#L%Ab>km>+k|JS(iOFY}1}+3hYU_}|m#rgJx3lexJI zH)dyVqqG24dF~2V=@6*J{i`D&hLaj&h`ic0AH)*U3bG_ zRF_#VN)PgcGOrFG+r#fD!>aH&#y?Q>J;dsrhPq;0y972 z+$)&{&-Fuj%kq^9E0#TxG)tpegC?46>E1(jf`1nsm`0zzvW{EL&I4~mmmSM;Hj3pH zb_#W*XhbWH>n&MD*V_{~8yh7T`E0Ck3=Q?L2*6GQ&qfeL)*+F#A6hdX3V(Y%{1NLX zmp_Wn%*})SrZTbW*ru-R^W&@3v`o)r*a|)H$1Y(247BmYoONj3EDDYy;LZm{MT4!VCE;rY z$F|KfbX~EEYbIq2XnPI7mo0}~z$cuENRV!pZzhkDoBUbw6BSE`8NS(Yd|Ql1^S<(f zX=xBv2snvwy6pUl$%avI3*jAv48k#lHxR_QzM7x#zNCZmSAQZJ8V?hL&outpib?5& zT}3xN0CVv0I-h7d9OT%vKS%5%dkX%*{cj}+!q3ydMED!+vsj#q`bFkbW0IE_+qGU~GUwDMdJA_D{46@J;T)SSlq?FVh zX-oEq7pa0)=t))32W?e(R=V4;74k?mRMJp)|I96^N=nfkiG2h9zzf-yKrLPXMT~|! zq^&SW!f5_rK)C4KQmRTxtA-(sN1#(manvqI_aEJoyhK%^3RSC0k?e#PrLyYDkP;E{ z2-T`2kn7Q_Vi$dK*pMfWiR*VWRaxEMz46^uXJdTTvn`*jZKi7fn#YjR1DmR2Qct%MejS-ckqAFnpu)V5}^S;zmnKkog zslIM;$EvmicaqCmKp%{jH~?+@MXEOqe)?)tyoV(Lw delta 1796 zcmZ8h&u<$=6!tjY_3tK5)`{a^aqPIsCe*GH(h?e~1e!FdLWl?jWm`2E&o&(xS zrMY-K^825a2h&47-ygoNUmw^@@OP9?N;@aSM}1T_2dyD(2j9m zR!U2WJt1?{N^5Chhs}(Y)w05lm^mx2<-v~9*r`t&qj7o(#scl912B&3QJSEGr@oJf zRs?&9D#9+&Bpp6o_GuGzgr;C)nU2yljF)MKW?`J9Ihu!YijL6&j4B09}tOuPqui;|9CqMl|5Ui?%S4Lt+D#P;aIgs^_K1&wCrZpXgIA}bsce! z)vRiB-)`BpX0!U9p&vSx=8-EI4XVH2kNWrle1v6rvF}HcUr{vN^EP(iO;Yq$1o z#zy#~U@_IH#wAU!inCI_3|7bj|0Vb?gjfm9zfpj*YQzgMfMlY==g|_h!6vgG8m8VA zPQpc05GwD)xe(+@Xof8EXQ6LNf`1(zO(GM6W(CziFrDqbbHr}&-@?Tg@w_Xw9i2Js z7T8+&p>3M>q0!i5FX0+7v~bgQTDzv5t$^nc|B6UjvLj02*7TF&B_QO!#JhSajDT@35I&9;$Oiu* z`WIQ_-^40$QGvg1yToJ_{&%c=f+BR~sKC^fL0_O}%eatdj%cy2tq|s zRoK(LlY|?p+m@v_T8=B3#(_@RYj|K2Y5b(Y2H*6{zM6$B*5*;mJLnout7X1dQK>W zVck*ssMgrCD|MUc6@1!G#cA0L?{gT}V`uB_mH`ZSrRF$YXATM diff --git a/photoapp/forms.py b/photoapp/forms.py index 140f104..0881948 100644 --- a/photoapp/forms.py +++ b/photoapp/forms.py @@ -1,6 +1,6 @@ from django import forms from django.contrib.auth.models import User -from .models import Profile, Post, Comment +from .models import Profile, Post, Comment,cuser from django.contrib.auth.forms import UserCreationForm class UserForm(UserCreationForm): @@ -29,3 +29,9 @@ class Meta: model=Profile fields=('bio','image') + +class searchuform(forms.ModelForm): + class Meta: + model=cuser + fields=('username',) + diff --git a/photoapp/migrations/0017_auto_20210130_0138.py b/photoapp/migrations/0017_auto_20210130_0138.py new file mode 100644 index 0000000..3b89656 --- /dev/null +++ b/photoapp/migrations/0017_auto_20210130_0138.py @@ -0,0 +1,20 @@ +# Generated by Django 2.0.2 on 2021-01-29 20:08 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('photoapp', '0016_auto_20210125_1053'), + ] + + operations = [ + migrations.AlterField( + model_name='comment', + name='date', + field=models.DateTimeField(default=datetime.datetime(2021, 1, 29, 20, 8, 31, 868623, tzinfo=utc)), + ), + ] diff --git a/photoapp/migrations/0018_auto_20210130_0256.py b/photoapp/migrations/0018_auto_20210130_0256.py new file mode 100644 index 0000000..c16eddb --- /dev/null +++ b/photoapp/migrations/0018_auto_20210130_0256.py @@ -0,0 +1,20 @@ +# Generated by Django 2.0.2 on 2021-01-29 21:26 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('photoapp', '0017_auto_20210130_0138'), + ] + + operations = [ + migrations.AlterField( + model_name='comment', + name='date', + field=models.DateTimeField(default=datetime.datetime(2021, 1, 29, 21, 26, 11, 838287, tzinfo=utc)), + ), + ] diff --git a/photoapp/migrations/0019_auto_20210130_0257.py b/photoapp/migrations/0019_auto_20210130_0257.py new file mode 100644 index 0000000..bbd21f8 --- /dev/null +++ b/photoapp/migrations/0019_auto_20210130_0257.py @@ -0,0 +1,27 @@ +# Generated by Django 2.0.2 on 2021-01-29 21:27 + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('photoapp', '0018_auto_20210130_0256'), + ] + + operations = [ + migrations.CreateModel( + name='cuser', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('username', models.CharField(max_length=500)), + ], + ), + migrations.AlterField( + model_name='comment', + name='date', + field=models.DateTimeField(default=datetime.datetime(2021, 1, 29, 21, 27, 26, 629021, tzinfo=utc)), + ), + ] diff --git a/photoapp/migrations/__pycache__/0001_initial.cpython-36.pyc b/photoapp/migrations/__pycache__/0001_initial.cpython-36.pyc index 980b38c6c58dc93590e06ddfcefbe4e9ef79e422..7da9be68576e08b9eee45c6af0be31e73e3498fd 100644 GIT binary patch delta 90 zcmeyzIf;wYn3tDpai&PZ_l=w%n4JTitztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` oic1n>JVPLi^rFPvn1YP_lKjMif|%S)AipFtKd(4uvIfgF0FCJ&>;M1& delta 70 zcmbQl^^cR&n3tF9b%93Q#f_XFnDuS-GxBp&^%IMdGct>F6Z7;v^NLFn(~A;w^$Rlc YOY##73iNX`f&7xp{JdiQ$u=z40D!+5KL7v# diff --git a/photoapp/migrations/__pycache__/0002_auto_20191218_0717.cpython-36.pyc b/photoapp/migrations/__pycache__/0002_auto_20191218_0717.cpython-36.pyc index ddd76e0cfebd76d8f6f87ec1b90b4f33fa9063fc..a9f3a7fd98788e071b275a016b487f116ce54ef3 100644 GIT binary patch delta 91 zcmdnOa)O1+n3tDpai&NDBhyB%YDVW6XRDad;?$zz823;Ym(UpZV1MU$kNAKff3FzN pyyB9?7|#$0BfTgwH>MyXza&4gpdcnU6UZ;g%+D*1nY@Lu0RSIEAEE#N delta 71 zcmX@XvW11qn3tF9b%93QE5?mn)r|Tc`WgATsrrdU$r+i&xrurDo_WP3iRnd&x%vee Z`6c;@1qJ%KnLvI?W`16={^S#k4FGOK8Up|T diff --git a/photoapp/migrations/__pycache__/0003_post_image.cpython-36.pyc b/photoapp/migrations/__pycache__/0003_post_image.cpython-36.pyc index a85fb0584b25b4eb42689137813121adc694c25f..8bc409828a949fb2154392a7faf51a023760f0b7 100644 GIT binary patch delta 90 zcmX@Ya)X7_n3tDpai&PZqK%x>8J$C%tztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` oic1n>JVPLi^rFPvn1YP_lKjMif|%S)AipFtKd(4u@_EKm09;fcg8%>k delta 70 zcmcb?a)gD`n3tF9b%93QgpHij8TB3XGxBp&^%IMdGct>F6Z7;v^NLFn(~A;w^$Rlc YOY##73iNX`f&7xp{JdiQ$&VRJ0b&dp>Hq)$ diff --git a/photoapp/migrations/__pycache__/0004_auto_20191218_1037.cpython-36.pyc b/photoapp/migrations/__pycache__/0004_auto_20191218_1037.cpython-36.pyc index 060235523b0f95e2f5c45ed72c4e64a61392ec60..db5e7ae8a8a138152be4ada1c7cdbb94f90af55b 100644 GIT binary patch delta 90 zcmX@ga+8JAn3tDpai&PZ?2Vig7@cFBtztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` oic1n>JVPLi^rFPvn1YP_lKjMif|%S)AipFtKd(4u@(IRT09z0sfB*mh delta 70 zcmcb~a+HPBn3tF9b%91)=SI#6jQSq>8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQuEYkYAFSpI00+`8Z=O09h&^c>n+a delta 70 zcmcb?a)gD`n3tF9b%91)+eXfQMtu+cjQreG{luc=jLhQP#5{e^yyB9?^rFOE{eq1A YlKjMi0{z@fAipFtKd)GS@@>Xi0AH#Z-~a#s diff --git a/photoapp/migrations/__pycache__/0006_auto_20191218_1106.cpython-36.pyc b/photoapp/migrations/__pycache__/0006_auto_20191218_1106.cpython-36.pyc index 6122798c66d7e1241ea10720fe619b5da529fbec..365528c540d41eebdbb5b4503651f71707f5fc21 100644 GIT binary patch delta 90 zcmX@ga+8JAn3tDpai&PZ%#EBA7@cFBtztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` oic1n>JVPLi^rFPvn1YP_lKjMif|%S)AipFtKd(4u@(IRT09tk+egFUf delta 70 zcmcb~a+HPBn3tF9b%91)`$o8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQutC-N@)S}`T_fQv?&=~h%f9H6Q_<$gPuNcp~ o;*!J|&kzVBy(lp^rXVA~BtNmBASO2x$S=vv&nu3ZyodP;03Jdh5C8xG delta 70 zcmZ3&If0YYn3tF9b%92l`9{tbW_?@zjQreG{luc=jLhQP#5{e^yyB9?^rFOE{eq1A YlKjMi0{z@fAipFtKd)GS@&)EA05H@UZ2$lO diff --git a/photoapp/migrations/__pycache__/0009_auto_20191226_1000.cpython-36.pyc b/photoapp/migrations/__pycache__/0009_auto_20191226_1000.cpython-36.pyc index 74ffca3bf8851e9bb7f23a1b32a33b35fc536162..35f82b0344a29d735989dd45237d99681122a9b0 100644 GIT binary patch delta 90 zcmbQozKNaFn3tDpai&Ou`9{v=OwKXRRxzQ)sYS&x?x8L&p)u~k{?73p@c}{pUNN3| o#U+U`o*@uMdQoC-OhHC|Nq%BMK}>EYkYAFSpI00+`99Nr04ru7MgRZ+ delta 70 zcmdnQK98N#n3tF9b%92l%tp@TO!^-B8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQuEYkYAFSpI00+*`E1106K*q{r~^~ delta 70 zcmdnRv5bS$n3tF9b%93Q<&B)|%=#Ys8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQuY^0n4M#stztrpQ;UjY+(TVlLSx*6{hi}I;sb*Gy<$A` oic1n>JVPLi^rFPvn1YP_lKjMif|%S)AipFtKd(4u@;m0Q0DU7Ng#Z8m delta 70 zcmey)`IwW_n3tF9b%91)`bN%e%=#Ys8Tq-X`iVu!8JWeoiFx{-dBr7(=|zdT`UM&J YCHaX31^T&}Kz>PPeqOQuWG0rc0CKn))Bpeg diff --git a/photoapp/migrations/__pycache__/0012_auto_20200122_1626.cpython-36.pyc b/photoapp/migrations/__pycache__/0012_auto_20200122_1626.cpython-36.pyc index 85c1c0eef6ae2d4ed1dcd5570dba45537856b5e6..da87dad9987d907e9d8857726e5117e89c564a53 100644 GIT binary patch delta 91 zcmcb}`jnN+n3tDpai&ND2h&Eb?~Kkd&Q>v@#i>QbG47!*E}=2*!T!$i9`OM|{$4Sj pdBr7(F`gk1MtV_VZcIT&eo1~}K|xGzCXio}nV(l2GueP?ApltFAO8RV delta 71 zcmaFLdXbgOn3tDpcDY8}7sicT-x>8i^fU5vQ}q*zk~1=ka})FQJ@bl764Q$kbM*@{ Z@=Nj)3kvjeGlBe)%>2A!{mCv&3jv4s8X5oq diff --git a/photoapp/migrations/__pycache__/0013_auto_20200123_1409.cpython-36.pyc b/photoapp/migrations/__pycache__/0013_auto_20200123_1409.cpython-36.pyc index f159901291e6532f90425652ae4cc059c07521b7..aa9b15d7f169ad26a021a7b2c6d7e9fd1b9a1197 100644 GIT binary patch delta 91 zcmcb}`jnN+n3tDpai&ND2h&Eb?~Kkd&Q>v@#i>QbG47!*E}=2*!T!$i9`OM|{$4Sj pdBr7(F`gk1MtV_VZcIT&eo1~}K|xGzCXio}nV(l2GueP?ApltFAO8RV delta 71 zcmaFLdXbgOn3tDJaiwP57sicT-x>8i^fU5vQ}q*zk~1=ka})FQJ@bl764Q$kbM*@{ Z@=Nj)3kvjeGlBe)%>2A!{mCv&3jubK8Pfm& diff --git a/photoapp/migrations/__pycache__/0014_auto_20200125_0710.cpython-36.pyc b/photoapp/migrations/__pycache__/0014_auto_20200125_0710.cpython-36.pyc index eaf01f9640e1bdcc0246432b360fddef089d4ac1..5317ca4fd283e40fe4bed5eae8b7c1478d2e1dcc 100644 GIT binary patch delta 91 zcmcb}`jnN+n3tDpai&ND2h&Eb?~Kkd&Q>v@#i>QbG47!*E}=2*!T!$i9`OM|{$4Sj pdBr7(F`gk1MtV_VZcIT&eo1~}K|xGzCXio}nV(l2GueP?ApltFAO8RV delta 71 zcmaFLdXbgOn3tF9?n~{sFN_v@#i>QbG47!*E}=2*!T!$i9`OM|{$4Sj pdBr7(F`gk1MtV_VZcIT&eo1~}K|xGzCXio}nV(l2Gue)5Apl-nARGVy delta 85 zcmaFLdY_fcn3tF9cB*dNSH_K8-x+Pg^fU5vQ}q*zk~1=ka})FQT~dp)OY#f!GxLf| l67@YnWO`9zu6{vAeo1~}L4kg5CXio}nV(mzKiP$8ApkT~AI|^) diff --git a/photoapp/migrations/__pycache__/__init__.cpython-36.pyc b/photoapp/migrations/__pycache__/__init__.cpython-36.pyc index e3106dbf1f9282ac867c951d5c09d41cec4115b5..a8ba59d4b1c86a38bbc0c5d47a5452900838e349 100644 GIT binary patch delta 87 zcmeBST)@a-%*)HQI8!8HB8R!Nud`K5XmM&$ag2MYi%V#Xd$7NAyhnUMkiS=qXI^nh lVvJ`9gppp9m>W}&kzbOZSWpm?n+fEXWaj4;$4tzV0|2x59wq<) delta 94 zcmZ3$*u%(S%*)I5xNn(0YVy=EcMt(_t uVnKm^ZYGdll9``ZtREkrnU`4-AFo$Xd5gm)H$SB`C)JLTfq|hIh#3Ix#vdsF diff --git a/photoapp/models.py b/photoapp/models.py index b65f2e3..35bd1ed 100644 --- a/photoapp/models.py +++ b/photoapp/models.py @@ -54,4 +54,6 @@ class Likes(models.Model): def __str__(self): return str(self.post) +class cuser(models.Model): + username=models.CharField(max_length=500) diff --git a/photoapp/templates/photoapp/search.html b/photoapp/templates/photoapp/search.html new file mode 100644 index 0000000..17fba12 --- /dev/null +++ b/photoapp/templates/photoapp/search.html @@ -0,0 +1,6 @@ +
+ +{{form.username}} +{% csrf_token %} +
+
\ No newline at end of file diff --git a/photoapp/templates/photoapp/show.html b/photoapp/templates/photoapp/show.html new file mode 100644 index 0000000..14fe928 --- /dev/null +++ b/photoapp/templates/photoapp/show.html @@ -0,0 +1,5 @@ +

USER:

+ +
USERNAME:{{k.username}} +
NAME:{{k.first_name|title}} {{k.last_name|title}} +
Email:{{k.email}} diff --git a/photoapp/urls.py b/photoapp/urls.py index a975a17..b3d427e 100644 --- a/photoapp/urls.py +++ b/photoapp/urls.py @@ -16,4 +16,5 @@ path('home//create_comment',views.create_comment,name='create-comment'), path('home//like_post', views.like_post, name='like-post'), + path('home/search',views.searchuser,name='searchuser'), ] \ No newline at end of file diff --git a/photoapp/views.py b/photoapp/views.py index e191952..726fbb3 100644 --- a/photoapp/views.py +++ b/photoapp/views.py @@ -3,7 +3,7 @@ from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required -from .forms import UserForm,CreatePostForm,UpdatePostForm,CreateCommentForm, UpdateProfileForm +from .forms import UserForm,CreatePostForm,UpdatePostForm,CreateCommentForm, UpdateProfileForm,searchuform from django.contrib.auth.models import User from .models import Profile,Post, Comment, Likes from django.core.files.storage import FileSystemStorage @@ -194,7 +194,39 @@ def like_post(request,key): - +def searchuser(request): + if request.method=='POST': + print('2') + form=searchuform(request.POST) + usn=User.objects.all() + print(len(usn)) + #f=form.cleaned_data['username'] + print(form) + for i in usn: + #if i.username==form.username: + print(i.username) + + + if form.is_valid(): + print('17') + print(form) + f=form.cleaned_data['username'] + print(f) + for k in usn: + if k.username==f: + print(k.last_name) + break + return render(request,'photoapp\show.html',{'k':k}) + # print('1') + # j=form.save(commit=False) + # usinst=User.objects.get(username=j.username) + # print(usinst) + # return render(request,'show.html',{'usinst':usinst}) + #else: + # form=searchuform() + else: + form=searchuform() + return render(request,'photoapp\search.html',{'form':form}) From f6298554b1c716a99650a170eb7dc9da339ca80c Mon Sep 17 00:00:00 2001 From: Aurva Jyoti Paul Date: Sat, 30 Jan 2021 13:48:09 +0530 Subject: [PATCH 3/4] enhanched the user search system --- instagram/__pycache__/__init__.cpython-36.pyc | Bin 150 -> 158 bytes instagram/__pycache__/settings.cpython-36.pyc | Bin 2930 -> 2938 bytes instagram/__pycache__/urls.cpython-36.pyc | Bin 1190 -> 1198 bytes instagram/__pycache__/wsgi.cpython-36.pyc | Bin 557 -> 565 bytes photoapp/__pycache__/__init__.cpython-36.pyc | Bin 149 -> 157 bytes photoapp/__pycache__/admin.cpython-36.pyc | Bin 354 -> 362 bytes photoapp/__pycache__/apps.cpython-36.pyc | Bin 369 -> 377 bytes photoapp/__pycache__/forms.cpython-36.pyc | Bin 2455 -> 2463 bytes photoapp/__pycache__/models.cpython-36.pyc | Bin 2851 -> 2859 bytes photoapp/__pycache__/urls.cpython-36.pyc | Bin 992 -> 1000 bytes photoapp/__pycache__/views.cpython-36.pyc | Bin 5596 -> 5676 bytes .../migrations/0020_merge_20210130_1317.py | 14 ++++++++++++++ .../__pycache__/0001_initial.cpython-36.pyc | Bin 1298 -> 1306 bytes .../0002_auto_20191218_0717.cpython-36.pyc | Bin 584 -> 592 bytes .../0003_post_image.cpython-36.pyc | Bin 600 -> 608 bytes .../0004_auto_20191218_1037.cpython-36.pyc | Bin 601 -> 609 bytes .../0005_auto_20191218_1052.cpython-36.pyc | Bin 600 -> 608 bytes .../0006_auto_20191218_1106.cpython-36.pyc | Bin 601 -> 609 bytes .../0007_profile_followers.cpython-36.pyc | Bin 738 -> 746 bytes .../__pycache__/0008_comment.cpython-36.pyc | Bin 1188 -> 1196 bytes .../0009_auto_20191226_1000.cpython-36.pyc | Bin 946 -> 954 bytes .../0010_auto_20200117_1515.cpython-36.pyc | Bin 1082 -> 1090 bytes .../0011_auto_20200117_1519.cpython-36.pyc | Bin 1271 -> 1279 bytes .../0012_auto_20200122_1626.cpython-36.pyc | Bin 741 -> 749 bytes .../0013_auto_20200123_1409.cpython-36.pyc | Bin 741 -> 749 bytes .../0014_auto_20200125_0710.cpython-36.pyc | Bin 741 -> 749 bytes .../0015_auto_20200126_1011.cpython-36.pyc | Bin 741 -> 749 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 160 -> 168 bytes .../templates/photoapp/invalidsearch.html | 2 ++ photoapp/views.py | 7 ++++++- 30 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 photoapp/migrations/0020_merge_20210130_1317.py create mode 100644 photoapp/templates/photoapp/invalidsearch.html diff --git a/instagram/__pycache__/__init__.cpython-36.pyc b/instagram/__pycache__/__init__.cpython-36.pyc index dbe3ab6a978139f7d53b29770940099bd7639013..f098a57f1d0ea0ea53288def869b8bad302c872e 100644 GIT binary patch delta 34 pcmbQnIFFItn3tC;j8AkTy9J~7Lh+p>3RxzQ)sYS&x?x8L&p)u~k a{?73p@c}{pUNN3|#U+U`o*|QSSsVfUIThvr diff --git a/instagram/__pycache__/wsgi.cpython-36.pyc b/instagram/__pycache__/wsgi.cpython-36.pyc index 318b504ce1c9b0a0192985ab72e3cad79c4b074a..0745dd6cf6ccd86670840202213f5b6442851206 100644 GIT binary patch delta 37 tcmZ3>vXzD1n3tC;j8AkU`)Ni-_sN$T6}kLU%N5e{b5c@^CVyiz2LQS?3nu^o delta 29 lcmdnWvX+J2n3tDpai+*d_S1}v_LDC&Dl&P7O#a7c4gh)L2%P`` diff --git a/photoapp/__pycache__/__init__.cpython-36.pyc b/photoapp/__pycache__/__init__.cpython-36.pyc index fe66bb0c97c16c8c8148eec9f3c7764e4cd2f5e3..ffb0b17362f861f58ce6521a09f9734fac69d5f2 100644 GIT binary patch delta 34 pcmbQrIG2&#n3tC;j8AkTy9J}yL;S5836}r> delta 30 lcmbO)JYAUGn3tDJwozmwy8{!W{bUa&MJCUX&BaVQ>;Pwl2A==` diff --git a/photoapp/__pycache__/models.cpython-36.pyc b/photoapp/__pycache__/models.cpython-36.pyc index 60d9e7e54074828ffd4c1727d09f0e941eb2bdff..9cebf3c55ccf98382da155980b7b327e8c9bec48 100644 GIT binary patch delta 38 ucmZ21wpxtcn3tC;j8AkUdj}Jv$K(l2id=rFRBRZ~y?jmI~7V delta 30 mcmZ22wpfhan3tDpa;?Zl_6{aShshI|6q!6jHt%LC-~a%9kqAuy diff --git a/photoapp/__pycache__/urls.cpython-36.pyc b/photoapp/__pycache__/urls.cpython-36.pyc index 2656045d74f3620b7244d062fb575e33f9aa0bc2..b946603b66e69482a075fece6e96e66501e445e5 100644 GIT binary patch delta 37 scmaFB{(_y|n3tC;j8AkUdnPlZ+vGxKMJ~V8a)q?~oRrj}$y1np0Jz!;hX4Qo delta 29 lcmaFC{(zm`n3tDpf4Rs;_Dp6*yUB&jicFp%ljkt|004ez2qypl diff --git a/photoapp/__pycache__/views.cpython-36.pyc b/photoapp/__pycache__/views.cpython-36.pyc index fbf4db03050443fe7c3568f2b458ef8c11671d79..59c8719a981cc73ea2d5c4f2ced5013626a8c769 100644 GIT binary patch delta 426 zcmYk1&q~8U5XNUV$u>#TDzp`9rRqfx#eW6+02ahc5ef>TU~wyLto^fHw1*8n1o{H; zF}z4UdKEnBUBrj*37o`>hi{nuecueTUmK5`P9>9ZEBV6Z!;|yM@G$ydt8Tq@zjEF0 zik6)Hu*TdZ1ppT5fHeB1qQM7&H%z`M6f8spVFaicaU;ZlDbu%n9ztL!R4Gj?&M4GL zcD$gC8eC)plZfftu{W%pf@Z!Gf_$f)=KuVJ3|Cl12rL?~Vr#sXtSARubKlk$oiZhl z`{~#fJiucZPH82|7v*UXDPe2g!O&_8Y^U^n)$2gX7URt4|LE z0C1{3s@^+28YFnwX3?`kk0pqp7%?Nk7?mlx6bZykp(<#yxksJ<{aMZS;e0AK6lz0S znd|O0K%=x1h+Zg8Y8Ojc$23IKRa2)_UT diff --git a/photoapp/migrations/__pycache__/0002_auto_20191218_0717.cpython-36.pyc b/photoapp/migrations/__pycache__/0002_auto_20191218_0717.cpython-36.pyc index a9f3a7fd98788e071b275a016b487f116ce54ef3..bbd5d24d63ca5bbfa2d90333a175ee2d6fe4c8e2 100644 GIT binary patch delta 37 tcmX@Xa)E{2n3tC;j8AkUdmSTV%H%diMJ~V8a)q?~oRrj}$txM>0|2)@3i|*6 delta 29 lcmcb>a)O23n3tDpai+*d_Buw!n8|I7icFp%lQ%NX2LO2@2yp-a diff --git a/photoapp/migrations/__pycache__/0003_post_image.cpython-36.pyc b/photoapp/migrations/__pycache__/0003_post_image.cpython-36.pyc index 8bc409828a949fb2154392a7faf51a023760f0b7..b44601979938b78c05c9f4ac8c16777ae4e951cc 100644 GIT binary patch delta 37 tcmcb?@_>cin3tC;j8AkU`%Fg0n8^zn6}kLU%N5e{b5c@^CLdv(0sz0Z3t0dF delta 29 lcmaFBa)X84n3tDpai+*d_L+=~A(Iy}Dl&P7Og_Un1pt352+sfj diff --git a/photoapp/migrations/__pycache__/0004_auto_20191218_1037.cpython-36.pyc b/photoapp/migrations/__pycache__/0004_auto_20191218_1037.cpython-36.pyc index db5e7ae8a8a138152be4ada1c7cdbb94f90af55b..30b04fb505fbf22b77b8086cb8a3d5af793d758f 100644 GIT binary patch delta 37 tcmcb~@{onyn3tC;j8AkU`y@ujl*zLg6}kLU%N5e{b5c@^ChujO0|38r3swLC delta 29 lcmaFJa+8JKn3tDpai+*d_DPJ4F_UL8Dl&P7Og_pu2LOKu2+RNg diff --git a/photoapp/migrations/__pycache__/0005_auto_20191218_1052.cpython-36.pyc b/photoapp/migrations/__pycache__/0005_auto_20191218_1052.cpython-36.pyc index 7fb46919d1d6445a4bca2638a160fdcc3e8153db..454fa78b30e20dfb911230f22385defcda448749 100644 GIT binary patch delta 37 tcmcb?@_>cin3tC;j8AkU`$R^@l*uz06}kLU%N5e{b5c@^ChuXK0|37M3sC?7 delta 29 lcmaFBa)X84n3tDpai+*d_KA#)F_UL9Dl&P7Og_Rm2LOJv2*&^b diff --git a/photoapp/migrations/__pycache__/0006_auto_20191218_1106.cpython-36.pyc b/photoapp/migrations/__pycache__/0006_auto_20191218_1106.cpython-36.pyc index 365528c540d41eebdbb5b4503651f71707f5fc21..13ec160dc387ecade6bb6074d78e4a013c758899 100644 GIT binary patch delta 37 tcmcb~@{onyn3tC;j8AkU`y@ujl*zLg6}kLU%N5e{b5c@^ChujO0|38r3swLC delta 29 lcmaFJa+8JKn3tDpai+*d_DPJ4F_UL8Dl&P7Og_pu2LOKu2+RNg diff --git a/photoapp/migrations/__pycache__/0007_profile_followers.cpython-36.pyc b/photoapp/migrations/__pycache__/0007_profile_followers.cpython-36.pyc index 59aafa4eb922afadd88b1bdd6b525b8ec1e89ee1..3a594e4e481993f48283389cbb1a014f62529a6c 100644 GIT binary patch delta 37 scmaFF`ihm^n3tC;j8AkUI~x;Y@?<_HMJ~V8a)q?~oRrj}$%afD0jgRF-2eap delta 29 lcmaFG`iPa?n3tDpai+*db~Yx)=*fIcicFp%lP#Gx0swLc2U7q5 diff --git a/photoapp/migrations/__pycache__/0008_comment.cpython-36.pyc b/photoapp/migrations/__pycache__/0008_comment.cpython-36.pyc index e50443d8e547011b7a43e7f30f4a9bd6a122b975..836ab7164ffd3fc0043c006382ac826f10795031 100644 GIT binary patch delta 37 tcmZ3&xrUS7n3tC;j8AkUdmA%jJ6uJCT%N5e{b5c@^CSPH?2LQRN3zz@^ delta 29 lcmdnRzKNaPn3tDpai+*d_LWSGF_SkkDKdG6OuoZ(4*+@q2@U`N diff --git a/photoapp/migrations/__pycache__/0010_auto_20200117_1515.cpython-36.pyc b/photoapp/migrations/__pycache__/0010_auto_20200117_1515.cpython-36.pyc index c6cc32958de080274e05c36a0ef16f869b8dcc79..422a07e0ffb4302e5cf6b1d33ad80c672bb4bdd0 100644 GIT binary patch delta 38 tcmdnRafpN6n3tC;j8AkUJ0~+^%49)iMJ~V8a)q?~oRrj}%_huji~y;a2^IhV delta 30 lcmX@av5SMBn3tC;j8AkU`wnKtl*tE}6}kLU%N5e{b5c@^Ha}(-VFUo%zYDDZ delta 30 mcmey*`JI#9n3tDpai+*d_8rWOF_RB4D>8Y8Y<|rw!UzDA8VMr+ diff --git a/photoapp/migrations/__pycache__/0012_auto_20200122_1626.cpython-36.pyc b/photoapp/migrations/__pycache__/0012_auto_20200122_1626.cpython-36.pyc index da87dad9987d907e9d8857726e5117e89c564a53..62bec3d4643677b3f9c5b235dcf3dcae0dcd3f50 100644 GIT binary patch delta 65 zcmaFL`j(a5n3tC;j8AkU`!7bF6lbfL(Bjmh;u!Z(7njf&_h5hLc#rsiAb+nI&%EN2 U#2CNSa)q?~oRrj}$*N2T0GfXlcK`qY delta 57 zcmaFM`jnO3n3tDpai+*d_Fs%DG0s*op~b01#WC)oE-s-l?!o@f@gDI3LH=Gbo_WP3 Ni7}oblXaO6000%p672v0 diff --git a/photoapp/migrations/__pycache__/0013_auto_20200123_1409.cpython-36.pyc b/photoapp/migrations/__pycache__/0013_auto_20200123_1409.cpython-36.pyc index aa9b15d7f169ad26a021a7b2c6d7e9fd1b9a1197..beca3c4f33a7e696632835d5cfabc015df7421e7 100644 GIT binary patch delta 65 zcmaFL`j(a5n3tC;j8AkU`!7bF6lbfL(Bjmh;u!Z(7njf&_h5hLc#rsiAb+nI&%EN2 U#2CNSa)q?~oRrj}$*N2T0GfXlcK`qY delta 57 zcmaFM`jnO3n3tDpai+*d_Fs%DG0s*op~b01#WC)oE-s-l?!o@f@gDI3LH=Gbo_WP3 Ni7}oblXaO6000%p672v0 diff --git a/photoapp/migrations/__pycache__/0014_auto_20200125_0710.cpython-36.pyc b/photoapp/migrations/__pycache__/0014_auto_20200125_0710.cpython-36.pyc index 5317ca4fd283e40fe4bed5eae8b7c1478d2e1dcc..e20c35b6f9b2b8a6c9d1c86ee7534fe88dfc79e5 100644 GIT binary patch delta 65 zcmaFL`j(a5n3tC;j8AkU`!7bF6lbfL(Bjmh;u!Z(7njf&_h5hLc#rsiAb+nI&%EN2 U#2CNSa)q?~oRrj}$*N2T0GfXlcK`qY delta 57 zcmaFM`jnO3n3tDpai+*d_Fs%DG0s*op~b01#WC)oE-s-l?!o@f@gDI3LH=Gbo_WP3 Ni7}oblXaO6000%p672v0 diff --git a/photoapp/migrations/__pycache__/0015_auto_20200126_1011.cpython-36.pyc b/photoapp/migrations/__pycache__/0015_auto_20200126_1011.cpython-36.pyc index 6c3c2b33d6093b43b8075e40abc1f7894f7b2de4..78dcac2e7c5f5728301987abd9b0e2ae234bc93b 100644 GIT binary patch delta 65 zcmaFL`j(a5n3tC;j8AkU`!7bF6lbfL(Bjmh;u!Z(7njf&_h5hLc#rsiAb+nI&%EN2 U#2CNSa)q?~oRrj}$*N2T0GfXlcK`qY delta 57 zcmaFM`jnO3n3tDpai+*d_Fs%DG0s*op~b01#WC)oE-s-l?!o@f@gDI3LH=Gbo_WP3 Ni7}oblXaO6000%p672v0 diff --git a/photoapp/migrations/__pycache__/__init__.cpython-36.pyc b/photoapp/migrations/__pycache__/__init__.cpython-36.pyc index a8ba59d4b1c86a38bbc0c5d47a5452900838e349..6f2c20834385c411c6d57e0a2ce340f5a6307f10 100644 GIT binary patch delta 34 pcmZ3$xPp=0n3tC;j8AkTy9HzDLNO SUCH USER FOUND!

+ diff --git a/photoapp/views.py b/photoapp/views.py index 726fbb3..608ecec 100644 --- a/photoapp/views.py +++ b/photoapp/views.py @@ -197,6 +197,7 @@ def like_post(request,key): def searchuser(request): if request.method=='POST': print('2') + t=0 form=searchuform(request.POST) usn=User.objects.all() print(len(usn)) @@ -215,8 +216,12 @@ def searchuser(request): for k in usn: if k.username==f: print(k.last_name) + t=1 break - return render(request,'photoapp\show.html',{'k':k}) + if t: + return render(request,'photoapp\show.html',{'k':k}) + else: + return render(request,'photoapp\invalidsearch.html') # print('1') # j=form.save(commit=False) # usinst=User.objects.get(username=j.username) From e383e8f6c28ca9d904e9809c45254942090da335 Mon Sep 17 00:00:00 2001 From: Aurva Jyoti Paul Date: Sat, 30 Jan 2021 23:53:43 +0530 Subject: [PATCH 4/4] Corrected the functionality of like and comment button --- photoapp/__pycache__/models.cpython-36.pyc | Bin 2859 -> 2903 bytes photoapp/__pycache__/views.cpython-36.pyc | Bin 5676 -> 5776 bytes .../migrations/0021_auto_20210130_2344.py | 25 +++++++++ photoapp/models.py | 1 + photoapp/templates/photoapp/postlist.html | 4 +- photoapp/views.py | 51 +++++++++++++----- 6 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 photoapp/migrations/0021_auto_20210130_2344.py diff --git a/photoapp/__pycache__/models.cpython-36.pyc b/photoapp/__pycache__/models.cpython-36.pyc index 9cebf3c55ccf98382da155980b7b327e8c9bec48..e544851efe6a94649dbd7e71b6ef5eaeaa04fed4 100644 GIT binary patch delta 382 zcmXYsyGjE=6o&U~_A;~CU6R#AjfqHvzzXJK3<)7GU?YNs5Ri>wQmDbmY#LMBTIlJt z5jznJA3?CNvlQ|MK7`_#MFzg%pZU*x%ya%L&zqj-lpb>f@yeG?7+~4lEsj#BhOh+_ z{95k^!V&2!t-m1L11@=w&3xv6GL9a_gc4Fnuu0f6qPJ?2n+&JxRB9h3y16uI{3rZ zpp8Y|$Rrw7Oc z$Ot{Ww*>S(iEgE0n3n_#rP~8{6K- f!i2`$DLyVhPw>opE3;Vhn6p^IPI=4rl~nE@W;Z}( diff --git a/photoapp/__pycache__/views.cpython-36.pyc b/photoapp/__pycache__/views.cpython-36.pyc index 59c8719a981cc73ea2d5c4f2ced5013626a8c769..f71ad53f5fc4fcdec2a05d6c0472f06a3148ae3a 100644 GIT binary patch delta 1353 zcmZ8h&2Jk;6rVRcJG(pnOky)>*+V9VE|(_oG_ngLWsXg#{Q0vg{YZ z3}o$(!OGf6Ty!9}>dmO82X3{!*NO(R)o#|eYno%Op!5VyarZhk-O<<4E(crfX0yFt zZ@sUVCo>ONRrZCJvfzKrukObvrd6p|kgAd9T+y`B<+p3zP`hw6o zeCeY7O-;a({a4Lp_A$^A2n=iVnq5p>&D}=tz`gLWy;Cc=Mb6TM7ugWy$LN=@7t zE`t8RueNt~YOSaHzf zP2Yr~{V83LWh%I5|3P!Ko!QI+d}Xg^W?|Dl%>3#fZNk2uUC9?|`v1Ot*?yB5fha$}-HYmw;1yfaOH9Z~<2S=>M12iIr`r`&d zK>hKM_ngQ<1q#EBsEEkHtZR7aVAhRfC`gChDdVDgPxhpd4bQNKzs>dK(Cs;^Z1*y1 z*3pLz3gcgRMl^yx1J*)GHxyY>B9whV`FbU68f{xA5Jn9gz(oz{9w{L?QUXnj35mN$ ztsZtX?&D2zFAyvcyun^Vq%&9WVtMOhz6KEK4NQ~;_V%N)gJ`oSCJukbSZ65fGzgIR zi^YuMCQp#Cxi9nsoL8mqqlbiee6l}92RF?^KsGco2@#;r`^YQuC>k#E>KNXTeWttk z_Cn`0GTogt&b4>gX0GQNmpF^b6g?P`33@9E@Zh_lH16==$G+F+>#QXsz`x~j#18|* zM^}R?Y1&OprClALa`i2A?e6%?C8g&mGe!{4IYCyD;3~m9!C8W70+LQa4r#nkfmwvI zv)92ZVN2h#+1%8b-!U{|PvM22Kn1>|@Ip}hhkLmVm@ZM_8o@fjU4l&lQm1}kpXE!b Q8DIF)KkbkEr~K#s0~hWLt^fc4 delta 1369 zcmZux&2Jk;6rVTy;obFm9b-FDTN+41+AbnWKSWWHNC^$}BdRH+G{{hy$h!t_9Gkw~ zh)}JSgQeag0mB6$!G#+L3H4YcPDorpoRF}9D+f;e1@PV^rLDxS=C?EN{buI9dB52Y z=D&K%J6$Syr)%}MKA!rXKH97v+x|lQ3kz-vA2h@5xtDoUA8_qB+FzDD_9XsyD zz+9(2*xZc!Svt0Q-HkZHtIU0wU9va83p_e>4^+QsD=+Y1Th)VOa9uqYd=8h?@4;m_ zr;e9HdySc|tF>}i{BH}Kp);zg&&oc0sJ<-EKvVr#{?*yb5F6_2iIw`pdEqO(%#sQ! z$Idsn%gXrw_;Hn7O@BX$Ru zEc|f!3~E||d}^6UAdxvlunR+(86zgJuM%G4BiwPhLR$ED$({NHEE=0$ zhoy6a#%*9LJrCWeKgd8)iwHI({*XZ=M*t!+hLB0J8zaupOsvG_EHlUoIoX(#L9V&m zllhLZEN%otlT2pfu=D2fn#g71js*Thi<%EkAiEb?2gJ}KzQvyHqdBiIJ+yN>adL}7 zxlKMhDY7@Rhj3NgyiF?tew+Dp@e7f2@8a|LROF82s_5I9q$s7Pcu_Hz`~L>Nfzy=d z7)~J{LQ|f6M*UWuHpZ}_{;8hrl<)|d^%cPi_n3{3FlhZfPrb3xi~IN(+h!T&*yi@u z)2!8B-;DP}xc`%ZJ*hQ~t+cN%${0G>(qjLlR-FHyrluzd^j`){(j2SK0Z#@7*Nb|( vvHi|>wKWJY5*b$*t}t9@Xfm);b$K!3-XXootCJ^7Q;zA_&H<THE {% for i in posts %}
-

{{i.author}}




-
+Likes:{{i.nolike}} +{{i.Likes.count}}
add comment

{{i.caption}}


diff --git a/photoapp/views.py b/photoapp/views.py index 608ecec..9e284b6 100644 --- a/photoapp/views.py +++ b/photoapp/views.py @@ -89,7 +89,7 @@ def home(request): print(users) pk=request.user - + #m=[] following=[] posts=Post.objects.order_by("-date_posted") for i in users: @@ -103,8 +103,17 @@ def home(request): following.append(i.pk) #print(following) + for n in posts: + k=Likes.objects.filter(post=n) + tno=k.count() + n.nolike=tno + #print(n.nolike) + #print(n.id) + #m.insert(n.id,tno) + post_list=posts - #print(post_list) + #print(m) + print(post_list) return render(request,'photoapp/postlist.html',{'posts':post_list}) def confirm_delete(request,key): @@ -177,6 +186,7 @@ def create_comment(request,key): next = request.POST.get('next',None) #return HttpResponseRedirect(next) #return redirect('/home/key/') + return redirect('/home/%s' % key ) else: form=CreateCommentForm() @@ -186,36 +196,49 @@ def create_comment(request,key): return render(request,'photoapp/create_comment.html',{'form':form}) def like_post(request,key): posts=Post.objects.get(id=key) + t=1 liked=Likes() liked.post=posts - liked.users=request.user - liked.save() - return redirect('/home/%s' % key ) + liky=Likes.objects.filter(post=posts) + print('3') + for lik in liky: + if (lik.users==request.user): + t=0 + break + if t: + liked.users=request.user + liked.save() + else: + lik.delete() + + + + return redirect('/home') def searchuser(request): if request.method=='POST': - print('2') + #print('2') t=0 form=searchuform(request.POST) usn=User.objects.all() - print(len(usn)) + #print(len(usn)) #f=form.cleaned_data['username'] - print(form) - for i in usn: + #print(form) + #for i in usn: #if i.username==form.username: - print(i.username) + #print(i.username) if form.is_valid(): - print('17') - print(form) + #print('17') + #print(form) f=form.cleaned_data['username'] - print(f) + #print(f) for k in usn: if k.username==f: - print(k.last_name) + #print(k.last_name) t=1 break if t: