Comments (13)
Fixed in 3a2d6d3
You may now see Django-1.4 is required in both the README and documentation.
Thank you for your feedback !
from django-autocomplete-light.
I'm not sure, do you think that Django-1.4 should be a requirement for the whole app or just for that ? Did you get the rest to work ?
from django-autocomplete-light.
I meant only for the specific example, triying to use change the widget of the field in the ModelForm by hand but it dies here:
In template /venv/src/django-autocomplete-light/autocomplete_light/templates/autocomplete_light/widget.html, error at line 17
Caught FieldError while rendering: Cannot resolve keyword 'name' into field. Choices are: agent, data_creazione, data_modifica, id, ip, miao, qualcosa, u_data_pubblicazione, u_stato_pubblicazione
from django-autocomplete-light.
You have two options:
- override YourChannel.search_field, which is used by the default (trivial) query_filter() implementation
- override YourChannel.query_filter(), that's probably what you want
Thanks for your feedback, i'm about to document this.
from django-autocomplete-light.
Here is the documentation: http://django-autocomplete-light.readthedocs.org/en/latest/quick.html#quick-admin-integration
Hope this helps ! Does it ?
from django-autocomplete-light.
Yes, very helpful thanks. Now another missing bit is that django.contrib.staticfiles is required in INSTALLED_APPS and that you should run manage.py collectstatic.
from django-autocomplete-light.
Thank you for your feedback, a note about django.contrib.staticfiles was added to http://django-autocomplete-light.readthedocs.org/en/latest/quick.html#quick-install
Does it match your expectations ?
from django-autocomplete-light.
Yes, thanks
from django-autocomplete-light.
Great, i'll close this issue for now but feel free to re-open or open another one.
from django-autocomplete-light.
BTW, did you find a solution for modelform_factory ?
from django-autocomplete-light.
Yes, the solution is not use modelform_factory :) i've definied the widget for the field as usual:
class PositionForm(forms.ModelForm):
class Meta:
model = Position
widgets = {
'city': autocomplete_light.AutocompleteWidget('CityChannel', max_items=1)
}
from django-autocomplete-light.
Thanks for your feedback, I knew you had come up with something hehe... Maybe this would work too:
class Meta:
model = Position
widgets = autocomplete_light.get_widgets_dict(Position)
get_widgets_dict: http://django-autocomplete-light.readthedocs.org/en/latest/forms.html#autocomplete_light.forms.get_widgets_dict
Not sure if it's worth trying and / or documenting, probably users who actually need it (ie. model with lots of FKs/M2Ms) will figure it out by themselves
from django-autocomplete-light.
I prefer the explicit version but may be helpful to other people.
from django-autocomplete-light.
Related Issues (20)
- Missing sourcemap for `nucleus.css` HOT 3
- Enable duplicate selection HOT 3
- Collectstatic error with whitenoise on 3.9.5 (same as #1281) HOT 11
- Django Widget protocol not implemented properly in WidgetMixin HOT 2
- WidgetMixin __init__ breaks when attrs is None HOT 1
- DAL compatibility with other widgets
- Dal 3.10 not working with django 4.2 HOT 1
- Filtering results based on the value of other fields in the form - issue when i reselect the first field then second field does none change to none
- DAL generates multiple selectboxes for declarative field HOT 1
- DAL 3.10.4rc breaks autocomplete views HOT 5
- autocomplete.ModelSelect2 () not working in bootstrap5 modal HOT 1
- Django Autocomplete light Forward fields outside Admin
- Forward id for a models.ForeignKey("self") HOT 2
- Tutorial gives core not found error
- Wrong selection when clicking on bottom area of item
- Non-rc release forthcoming? HOT 3
- Cloning an autocomplete form dynamically HOT 8
- The selected filter does not filter the model in the admin panel
- Automoving to first selected item
- DAL is re-ordering items with the ModelSelect2Multiple widget HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-autocomplete-light.