OpenTechStrategies / torque

A flexible web-based open source system for collaboratively evaluating proposals.
1 stars 2 forks source link

Use postgres for backend #44

Closed YaxelPerez closed 3 years ago

YaxelPerez commented 3 years ago

(in progress)

This PR replaces filesystem persistence with a Postgres backend using the Django ORM. More discussion in issue #26.

YaxelPerez commented 3 years ago

Where to go from here?

As it stands, this PR is not ready to merge. Here is what needs to be done:

Actually make torquedata use Postgres

Currently torquedata is using an Sqlite3 database for development purposes. Changing the database engine to postgres should be trivial (documented here).

(settings.py can be moved to settings.py.tmpl, keeping in line with how our ansible setup currently handles torquedata configuration)

Configure file handling

MEDIA_ROOT is not currently configured in settings.py (see documentation on managing files).

Issue #20 mentions using Backblaze to store attachments. pyutil/django-b2 would probably work well for this purpose. It seems relatively well-maintained but documentation is sparse. It exposes a custom storage backend called B2Storage which can replace Django's default FileSystemStorage (see documentation on the FileField storage parameter).

Add Edit model

Discussed in DESIGN.md

As per issue #32, users can edit data fields (e.g., to fix a typo in a city's name in the "City" field) if they have proper permissions.

Add PostgreSQL Text Search

Discussed in issue #45. Currently spreadsheet/proposal data is stored in a JSONField (see documentation on querying JSONField) which might not be amenable to this solution.

More django-admin commands

Currently the only way to configure a template is by making a call to the torquedata API. It might be convenient to expand on the library of convenience functions provided by ./manage.py.

Nolski commented 3 years ago

Feature Parity Check List

As far as I can tell, the only things left to have feature parity with main are the following: