Django - Autocomplete_Light's "Add Another" popup declares: "'initial' is an invalid keyword argument for this function"
Question: I am working on getting the "add another" popup to work with `django-
autocomplete_light`.

Following along in the docs:

<http://django-autocomplete-light.readthedocs.org/en/latest/addanother.html>

I have set up my URLs:

    
    
    import autocomplete_light.shortcuts as al
    
    from AlmondKing.FinancialLogs import models
    from AlmondKing.FinancialLogs import forms
    
    urlpatterns = [
        url(r'^branches/autocreate/$', al.CreateView.as_view(
            model=models.CompanyBranch, form_class=forms.CompanyBranch),
            name='branch_autocreate'),
    ]
    

and my autocomplete_light_registry.py

    
    
    al.register(CompanyBranch,
        search_fields=['^branch_name'],
        attrs={
            'placeholder': 'Branch',
            'data-autocomplete-minimum-characters': 1,
        },
        widget_attrs={
            'data-widget-maximum-values': 1,
            'class': 'modern-style',
        },
        add_another_url_name='company:branch_autocreate',
    )
    

However, when I click the plus sign to add a new related object, I get the
following error:

> TypeError at /company/branches/autocreate/
>
> 'initial' is an invalid keyword argument for this function

I've been trying to find a way to do this for a while and I'm so close!

Now, I am hoping someone can read the traceback and help me understand what
went wrong:

    
    
    Environment:
    
    
    Request Method: GET
    Request URL: http://localhost:8000/company/branches/autocreate/?_popup=1&winName=id_branch
    
    Django Version: 1.8.2
    Python Version: 3.4.3
    Installed Applications:
    ('django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'AlmondKing.InventoryLogs',
     'AlmondKing.FinancialLogs',
     'AlmondKing.AKGenius',
     'autocomplete_light')
    Installed Middleware:
    ('django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
     'django.middleware.security.SecurityMiddleware',
     'AlmondKing.AKGenius.middleware.RequireLoginMiddleware')
    
    
    Traceback:
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\core\handlers\base.py" in get_response
      132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\base.py" in view
      71.             return self.dispatch(request, *args, **kwargs)
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\base.py" in dispatch
      89.         return handler(request, *args, **kwargs)
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\edit.py" in get
      245.         return super(BaseCreateView, self).get(request, *args, **kwargs)
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\edit.py" in get
      205.         form = self.get_form()
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\views\generic\edit.py" in get_form
      74.         return form_class(**self.get_form_kwargs())
    File "C:\Users\Adam\Envs\AlmondKing\lib\site-packages\django\db\models\base.py" in __init__
      480.                 raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
    
    Exception Type: TypeError at /company/branches/autocreate/
    Exception Value: 'initial' is an invalid keyword argument for this function
    


Answer: Try this:

    
    
        add_another_url_name='company:branch_autocreate',
    
        add_another_url_name='branch_autocreate',
    

