Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Custom widget support (Add s3direct) #362

Open
talbenbasat opened this issue Nov 29, 2017 · 0 comments
Open

Custom widget support (Add s3direct) #362

talbenbasat opened this issue Nov 29, 2017 · 0 comments

Comments

@talbenbasat
Copy link

Hi,

This isn't a bug but a request for help.

I wish to integrate https://github.com/bradleyg/django-s3direct with django-material.

This is the way I used it in my model

pgm_file = S3DirectField(dest='csv_maps')

Also tried a custom form and a field with widget as kwarg - without any success.

I see it reaching material/base.py line 195, with the correct widget.
but then it rerenders it as a default input.

        try:
            if 'template' in options:
                template = select_template([
                    "{}/{}".format(template_pack, options['template'])
                ])
            elif 'widget' in options:
                widget_templates = [
                    '{}/fields/{}_{}.html'.format(
                        template_pack,
                        cls.__module__.split('.', 1)[0],
                        cls.__name__.lower()
                    )
                    for cls in type(options['widget']).mro()[:-2]
                ]
                template = select_template(widget_templates)
            else:
                template = _get_field_template(
                    template_pack, bound_field.field)

Thanks in advance
Tal

@talbenbasat talbenbasat changed the title Add s3direct support Custom widget support (Add s3direct) Dec 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants