mirror of
https://github.com/sissbruecker/linkding
synced 2024-11-25 21:00:18 +00:00
0975914a86
* Rename BookmarkFilters to BookmarkSearch * Refactor queries to accept BookmarkSearch * Sort query by data added and title * Ensure pagination respects search parameters * Ensure tag cloud respects search parameters * Ensure user select respects search parameters * Ensure return url respects search options * Fix passing search options to user select * Fix BookmarkSearch initialization * Extract common search form logic * Ensure partial update respects search options * Add sort UI * Use custom ICU collation when sorting with SQLite * Support sort in API
27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
from django.conf import settings
|
|
from django.contrib.auth import user_logged_in
|
|
from django.db.backends.signals import connection_created
|
|
from django.dispatch import receiver
|
|
|
|
from bookmarks.services import tasks
|
|
|
|
|
|
@receiver(user_logged_in)
|
|
def user_logged_in(sender, request, user, **kwargs):
|
|
tasks.schedule_bookmarks_without_snapshots(user)
|
|
|
|
|
|
@receiver(connection_created)
|
|
def extend_sqlite(connection=None, **kwargs):
|
|
# Load ICU extension into Sqlite connection to support case-insensitive
|
|
# comparisons with unicode characters
|
|
if connection.vendor == 'sqlite' and settings.USE_SQLITE_ICU_EXTENSION:
|
|
connection.connection.enable_load_extension(True)
|
|
connection.connection.load_extension(settings.SQLITE_ICU_EXTENSION_PATH.rstrip('.so'))
|
|
|
|
with connection.cursor() as cursor:
|
|
# Load an ICU collation for case-insensitive ordering.
|
|
# The first param can be a specific locale, it seems that not
|
|
# providing one will use a default collation from the ICU project
|
|
# that works reasonably for multiple languages
|
|
cursor.execute("SELECT icu_load_collation('', 'ICU');")
|