<commit_before>Django AJAX Changelist
===============================

*NOTE: this project is currently untested, lacks detailed documentation, and has only been used in production for a limited SelectField use case.  The goal of the project is to support inline editing of all field types (using their corresponding widgets) from the Django admin changelist view.*

This project extends Django ModelAdmin to support editing specified fields directly from the changelist (the Django admin's listview of objects of a given Model).

AJAX editing of fields from the changelist is useful when you need to quickly change a few properties of objects in the changelist -- instead of clicking through to each object's page, saving, and returning to the list, you can make the edits right from the list.

Usage
---------

1. Add `ajax_changelist` to your INSTALLED_APPS.

2. Register an Admin class that inherits from AjaxModelAdmin:

```python
from ajax_changelist.admin import AjaxModelAdmin

class BearAdmin(AjaxModelAdmin):
  form = BearForm  # usual form you'd use for your ModelAdmin here, nothing special needed

  # Specify the fields you'd like to be able to edit via AJAX here:
  ajax_list_display = ('snout_length', 'honey_affinity_score',)
  
  # Specify the remainder of the fields you'd like to show in the changelist view:
  #   (don't specify the AJAX fields here)
  list_display = ('name', 'is_fictional',)

...

admin.site.register(Bear, BearAdmin)

```

Form field/widget display approach
--------------------------------------

To take advantage of Django's form widgets, widgets are rendered serverside.  Currently they are rendered inline in the changelist view, though retrieving via AJAX would be more efficient for some field types.

Known Issues
-----------------

* jQuery 1.9.1 is added without namespacing and calling noConflict()
* Use in conjunction with ManyToManyFields:
    * Without extra user intervention (prefetching and caching options list), rendering a Select or similar widget for a M2M field generates a ton of extra queries when loading the changelist view.
    * Select widgets with many options will weigh down the admin page. (In future this can be handled by retrieving them via AJAX when a field is selected)
* Doesn't work with django-taggit fields and likely many other third-party provided fields/their corresponding widgets.
* The form fade-in/fade-out animations are potentially quite annoying; a switch should be provided to disable them.
<commit_msg>Tone down the warning in the README a bit<commit_after>Django AJAX Changelist
===============================

**NOTE: this app is currently alpha-quality. Please test it thoroughly in a development environment before deciding whether to integrate it to your project, and note the list of known issues.**

This project extends Django ModelAdmin to support editing specified fields directly from the changelist (the Django admin's listview of objects of a given Model).

AJAX editing of fields from the changelist is useful when you need to quickly change a few properties of objects in the changelist -- instead of clicking through to each object's page, saving, and returning to the list, you can make the edits right from the list.

Usage
---------

1. Add `ajax_changelist` to your INSTALLED_APPS.

2. Register an Admin class that inherits from AjaxModelAdmin:

```python
from ajax_changelist.admin import AjaxModelAdmin

class BearAdmin(AjaxModelAdmin):
  form = BearForm  # usual form you'd use for your ModelAdmin here, nothing special needed

  # Specify the fields you'd like to be able to edit via AJAX here:
  ajax_list_display = ('snout_length', 'honey_affinity_score',)
  
  # Specify the remainder of the fields you'd like to show in the changelist view:
  #   (don't specify the AJAX fields here)
  list_display = ('name', 'is_fictional',)

...

admin.site.register(Bear, BearAdmin)

```

Form field/widget display approach
--------------------------------------

To take advantage of Django's form widgets, widgets are rendered serverside.  Currently they are rendered inline in the changelist view, though retrieving via AJAX would be more efficient for some field types.

Known Issues
-----------------

* jQuery 1.9.1 is added without namespacing and calling noConflict()
* Use in conjunction with ManyToManyFields:
    * Without extra user intervention (prefetching and caching options list), rendering a Select or similar widget for a M2M field generates a ton of extra queries when loading the changelist view.
    * Select widgets with many options will weigh down the admin page. (In future this can be handled by retrieving them via AJAX when a field is selected)
* Doesn't work with django-taggit fields and likely many other third-party provided fields/their corresponding widgets.
* The form fade-in/fade-out animations are potentially quite annoying; a switch should be provided to disable them.

{'fraction_non_alphanumeric': 0.0845356634830319, 'fraction_numerical': 0.002438528754318228, 'mean_word_length': 4.027579162410623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2291126', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1186, 'n_words': 662}