From 48f8c319b7be23b584893cec1aa9bd05dbc828b5 Mon Sep 17 00:00:00 2001 From: shreyanshs7 Date: Sat, 26 Oct 2019 18:51:28 +0530 Subject: [PATCH] Removed unwanted ML files --- Helpers/share_price_change.py | 30 +++++++++---------- LoginRegister/views.py | 6 ++-- WallStreet18/settings.py | 41 ++++++++++++++++++-------- db.sqlite3 | Bin 184320 -> 184320 bytes templates/LoginRegister/login.html | 2 +- templates/LoginRegister/register.html | 4 +-- templates/SellBuy/dashboard.html | 2 +- templates/index.html | 2 +- 8 files changed, 53 insertions(+), 34 deletions(-) diff --git a/Helpers/share_price_change.py b/Helpers/share_price_change.py index b2033c9..8eb8008 100755 --- a/Helpers/share_price_change.py +++ b/Helpers/share_price_change.py @@ -6,32 +6,32 @@ django.setup() from SellBuy.models import Share, SharePrice -from WallStreetML.wallstreet import sharePrice +# from WallStreetML.wallstreet import sharePrice def share_price_update(): share_obj = Share.objects.all() for share in share_obj: - # # Changing each share price - # old_share_price = share.current_price - # new_share_price = (old_share_price) * (random.uniform(0.7, 1.3)) - # if new_share_price < 1000: - # new_share_price = (new_share_price)*(random.uniform(1.1, 1.3)) - # elif new_share_price > random.randint(50000,60000): - # new_share_price = (new_share_price)*(random.uniform(0.7, 0.9)) - # new_share_price = round(new_share_price, 2) - # new_share = SharePrice.objects.create(share=share, price=new_share_price) - # new_share.save() - # share.current_price = new_share_price - # share.previous_price = old_share_price - # share.save() + # Changing each share price old_share_price = share.current_price - new_share_price = sharePrice(share.name, old_share_price) + new_share_price = (old_share_price) * (random.uniform(0.7, 1.3)) + if new_share_price < 1000: + new_share_price = (new_share_price)*(random.uniform(1.1, 1.3)) + elif new_share_price > random.randint(50000,60000): + new_share_price = (new_share_price)*(random.uniform(0.7, 0.9)) new_share_price = round(new_share_price, 2) new_share = SharePrice.objects.create(share=share, price=new_share_price) new_share.save() share.current_price = new_share_price share.previous_price = old_share_price share.save() + # old_share_price = share.current_price + # new_share_price = sharePrice(share.name, old_share_price) + # new_share_price = round(new_share_price, 2) + # new_share = SharePrice.objects.create(share=share, price=new_share_price) + # new_share.save() + # share.current_price = new_share_price + # share.previous_price = old_share_price + # share.save() print("Share price changed") return True diff --git a/LoginRegister/views.py b/LoginRegister/views.py index c686ac9..cca5f0a 100755 --- a/LoginRegister/views.py +++ b/LoginRegister/views.py @@ -60,13 +60,15 @@ def register_post(request): current_user_holding.save() shares = Share.objects.all() + user_share_quantity_list = [] for share in shares: - user_share_quantity = UserShareQuantity.objects.create( + user_share_quantity = UserShareQuantity( share=share, user=user, quantity=0 ) - user_share_quantity.save() + user_share_quantity_list.append(user_share_quantity) + UserShareQuantity.objects.bulk_create(user_share_quantity_list) response = { 'success' : True, diff --git a/WallStreet18/settings.py b/WallStreet18/settings.py index c897e11..66bdb91 100755 --- a/WallStreet18/settings.py +++ b/WallStreet18/settings.py @@ -10,7 +10,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/ """ -import os +import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -78,17 +78,17 @@ # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -# 'default': { -# 'ENGINE': 'django.db.backends.mysql', -# 'NAME': 'newtest', -# 'USER': 'wallstreet', -# 'PASSWORD': 'wallstreet', -# 'HOST': 'localhost', -# } + # 'default': { + # 'ENGINE': 'django.db.backends.sqlite3', + # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + # } + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'wallstreet', + 'USER': 'wallstreet', + 'PASSWORD': 'wallstreet', + 'HOST': 'localhost', + } } @@ -110,6 +110,23 @@ }, ] +# LOGGING = { +# 'version': 1, +# 'handlers': { +# 'console': { +# 'level': 'DEBUG', +# 'class': 'logging.StreamHandler' +# }, +# }, +# 'loggers': { +# 'gunicorn.access' : { +# 'level': 'DEBUG', +# 'handlers': ['console'], +# 'propagate':False +# } +# } +# } + # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ diff --git a/db.sqlite3 b/db.sqlite3 index 76511df051d1af0aa12f1708837399eee444697b..86e5b7272e6c4b998b778de8a273cedb3425ab46 100755 GIT binary patch delta 3067 zcmb6b3v64}_1=5zIC0|CX_BU?lQiiHX`9%6&(D7f#Q8aP>gP6f)7Zd*Nu1b@ow%`+ zG#(>0Y(q?Fqr57fI@UHVv>mGui`#})eAFSWNI*8NTG?P|lubjxGz})Lpi0}$i(wr_ zW7>N<=bm@Z=iYPg`Mmu{OZOiweN0#3B!rwn5D~T_96it~;H07MStWi|z|)Ay!hvKH zeL7Febf9@6%W&r49HPf(r3nkdt zneGb5ZR$@jJ6s# zxC-I(XK_0ZHFiB`(+gZ9XK`?LhhQ@ZMiVF4q#ob%#}(SfIyEfI@{4dC{th3(pW!`t z7v6^7z-3rQ_kRj(L?>Mq`0{G<387b@hjr0<@`+S#`jfa3ywsYWzK*(KKfhk%RcPKimis1->Yj7TZ2d~4+@ID*?`Tie< zb!w=k)05FiD5WolCOQ*}$5ZLaa5&v6ozL}B#c|~i7=0P<_obrS_@Wx$W=XqdZT=63 z>ZwYN3n}5}S%UMS}~Jq*PuOA60gPk`z4RwxfrjVqKJsr4&V4^j;)lnbf)6{=e=t;&B~ zMGp{0-XM%aRCo!InjWoHAmhjA!BbM*nF|WGOpf5k52dNIhtW4`%=5(tI^W8a3?9m> zPTvo6HMmp@WpW5x9fHMRwpw_M>d>hgTp1a>#Ub!AgSYX5(b$3v+=$HJ9cHV8GZ}b0 zXEt(MkWp7KWpM3zr4KUS+PVkrVIK?d$%*VrOUA#0G$ z-CnIEy4#$el_8Gfgh8w}6N8w5Hr~iv205$ATFAzKmlr%b&LCiY;Vm6iO459rbNj?- zbi6M-8cn6clmCYiPHE!pMlOHt1C700376!={0saZehHUwdyB9Q%baSxf>4G*plLut z)z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ikRlQF@(Lp~EXuSu;@jLKi+AMb=R zY5C6N1w1(j&(mdmWe{Fv1E~r8Oc3H@^K3IWY_6}btY!~JGx*~mbg}*qjQng+)O&8Y zd9*WKC&2{4v$zcxz=R0&4umJ}#up?=P)D!}bKo-6(SC7J4^V&#arPO*8wM>&Nioh= zEnH{{tlzMaZ!e=OQ{=UJEwPx4Mn&Av7-+6tUlZVCWpt^nsV+fFT+=Gc-zr;EO=Inr zKvQ#I3tv!9OU*U$T9R)xW{UkOLRYypu&JrW))Y{lB;H$2m!&F)O?Nt~%w!br;yC^$ zf*wZQ^jJ@qjz?dnIYW6=t;uu>$=d>b0(Al#1da%_2`JC8#IxPBTD4lRYxsUQou_IS z>?@IrZt64jiPuc(dPG$b)e1U^eRP}}hBi{_h|u%U2a*0RTJc(+VVvp)K`KHZ*SWd~ z3MAoyu_K>!g0Yq7mx7tQiXo{_Dh9PyMRO2?Fb1o5LJ91Wu#R+zqV9`)S_*~0UnqjE zqid6gW`U&9Nwke%9egQz)g~HHPo --> - Login | WallStreet '18 + Login | WallStreet '19 diff --git a/templates/LoginRegister/register.html b/templates/LoginRegister/register.html index 3636d5d..6941621 100755 --- a/templates/LoginRegister/register.html +++ b/templates/LoginRegister/register.html @@ -7,7 +7,7 @@ - Register | WallStreet '18 + Register | WallStreet '19 @@ -73,7 +73,7 @@
Logo not available!
-
Wallstreet'18
+
Wallstreet'19

Register a new account

diff --git a/templates/SellBuy/dashboard.html b/templates/SellBuy/dashboard.html index 9af0de3..3108793 100755 --- a/templates/SellBuy/dashboard.html +++ b/templates/SellBuy/dashboard.html @@ -8,7 +8,7 @@ --> - Dashboard | WallStreet '18 + Dashboard | WallStreet '19 diff --git a/templates/index.html b/templates/index.html index 0871cb1..b62475d 100755 --- a/templates/index.html +++ b/templates/index.html @@ -8,7 +8,7 @@ --> - Wallstreet '18 + Wallstreet '19