Conversation
|
|
||
| from mi_data_structure import * | ||
| from loop.models import * | ||
| import pandas as pd |
There was a problem hiding this comment.
Please organise the imports appropriately
| gaddidar_data_obj = Gaddidar.objects.filter(mandi__id__in=mandi_list) | ||
|
|
||
| # Read CSV file and filter for requested Aggreagator | ||
| filepath = os.path.join(fileDir, "/home/trionfo/Documents/dg/loop/utils/Transport Cost & Capacity Data - Sheet1.csv") |
There was a problem hiding this comment.
remove hard coded file path & print statement
| def query_for_rates(crop_list, mandi_list, date_range=3): | ||
| # today_date = datetime(2018, 03, 21) | ||
| today_date = datetime.now() | ||
| today_date = datetime(2018, 05, 22) |
| url(r'^get_partners_list/', get_partners_list), | ||
| url(r'^admin/logout/?$', 'django.contrib.auth.views.logout', {'next_page': '/loop/admin/'}), | ||
| url(r'^admin/', include(loop_admin.urls)), | ||
| url(r'^get_agg_mi_data', get_aggregator_mi_related_data), |
There was a problem hiding this comment.
append slash after the urls
| return agg_list_requested | ||
|
|
||
|
|
||
| # def getJSONObj(**kwargs): |
There was a problem hiding this comment.
remove commented code
|
|
||
|
|
||
| def is_authenticated(request): | ||
|
|
There was a problem hiding this comment.
add function doc string to explain the working of function
| cropobj = Crop.objects.values_list('id', flat=True) | ||
| cropobj = map(int, cropobj) | ||
| # Prepare data | ||
| crop_list = tuple(cropobj) |
There was a problem hiding this comment.
if only 1 crop is requested, will this tuple method work?
| latest_price_date = pd.Timestamp('2015-01-01') | ||
| cropmandidata = CropMandiData(crop_id=i[0], mandi_id= i[1]) | ||
| for index, row in r.iterrows(): | ||
| crop, mandi, date, Av_Rate, STD, PriceMax, PriceMin = row['Crop'], row['Market_Real'], row['Date'], row['Av_Ratemean'], row['STDmean'], row['Pricemax'], row['Pricemin'] |
There was a problem hiding this comment.
Are we sure that avg_price and std are always returned from the function?
There was a problem hiding this comment.
You doubt that? :<, BTW yes.
| mandi_res = [] | ||
| for mandiobj in mandi_data_obj: | ||
| mandiobjdetail = MandiDetail(mandi_id=mandiobj['id'], mandi_name=mandiobj[mandi_name_label], mandi_category='Chhoti Mandi',\ | ||
| mandi_distance='590') |
There was a problem hiding this comment.
why are category and distance hardcoded?
There was a problem hiding this comment.
For Initially, testing.
| self.cost = kwargs['transport_cost'] | ||
| self.capacity = kwargs['transport_capacity'] | ||
|
|
||
| def getTransportDetail(self): |
Market Information in Loop App.
Release Steps :
Test
Prod