-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sort key to example queries (#108)
Each example query now has a sort key, which determines how the example queries are ordered in the `Examples` drop-down menu and for the `examples` command. The default sort key is `~`, which is larger than most characters. Ties are broken by the `id` of the example query, which increases over time (example queries added later get a larger `id). That way, without entering new sort keys, the order is the same as before. NOTE: The migration file `backend/migrations/0074_...` also contains migrations from earlier commits, which by mistake were not added to the repository. But better late than never.
- Loading branch information
1 parent
d39370c
commit 10b560c
Showing
6 changed files
with
73 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
backend/migrations/0074_example_sortkey_alter_backend_defaultmodetimeout_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Generated by Django 5.0.3 on 2024-10-05 12:26 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('backend', '0073_backend_mapviewbaseurl'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='example', | ||
name='sortKey', | ||
field=models.CharField(blank=True, default='', help_text='Sort key, according to which examples are ordered lexicographically for a backend', max_length=100, verbose_name='Sort key'), | ||
), | ||
migrations.AlterField( | ||
model_name='backend', | ||
name='defaultModeTimeout', | ||
field=models.FloatField(default=0, help_text='Default timeout in seconds for autocompletion queries', verbose_name='Autocomplete timeout'), | ||
), | ||
migrations.AlterField( | ||
model_name='backend', | ||
name='dynamicSuggestions', | ||
field=models.IntegerField(choices=[(3, '4. Mixed mode'), (2, '3. SPARQL & context sensitive entities'), (1, '2. SPARQL & context insensitive entities'), (0, '1. SPARQL syntax & keywords only')], default=2, help_text='Default for how to compute autocompletion queries if any', verbose_name='Default autocompletion mode'), | ||
), | ||
migrations.AlterField( | ||
model_name='backend', | ||
name='isDefault', | ||
field=models.BooleanField(default=0, help_text='Check if this should be the default backend for the QLever UI', verbose_name='Use as default'), | ||
), | ||
migrations.AlterField( | ||
model_name='backend', | ||
name='isNoSlugMode', | ||
field=models.BooleanField(default=0, help_text='Check if this default backend should also be available without a slug in the QLever UI', verbose_name='Enable no-slug mode'), | ||
), | ||
migrations.AlterField( | ||
model_name='backend', | ||
name='mixedModeTimeout', | ||
field=models.FloatField(default=1, help_text='Timeout in seconds for the sensitive autocompletion query in mixed mode', verbose_name='Mixed mode timeout'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.0.3 on 2024-10-05 13:59 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('backend', '0074_example_sortkey_alter_backend_defaultmodetimeout_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='example', | ||
name='sortKey', | ||
field=models.CharField(default='~', help_text="Sort key, according to which example queries are ordered lexicographically; default is '~', which is larger than most characters", max_length=100, verbose_name='Sort key'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.