[Answered ]-Django tags auto suggest

2πŸ‘

βœ…

(i can’t write comments so…) To clarify situation:

If any of files is missing, you should get it from repository.

(We assume that /static is STATIC_URL in your config)

Upd: Start to work when connecting Form with Model (using ModelForm ) :

from django.forms import ModelForm


class OokForm(ModelForm):
    class Meta:
        model = Ook
        fields = ['name', 'tags']

in views.py:

def OokView (request):
    form =  OokForm()
    c = {'form': form}
    return render(request,'ook_form.html', c)

in ook_form.html:

<html>
<head>
    <!-- Be sure that there is no JS errors during loading -->
    <script src="//code.jquery.com/jquery-1.10.1.min.js"></script>
    <link href="/static/jquery-autosuggest/css/autoSuggest-grappelli.css" type="text/css" media="all" rel="stylesheet" />
    <script type="text/javascript" src="/static/jquery-autosuggest/js/jquery.autoSuggest.minified.js">
    </script>
</head>

<form action="/your-name/" method="post">
    {% csrf_token %}
    {{ form }}
    <input type="submit" value="Submit" />
</form>

</body>
πŸ‘€1844144

Leave a comment