-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue/28 - Text search for events #108
Conversation
start_time=start_time, | ||
end_time=end_time, | ||
) | ||
class HomepageView(View): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this view a little bit so that it is more consistent to the way the other views are coded.
b1f0a06
to
2ac6bdb
Compare
query = query & Q(start_datetime__range=(current_timezone.localize(start_date), | ||
current_timezone.localize(end_date))) | ||
if search: | ||
query = query & (Q(title__icontains=search) | Q(description__icontains=search)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the docs, it seems that we need to be using PostgreSQL DB before being able to use Django's full text search (https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/search/)
So I thought I'll update this later when we migrate to Postgres. Currently, the search only matches title and description, but we would have to add more fields like location soon (#103)
</div> | ||
<div class="grid-col-4"> | ||
|
||
<div class="grid-col-4 desktop:display-block mobile: display-none"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the calendar causes issues on mobile screens, I have disabled the datepicker for mobile for now. Should we have a different style of datepicker for mobile ui? Or maybe a button to toggle the calendar view on/off?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just use a regular date select for mobile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In trying this out, after searching, then moving to next month and then back to the same month the search term seems to still be in force. This is not intuitive.
@@ -114,7 +114,7 @@ | |||
"pk": 6, | |||
"fields": { | |||
"title": "Approved CodeForSanJose Hack Night", | |||
"description": "This is an event that is pending", | |||
"description": "This is an event that is approved", | |||
"recurrences": "RRULE:FREQ=WEEKLY;BYDAY=TU", | |||
"start_datetime": "2019-10-12T18:30:00-0700", | |||
"end_datetime": "2019-10-12T21:00:00-0700", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do these changes have to do with Text Search?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They dont; I was just correcting the description to keep it consistent with the title of the event.
I agree, I wasn't convinced of this either. But I had a look at meetup.com and it does something similar this. Would it be more intuitive if we persisted the search term in the search bar as we scrolled between months? |
8c1ef94
to
d7094d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge
937ad0d
to
bb939ff
Compare
Added search capability to the webpage