>
> do you think it is better to create a widget class per custom element
> instead of just switching the template_name variable or just setting the
> tag name like any attr ?


I'd imagine so. This way you can make required attributes their own
arguments to __init__, and any other customization you might need. It will
also make the form class a little clearer.

On Thu, 23 Jul 2020 at 17:05, '1337 Shadow Hacker' via Django developers
(Contributions to Django itself) <django-developers@googlegroups.com> wrote:

> The type attribute might not be relevant to most custom elements, but they
> don't matter: if they are not supported then they will not be used.
>
> Thank you for your interesting suggestion, do you think it is better to
> create a widget class per custom element instead of just switching the
> template_name variable or just setting the tag name like any attr ?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/ykJu1oX9HSuq5HaLSfRZjw0qdoL_hZQee5SJ-1kT4ZgR88IfXu_4-PVhuOCLQ014zLmeLIxF8V9BRrQy6jp7-bu_dPofgIfqIKBKgWY7d9A%3D%40protonmail.com
> <https://groups.google.com/d/msgid/django-developers/ykJu1oX9HSuq5HaLSfRZjw0qdoL_hZQee5SJ-1kT4ZgR88IfXu_4-PVhuOCLQ014zLmeLIxF8V9BRrQy6jp7-bu_dPofgIfqIKBKgWY7d9A%3D%40protonmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM3z7DD7Fzd80P8WQSiBm_OcsQByKb%2BbfPby52Wj75wtUw%40mail.gmail.com.
  • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
    • ... Adam Johnson
      • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
        • ... Adam Johnson
          • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
            • ... Carlton Gibson
              • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
                • ... Carlton Gibson
                • ... Tim Graham
                • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
                • ... Tim Graham
                • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)
                • ... Tim Graham
                • ... '1337 Shadow Hacker' via Django developers (Contributions to Django itself)

Reply via email to