Skip to content

Commit

Permalink
Merge pull request #306 from jwjacobson/dev
Browse files Browse the repository at this point in the history
Update set_rep_fields to allow setting of tags when taking a tune
  • Loading branch information
jwjacobson authored Sep 16, 2024
2 parents be96350 + 83f96a6 commit cffebcd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions docs/source/about/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ I index all composers by last name as a way of showing equal respect to jazz and

Key
-----
Key can be left blank, or you can fill it with 'none' or 'atonal'. There can only be one Key; in tonal tunes without an obvious "main" key I leave this blank and put all the keys in Other Keys. A '-' after the letter denotes minor; unadorned is major.
There can only be one Key; in tonal tunes without an obvious "main" key I leave this blank and put all the keys in Other Keys. A '-' after the letter denotes minor; unadorned is major. Key can be left blank, or you can fill it with 'none' or 'atonal'.

Other Keys
-----------
Expand All @@ -26,7 +26,7 @@ I've opted not to include primes etc. to make the form categories as broadly app

Style
------
'Standard' is for pop or Broadway tunes played by jazz musicians, while 'jazz' is for tunes written by jazz musicians. Other stylistic descriptors can be added as tags (eventually).
'Standard' is for pop or Broadway tunes played by jazz musicians, while 'jazz' is for tunes written by jazz musicians. Other stylistic descriptors can be added as tags.

Meter
------
Expand All @@ -36,6 +36,10 @@ Year
-----
For a lot of the jazz tunes the year is when the first album featuring the tune came out. Let me know if you have more accurate knowledge!

Tags
-----
These are extra descriptive qualifiers of a tune. None are assigned by default. Currently only tags I've defined are available; contact me if there's any you'd like to see!

Last Played
------------
The date you last played a tune. I try to keep as many out of the "haven't played in 3 months" category as I can.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/about/future.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ There are two major features still to be implemented:
Custom tags
------------

The user can add any tag to they want to any tune, e.g. "ballad".
Tags now exist, but the user can only choose among predefined tags. They should be able to create their own.

Tune analytics
---------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/using/adding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ To create a tune, click the **create** button on the navbar. The only required f

Taking tunes
-------------
The public repertoire contains 200 common tunes. Access it by clicking the **public** button on the navbar.
To add a tune, click the **take** button. the tune will immediately enter your repertoire, and you will have the option of setting when you last played the tune and your knowledge of it.
The public repertoire contains approximately 200 common tunes. Access it by clicking the **public** button on the navbar.
To add a tune, click the **take** button. the tune will immediately enter your repertoire, and you will have the option of setting when you last played the tune, your knowledge of it, and any tags.
2 changes: 1 addition & 1 deletion docs/source/using/searching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Jazz composer names have built-in substitutions using their nicknames or first n

Use a ``-`` before a term to exclude it from the search results.

You can also use the format ``field:term`` to search a specific field. Currently supported fields are **title**, **composer**, **key** (the key column, a tune's main key), **keys** (both the Key and Other Keys columns), **form**, **style**, **meter**, and **year**. It is most useful for key, keys, meter, and form.
You can also use the format ``field:term`` to search a specific field. Currently supported fields are **title**, **composer**, **key** (the key column, a tune's main key), **keys** (both the Key and Other Keys columns), **form**, **style**, **meter**, **year**, and **tags**. It is most useful for key, keys, meter, and form.

The **haven't played in** dropdown lets you filter by how long it's been since you've played a tune. This allows you to easily target tunes at the highest risk of being forgotten.
1 change: 1 addition & 0 deletions tune/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def set_rep_fields(request, pk):
if rep_form.is_valid():
rep_tune.knowledge = rep_form.cleaned_data["knowledge"]
rep_tune.last_played = rep_form.cleaned_data["last_played"]
rep_tune.tags.set(rep_form.cleaned_data["tags"])
rep_tune.save()
else:
print("invalid")
Expand Down

0 comments on commit cffebcd

Please sign in to comment.