<commit_before>Quick start
===========

The purpose of this documentation is to get you started as fast as possible,
because your time matters and you probably have other things to worry about.

Quick install
-------------

Install the package::

    pip install django-autocomplete-light
    # or the development version
    pip install -e git+git://github.com/yourlabs/django-autocomplete-light.git#egg=django-autocomplete-light

Add to INSTALLED_APPS: 'autocomplete_light'

Add to urls::

    url(r'autocomplete/', include('autocomplete_light.urls')),

Add before admin.autodiscover()::

    import autocomplete_light
    autocomplete_light.autodiscover()

Add to your base template::

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    {% load autocomplete_light_tags %}
    {% autocomplete_light_static %}

Quick admin integration
-----------------------

.. include:: _admin_template.rst

Create yourapp/autocomplete_light_registry.py, assuming "Author" has a "name" CharField::

    import autocomplete_light

    from models import Author

    autocomplete_light.register(Author)

See more about the channel registry in :ref:`registry-reference`.

If Author doesn't has another CharField, like full_name, then you could change the name of the search field::

    import autocomplete_light

    from models import Author

    class AuthorChannel(autocomplete_light.ChannelBase):
        search_field = 'full_name'

    # register Author with AuthorChannel !
    autocomplete_light.register(Author, AuthorChannel)

But still, the default implementation of query_filter() is pretty
trivial, you might want to customize how it will filter the queryset::
<commit_msg>Link to the documentation of get_result from quick<commit_after>Quick start
===========

The purpose of this documentation is to get you started as fast as possible,
because your time matters and you probably have other things to worry about.

Quick install
-------------

Install the package::

    pip install django-autocomplete-light
    # or the development version
    pip install -e git+git://github.com/yourlabs/django-autocomplete-light.git#egg=django-autocomplete-light

Add to INSTALLED_APPS: 'autocomplete_light'

Add to urls::

    url(r'autocomplete/', include('autocomplete_light.urls')),

Add before admin.autodiscover()::

    import autocomplete_light
    autocomplete_light.autodiscover()

Add to your base template::

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    {% load autocomplete_light_tags %}
    {% autocomplete_light_static %}

Quick admin integration
-----------------------

.. include:: _admin_template.rst

Create yourapp/autocomplete_light_registry.py, assuming "Author" has a "name" CharField::

    import autocomplete_light

    from models import Author

    autocomplete_light.register(Author)

See more about the channel registry in :ref:`registry-reference`.

If Author doesn't has another CharField, like full_name, then you could change
the name of the search field::

    import autocomplete_light

    from models import Author

    class AuthorChannel(autocomplete_light.ChannelBase):
        search_field = 'full_name'

    # register Author with AuthorChannel !
    autocomplete_light.register(Author, AuthorChannel)

But still, the `default implementation of query_filter()
<forms.html#autocomplete_light.channel.base.ChannelBase.get_results>`_ is
pretty trivial, you might want to customize how it will filter the queryset::

{'fraction_non_alphanumeric': 0.10320781032078104, 'fraction_numerical': 0.0016736401673640166, 'mean_word_length': 4.09375, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6848012', 'n_tokens_mistral': 1031, 'n_tokens_neox': 954, 'n_words': 316}