Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Add intervals parser #16

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Add intervals parser #16

wants to merge 21 commits into from

Conversation

hschne
Copy link
Member

@hschne hschne commented Jul 19, 2019

This PR adds capabilities for importing opening hours, displaying them in the details view of a location, and filtering locations by them.

Screenshot from 2019-07-19 11-59-27

Description

In order to import opening hours they have been added to the location csv. The README has been updated with the format used. interval_parser.py is responsible for converting the string data there to a database record, an Interval (couldn't find a better name 🤷‍♂️). The location model has been updated with a reference to the intervals used, and some migrations were obviously needed for that.

To display opening hours to the user opening_hour_service.py has been added, which is responsible for returning database records of opening hours to human readable strings. The view renders those in rows, see screenshot.

To filter by opening hours picker.js has been used. Not super happy with it, but what can you do. The filtering is then performed in the venue service.

There are also a bunch of smaller changes:

  • Added pytest to test opening hour parsing (you knew this was coming 😄 )
  • Alembic.ini has been updated to make the migrations easier to understand by adding a timestamp to front, so we always know which the most recent was.
  • Added CSS properties to custom.css for colors, just to try it out. What do you think? :)
  • Added some documentation and cleaned out some old data files.

What to do to try it?

flask db upgrade
flask data seed

TL;DR

  • Added import, display and filter for opening hours
  • Small changes for tests, css and migrations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant