This commit is contained in:
Paul Konstantin Gerke 2022-03-05 13:09:08 +01:00
parent 0335b8ca89
commit 7af66176aa
2 changed files with 26 additions and 7 deletions

View File

@ -6,13 +6,32 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('babybuddy', '0020_update_language_en_to_en_us'),
("babybuddy", "0020_update_language_en_to_en_us"),
]
operations = [
migrations.AlterField(
model_name='settings',
name='language',
field=models.CharField(choices=[('zh-hans', 'Chinese (simplified)'), ('nl', 'Dutch'), ('en-US', 'English (US)'), ('en-GB', 'English (UK)'), ('fr', 'French'), ('fi', 'Finnish'), ('de', 'German'), ('it', 'Italian'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('es', 'Spanish'), ('sv', 'Swedish'), ('tr', 'Turkish')], default='en-US', max_length=255, verbose_name='Language'),
model_name="settings",
name="language",
field=models.CharField(
choices=[
("zh-hans", "Chinese (simplified)"),
("nl", "Dutch"),
("en-US", "English (US)"),
("en-GB", "English (UK)"),
("fr", "French"),
("fi", "Finnish"),
("de", "German"),
("it", "Italian"),
("pl", "Polish"),
("pt", "Portuguese"),
("es", "Spanish"),
("sv", "Swedish"),
("tr", "Turkish"),
],
default="en-US",
max_length=255,
verbose_name="Language",
),
),
]

View File

@ -42,7 +42,7 @@ class TagsEditor(Widget):
def build_attrs(self, base_attrs, extra_attrs=None):
"""
Bootstrap integration adds form-control to the classes of the widget.
Bootstrap integration adds form-control to the classes of the widget.
This works only for "plain" input-based widgets however. In addition,
we need to add a custom class "babybuddy-tags-editor" for the javascript
file to detect the widget and take control of its contents.
@ -56,9 +56,9 @@ class TagsEditor(Widget):
def get_context(self, name: str, value: Any, attrs) -> Dict[str, Any]:
"""
Adds extra information to the payload provided to the widget's template.
Specifically:
- Query a list if "recently used" tags (max 256 to not cause
- Query a list if "recently used" tags (max 256 to not cause
DoS issues) from the database to be used for auto-completion. ("most")
- Query a smaller list of 5 tags to be made available from a quick
selection widget ("quick").