1st How do i change a default html property on django-autocomplete-light?
2nd How does django renders the html elements from a form widget?
Hi there! I'm using django-autocomplete-light v3.
1st I will show you how to understand my problem
2nd I'going to ask you for any help
Would you like to try django-autocomplete-light in less than a minute and help me?
You may follow the steps from here: https://django-autocomplete-light.readthedocs.io/en/master/install.html
Or just:
pip install django-autocomplete-light
Then, to let Django find the static files we need by adding to INSTALLED_APPS, before
django.contrib.admin and grappelli if present:
'dal',
'dal_select2',
# 'grappelli',
'django.contrib.admin',
Install the demo project
Install the demo project in a temporary virtualenv for testing purpose:
cd /tmp
virtualenv -p python3 dal_env
source dal_env/bin/activate
pip install django
pip install -e git+https://github.com/yourlabs/django-autocomplete-light.git#egg=django-autocomplete-light
cd dal_env/src/django-autocomplete-light/test_project/
pip install -r requirements.txt
./manage.py migrate
./manage.py createsuperuser
./manage.py runserver
# go to http://localhost:8000/admin/ and login
Now you are able to help!!!
1.1 Log in to your admin panel
1.2 scroll until you see "SELECT2_ONE_TO_ONE" and click
1.3 Add a new Tmodel clicking in the 'plus' button from the right
1.4 Go to the Inspection mode on you Browser (ctrl+shift+i)and click on any select field there
i don't have enough reputation to post an image, but you can se it in this link here:
https://github.com/yourlabs/django-autocomplete-light/issues/850#issuecomment-370982681
Now, you can see something alike the one from the image shown.
What i'm trying to do is to change the style property of the second above the input of the select and that is what a want you to help me with.
I want to change the file where that "style='width:434px'" is written to "style='width:100%'" but i can't find it anywhere, because i don't know how does django renders the html elements or from where do they come.
I also have django-autocomplite-light available on a personal project which i didn“t share here to avoid big explanations. :)
2 I would be very thankful for any help!