django-better-filter-widget icon indicating copy to clipboard operation
django-better-filter-widget copied to clipboard

Error in using better-filter-widget out of admin

Open erasmodanarni opened this issue 7 years ago • 4 comments

Hello. I've got the following error trying to include the widget in a regular form, outside the admin app:

output = super(BetterFilterWidget, self).render(name, value, attrs, choices)
TypeError: render() takes at most 4 arguments (5 given)

Full stack trace:

https://gist.github.com/erasmodanarni/ad77549ac18f36f8999cc57b94482c66

Here is how I used it:

class SubazioniForm(forms.ModelForm):

    class Meta:
        model = Subazioni
        fields = '__all__'
        widgets = {
            'destinatari': BetterFilterWidget(),
        }

Any ideas how to proceed further?

Many thanks!

erasmodanarni avatar Mar 17 '17 00:03 erasmodanarni

What version of django are you using?

unformatt avatar Mar 17 '17 15:03 unformatt

If django 1.10, there a PR to fix this here: https://github.com/ExoticObjects/django-better-filter-widget/pull/7

Looking at it today.

unformatt avatar Mar 17 '17 15:03 unformatt

Hi Matt. I'm using 1.10... Thank you for your time!

On Fri, Mar 17, 2017 at 4:13 PM, Matt [email protected] wrote:

If django 1.10, there a PR to fix this here: #7 https://github.com/ExoticObjects/django-better-filter-widget/pull/7

Looking at it today.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ExoticObjects/django-better-filter-widget/issues/8#issuecomment-287381887, or mute the thread https://github.com/notifications/unsubscribe-auth/AYpXqcAMf-t-dvgCVYTshWbrVBlGFrqWks5rmqM0gaJpZM4MgB-j .

erasmodanarni avatar Mar 17 '17 16:03 erasmodanarni

I applied the changes, and now I find a javascript error in the html source: "Can't find variable: django"

screen shot 2017-03-18 at 19 24 38

The appearance of the page is like a standard multiple select field.

erasmodanarni avatar Mar 18 '17 18:03 erasmodanarni