Skip to content

Add elasticsearch#7

Open
TrKNguyen wants to merge 33 commits into
developfrom
Add_Elasticsearch
Open

Add elasticsearch#7
TrKNguyen wants to merge 33 commits into
developfrom
Add_Elasticsearch

Conversation

@TrKNguyen
Copy link
Copy Markdown
Collaborator

Add test

Copy link
Copy Markdown
Contributor

@william1nguyen william1nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review

Comment thread .idea/.gitignore
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't upload .idea folder

rating = get_rating(file_data)
max_rating, best_title = get_max_rating_title(file_data)
title = get_title(file_data)
''' if is_exist_profile(name) == False:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

name = get_file_name(file_path)
if is_exist_profile(name):
continue
print(name)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove test code

max_rating, best_title = get_max_rating_title(file_data)
title = get_title(file_data)
''' if is_exist_profile(name) == False:
new_profile = Profile(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove test code!

for file_path in all_files:
username = get_file_name(file_path)
user = get_user(username)
'''user = get_user(username)'''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

from online_site.views import ProfileList, getDetailProfile

class TestViews(TestCase):
def setUp(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setUp() run before every single function, so don't put every data into it!

Comment thread online_site/urls.py
path('detail_data', view=detail_data, name='detail_data'),
path("", views.ProfileList.as_view() , name="main_site"),
path('profiles/<str:name>', views.getDetailProfile, name="detail_profile"),
# path('<str:pk>', views.DetailProfile.as_view(), name="detail_site"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

Comment thread online_site/views.py
keyword = forms.CharField(max_length=100)


def my_func(**kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need my_func()

Comment thread online_site/views.py
print(f"{key}: {value}")


# class ProfileList(ListView):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

Comment thread online_site/views.py
return render(request, 'PrintProfileWithElasticsearch.html', context)


class ProfileList(ListView):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use Elasticsearch instead of SQLite -> use function based view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants