Skip to content
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5f6d095
plan: merge plan for PR #1332 (dal_alight backend)
archTortugax Apr 27, 2026
1a43be9
plan: detailed merge plan for PR #1332 (dal_alight port)
archTortugax Apr 27, 2026
c4ad537
feat: add dal_alight backend based on autocomplete-light web componen…
archTortugax Apr 27, 2026
7b923b1
chore: remove internal merge plan for PR #1332
archTortugax Apr 27, 2026
51d9fd5
fix: escape HTML output in AlightQuerySetView and AlightWidgetMixin
archTortugax Apr 27, 2026
574ff92
fix: pass ruff checkqa for dal_alight
archTortugax Apr 28, 2026
0d24597
chore: update autocomplete-light submodule and add dal_alight TODO
archTortugax Apr 29, 2026
44902e8
chore: update autocomplete-light submodule to 1488e8a
archTortugax Apr 29, 2026
377f4bd
refactor: rename legacy select2 test apps to select2_ prefix
archTortugax May 4, 2026
dc3a487
refactor: share select2 DB tables with alight mirror apps
archTortugax May 4, 2026
7d63663
feat: align alight_many_to_many, alight_list, alight_linked_data with…
archTortugax May 4, 2026
69dd460
fix: sync Django admin popup creates into alight component deck
archTortugax May 4, 2026
218c73a
fix: fuse alight_list with select2_list_tmodel and dynamic choice list
archTortugax May 5, 2026
bd45162
chore: mark alight_forward_different_fields as tested
archTortugax May 6, 2026
f611d4f
feat: dal_alight full parity — queryset_sequence, GFK, tag, nested admin
archTortugax May 6, 2026
407b3e6
fix: secure_data anon guard and owner auto-assign; mark all alight te…
archTortugax May 6, 2026
cba7be4
refactor: move dal-django.js out of submodule into main repo
archTortugax May 6, 2026
9733712
chore(dal_alight): cleanup pass — drop dev artifacts, fix ruff, expan…
archTortugax May 7, 2026
0f2bda4
test(dal_alight): add unit tests for grouped views, TaggitAlight, and…
archTortugax May 7, 2026
f8b92f5
fix(tests): resolve two CI collection errors
archTortugax May 11, 2026
3535b8a
fix(tests): fix 3 unit-test errors and inline input-selector scoping
archTortugax May 11, 2026
f6cbeb5
fix(stories): prevent double-scoping input_selector in InlineSelectOp…
archTortugax May 11, 2026
16793f9
fix(dal_alight): resolve 21 functional test failures across 8 groups
archTortugax May 11, 2026
ed26d97
fix(tests): resolve remaining 12 CI failures in dal_alight functional…
archTortugax May 11, 2026
222593b
fix(stories): prevent infinite loop in get_suggestions when results a…
archTortugax May 11, 2026
d9dcdd2
fix(dal_alight): fix refresh_autocomplete and create_option for aligh…
archTortugax May 11, 2026
ec4b3b5
fix(tests): fix all 7 CI failures — alight timing, forward CSS quotin…
archTortugax May 12, 2026
5ff1147
chore: fix all ruff lint issues — unused imports, import order, line …
archTortugax May 12, 2026
eb0c4d3
fix(dal_alight): apply all TODO fixes and add missing test coverage
archTortugax May 12, 2026
a61d52b
chore: fix ruff E501 line too long in test_units.py
archTortugax May 12, 2026
297c2a5
docs: add dal_alight tutorial and select2/alight comparison
archTortugax May 13, 2026
aad99ba
docs: add dal_alight autodoc entries to api.rst to fix CI doc build
archTortugax May 18, 2026
3f37f36
feat(dal_alight): add dark mode via CSS custom properties and JS toggle
archTortugax May 18, 2026
1124cac
chore: revert submodule dark mode — keep CSS changes in main repo only
archTortugax May 18, 2026
3265172
chore: restore submodule to upstream HEAD
archTortugax May 18, 2026
5312239
chore: untrack db.sqlite3 and add sqlite to .gitignore
archTortugax May 18, 2026
6791640
chore: add TODO and DONE tracking files
archTortugax May 18, 2026
673c363
feat(admin): add global search bar to admin topbar
archTortugax May 18, 2026
3d22ad9
fix(alight): prevent tag loss on list refresh
archTortugax May 18, 2026
af7a31c
chore: mark tag loss fix as done in DONE.md
archTortugax May 18, 2026
5fa392f
feat(taggit): add AlightTagAutocompleteView, edge-case tests, and ali…
archTortugax May 18, 2026
22d7cec
feat(alight): complete alight_outside_admin app with M2M showcase and…
archTortugax May 18, 2026
c3ba075
chore(static): consolidate test JS files and stop tracking collectsta…
archTortugax May 18, 2026
95274c9
chore: update CHANGELOG and drop TODO/DONE tracking files
archTortugax May 18, 2026
a6734d4
chore: fix all ruff lint errors in test_project
archTortugax May 18, 2026
8f09711
fix(tests): fix 4 alight CI failures — outside-admin selector and inl…
archTortugax May 18, 2026
2393f7f
fix(tests): wait for autocomplete-select[data-bound] before interacting
archTortugax May 18, 2026
343aa75
fix(alight): fix extra-inline selection — cloneNode inherits data-bound
archTortugax May 18, 2026
767b31d
Merge pull request #3 from PurpleToti/alight-cleanup
PurpleToti May 18, 2026
ea855ee
fix(alight): fix dark mode when switching to light in admin
archTortugax May 19, 2026
7eb35e0
feat(taggit): add Create "X" option to select2 and alight taggit widgets
archTortugax May 19, 2026
4c57c1a
refactor(alight): address maintainer review comments
archTortugax May 19, 2026
48886ac
fix(checkqa): wrap long lines in widgets.py to satisfy ruff E501
archTortugax May 19, 2026
a016c35
fix(docs): fix all Sphinx warnings for tox -e docs
archTortugax May 19, 2026
9cb0d14
fix(alight): fix choiceSelect for dynamically-created options
archTortugax May 19, 2026
843de13
fix(alight): override post() in AlightQuerySetView to return HTML
archTortugax May 19, 2026
42a7c32
fix(test): update test_post_creates_object to expect HTML not JSON
archTortugax May 19, 2026
f88fa87
refactor: consolidate generic autocomplete code into dal core
archTortugax May 20, 2026
f364296
docs: make dal_alight the primary frontend throughout
archTortugax May 20, 2026
a67aca7
docs: put dal_alight first everywhere
archTortugax May 20, 2026
b4121b4
docs: fix version to 4.0.0 and drop hardcoded v3 mention
archTortugax May 20, 2026
2284150
fix(ci): resolve ruff and docs warnings
archTortugax May 20, 2026
195e2d5
refactor: address jpic review — widgets, views, JS, CSS cleanup
archTortugax May 21, 2026
012e2e1
fix(lint): remove unused imports from dal/views.py
archTortugax May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ node_modules
# Claude Code
.claude/
.python-version

# SQLite databases
*.sqlite3
*.sqlite
*.db

# collectstatic output
test_project/public/
80 changes: 80 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
4.1.0

New
- #1332 dal_alight: new autocomplete backend based on the
autocomplete-light web component, with no Select2 / no
jQuery dependency. Opt-in via
INSTALLED_APPS = [..., 'dal_alight'].

Views (dal_alight.views):
- AlightQuerySetView -- HTML-fragment QuerySet view
- AlightGroupQuerySetView -- grouped (group_by_related)
- AlightListView -- list-of-strings/tuples view
- AlightGroupListView -- grouped variant

Widgets (dal_alight.widgets):
- ModelAlight, ModelAlightMultiple (QuerySet-backed)
- Alight, AlightMultiple (arbitrary choices)
- ListAlight (paired with AlightListView)
- TagAlight (free-text comma tags)
- TaggitAlight (django-taggit bridge)

Fields (dal_alight.fields):
- AlightListChoiceField, AlightListCreateChoiceField

Test helper (dal_alight.test):
- AlightStory -- Selenium selectors + custom-element wait,
drop-in replacement for Select2Story.

Static (dal_alight/static/dal_alight/):
- autocomplete-light.js / .css -- vendored from the
autocomplete-light web component submodule.
- dal-django.js -- Django adapter: reads dal-forward-conf
divs, appends &forward= to autocomplete URLs, handles
autocompleteCreate POST + CSRF, syncs Django admin
add/change-related popups into the component deck.

- #1332 dal_alight_queryset_sequence: companion package combining
dal_queryset_sequence with the autocomplete-light backend.
Active when both 'dal_alight' and 'dal_queryset_sequence'
are in INSTALLED_APPS.

- AlightQuerySetSequenceView, AlightQuerySetSequenceAutoView
- QuerySetSequenceAlight, QuerySetSequenceAlightMultiple
- AlightGenericForeignKeyModelField

- #1332 test_project: 14 alight_* apps mirroring their select2_*
counterparts, covering FK, M2M, OneToOne, GenericFK, list,
tag, taggit, linked_data, forward_different_fields,
rename_forward, secure_data, outside_admin, nestedadmin,
and djhacker_formfield.

Fixes
- dal_alight: fix tag loss on list refresh — selected tags no longer
reappear in the dropdown after a query; deck state is reconciled
after every receive() and on component reconnect (form re-render).
(AutocompleteSelectInput.receive filter + AutocompleteSelect.reconcileState)

Improvements
- dal_alight: dark mode support via CSS custom properties.
All hardcoded colours replaced with --autocomplete-light-* variables;
@media (prefers-color-scheme: dark) override included.
Optional JS toggle: AutocompleteLightDarkMode.toggle() with
localStorage persistence and system-preference listener.

- dal_alight: AlightTagAutocompleteView convenience base class added
to dal_alight.views (overrides get_result_value to return tag.name);
exported from dal.autocomplete. taggit.rst docs updated with alight
view/form examples.

- test_project: alight_outside_admin app completed — M2M showcase with
Selenium tests (page load, option selection, form submission).

Cleanup
- Removed internal planning notes (src/dal_alight/PLAN.md, TODO.md,
GAPS.md, test_project/TO_TEST.md) used during development.
- test_project: shared JS helpers (js_handlers.js, linked_data.js,
t_select2.js) consolidated into test_project/static/js/ via
STATICFILES_DIRS; collectstatic output (test_project/public/) removed
from version control.

4.0.1

Fixes
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Features
- Django (multiple) choice support,
- Django (multiple) model choice support,
- Django generic foreign key support (through django-querysetsequence),
- Multiple widget support: select2.js, easy to add more.
- Multiple widget support: native web component (``dal_alight``), select2.js (``dal_select2``).
- Creating choices that don't exist in the autocomplete,
- Offering choices that depend on other fields in the form, in an elegant and
innovative way,
Expand Down
6 changes: 2 additions & 4 deletions changelog.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from datetime import datetime
from github import Github
from pprint import pprint
import os
import re
import requests
import subprocess
import sys

from github import Github

g = Github(os.getenv('GITHUB_TOKEN'))
repo = g.get_repo('yourlabs/django-autocomplete-light')
tag = sys.argv[1]
Expand Down
3 changes: 2 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import os

import pytest


@pytest.fixture(scope='session')
def splinter_webdriver():
Expand Down
42 changes: 42 additions & 0 deletions docs/_forward.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Filtering results based on other form fields (forwarding)
=========================================================

- Example source: `test_project/alight_linked_data
<https://github.com/yourlabs/django-autocomplete-light/tree/alight-backend/test_project/alight_linked_data>`_
- Live demo: `Admin / Alight Linked Data / Add
<http://localhost:8000/admin/alight_linked_data/tmodel/add/>`_

The ``forward`` widget argument works the same way as in any DAL frontend:

.. code-block:: python

class PersonForm(forms.ModelForm):
continent = forms.ChoiceField(choices=CONTINENT_CHOICES)

class Meta:
model = Person
fields = ('__all__',)
widgets = {
'birth_country': autocomplete.ModelAlight(
url='country-autocomplete',
forward=['continent'],
)
}

In the view, read the forwarded value from ``self.forwarded``:

.. code-block:: python

class CountryAutocomplete(autocomplete.AlightQuerySetView):
def get_queryset(self):
qs = Country.objects.all()
continent = self.forwarded.get('continent', None)
if continent:
qs = qs.filter(continent=continent)
if self.q:
qs = qs.filter(name__istartswith=self.q)
return qs

All forwarding features (``forward.Field``,
``forward.Const``, ``forward.Self``, ``forward.JavaScript``, renaming) work
the same — they live in :py:mod:`dal.forward` and are frontend-agnostic.
Loading