Skip to content

Commit 34afd3a

Browse files
authored
Merge pull request #393 from rebmizrahi/develop
Update dependencies, debug field errors, docs update
2 parents b3b7fba + 963bb35 commit 34afd3a

15 files changed

Lines changed: 53 additions & 42 deletions

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Since this repository has submodule, when you clone it, please use `git clone --
77
* Make sure you have ``homebrew`` and python 3.6 or above installed
88
* Install PostgreSQL with ``brew install postgresql``
99
* Start the PostgreSQL server with ``brew services start postgresql``
10-
* Set up environment variables with: ``cat env.txt >> ~/.bash_profile`` and ``source ~/.bash_profile`` (NOTE: If you use PyCharm or other IDE, please restart the IDE for the environmental settings to work!)
1110
* Start a virtual environment with ``python3 -m venv venv``
1211
* Start virtual environment ``source venv/bin/activate``
13-
* Install python packages ``pip install -r requirements.txt``
12+
* Set up environment variables with: ``cat env.txt >> ~/.bash_profile`` and ``source ~/.bash_profile`` (NOTE: If you use PyCharm or other IDE, please restart the IDE for the environmental settings to work!)
13+
* Install python packages ``pip3 install -r requirements.txt``
1414
* Setup database:
1515

1616
```bash
@@ -20,10 +20,18 @@ Since this repository has submodule, when you clone it, please use `git clone --
2020
> psql -d ${POSTGRES_DB} -c "ALTER DATABASE $POSTGRES_DB OWNER TO $POSTGRES_USER;"
2121
> psql ${POSTGRES_DB} -c "ALTER USER $POSTGRES_USER WITH PASSWORD '$POSTGRES_PASSWORD';"
2222
```
23-
2423
* Make migrations: ``python manage.py makemigrations``
2524
* Migrate: ``python manage.py migrate``
2625
* Start a server to see if it worked: ``python manage.py runserver``
2726
* Go to ``http://127.0.0.1:8000`` on your web browser
2827

29-
[Developer documentation](https://elvis-project.github.io/simssadb/html/index.html)
28+
### To set up for development after having completed the above steps:
29+
* Start virtual environment ``source venv/bin/activate``
30+
* Link environment variables ``source ~/.bash_profile``
31+
* Start the server ``python manage.py runserver``
32+
* Go to ``http://127.0.0.1:8000`` on your web browser
33+
34+
**See the Wiki for more information, including**
35+
- [User manual](https://github.com/rebmizrahi/simssadb/wiki/User-Manual)
36+
- [Setting up the database](https://github.com/rebmizrahi/simssadb/wiki/How-to-Populate-the-Database)
37+
- And developer documentation

database/models/contribution_musical_work.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ContributionMusicalWork(CustomBaseModel):
7777
"Arranger, Author of Text, Transcriber, "
7878
"Improviser, Performer",
7979
)
80-
certainty_of_attribution = models.NullBooleanField(
80+
certainty_of_attribution = models.BooleanField(
8181
help_text="Whether it is certain if this Person made this contribution",
8282
null=True,
8383
blank=True,

database/models/feature_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class FeatureType(CustomBaseModel):
5151
description = models.TextField(
5252
blank=True, help_text="A description of the FeatureType"
5353
)
54-
is_sequential = models.NullBooleanField(
54+
is_sequential = models.BooleanField(
5555
blank=True,
5656
null=True,
5757
help_text="whether a feature can "

database/models/file.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
"""Defines a File model"""
22
from typing import List
33
import os
4-
from django.contrib.postgres.fields import JSONField
54
from django.db import models
6-
from django.db.models import QuerySet
5+
from django.db.models import QuerySet, JSONField
76
from database.models.custom_base_model import CustomBaseModel
87

98

database/models/musical_work.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class MusicalWork(FileAndSourceMixin, CustomBaseModel):
9494
related_name="musical_works",
9595
help_text="e.g., sonata, motet, 12-bar blues",
9696
)
97-
sacred_or_secular = models.NullBooleanField(
97+
sacred_or_secular = models.BooleanField(
9898
null=True, blank=True, default=None, help_text="Leave blank if not applicable."
9999
)
100100
contributors = models.ManyToManyField(

database/signals.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def run_jsymbolic(instance, **kwargs):
7070
feature_path.replace(".xml.", ".csv.") + ".csv",
7171
feature_path.replace(".xml.", ".arff.") + ".arff",
7272
] # jsymbolic rename the xml.midi file
73-
# in a weired way
73+
# in a weird way
7474
print(path)
7575
print(os.path.exists(path))
7676
# instance_json = serializers.serialize('json', [instance, ])
@@ -116,7 +116,7 @@ def async_task(
116116
for item in feature_path_file: # save all the feature files in the DB
117117
filename, ext = os.path.splitext(item)
118118
FeatureFile.objects.get_or_create(
119-
file_type=ext,
119+
file_format=ext,
120120
file=item,
121121
features_from_file=instance,
122122
config_file=feature_config_file,
@@ -125,6 +125,7 @@ def async_task(
125125
)
126126

127127

128+
# Potential problem: instance_pk? index_components not defined? looks like it was taken from # https://simonwillison.net/2017/Oct/5/django-postgresql-faceted-search/
128129
@receiver(post_save, sender=MusicalWork)
129130
def on_save(instance, **kwargs):
130131
index_components = instance.index_components()

database/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from django.conf.urls import include, url
21
from django.urls import path
32
from django.contrib.auth import views as auth_views
43
from database.views import *

database/views/encoding_workflow.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ class EncodingWorkflowDetailView(DetailView):
77
model = EncodingWorkFlow
88
template_name = "detail.html"
99

10-
1110
class EncodingWorkflowListView(SearchableListMixin, ListView):
1211
model = EncodingWorkFlow
13-
search_fields = ["name"]
14-
queryset = EncodingWorkFlow.objects.order_by("name")
12+
search_fields = ["encoder_names"]
13+
queryset = EncodingWorkFlow.objects.order_by("encoder_names")
1514
paginate_by = 100
1615
template_name = "list.html"

database/views/front_end_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from django.http import HttpResponse
33
from django.shortcuts import render, redirect
44
from django.contrib.sites.shortcuts import get_current_site
5-
from django.utils.encoding import force_bytes, force_text
5+
from django.utils.encoding import force_bytes, force_str
66
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
77
from django.template.loader import render_to_string
88
# from database.tokens import account_activation_token

database/views/validation_worflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ValidationWorkFlowDetailView(DetailView):
1010

1111
class ValidationWorkFlowListView(SearchableListMixin, ListView):
1212
model = ValidationWorkFlow
13-
search_fields = ["name"]
14-
queryset = ValidationWorkFlow.objects.order_by("name")
13+
search_fields = ["validator_names"]
14+
queryset = ValidationWorkFlow.objects.order_by("validator_names")
1515
paginate_by = 100
1616
template_name = "list.html"

0 commit comments

Comments
 (0)