Django

Code

Ticket #9216 (closed: wontfix)

Opened 9 months ago

Last modified 4 months ago

Forms: Assert that js and css attributes of Media contain list or tuple

Reported by: guettli Assigned to: nobody
Milestone: Component: Forms
Version: 1.0 Keywords:
Cc: hv@tbz-pariv.de Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Hi,

this patch checks if the attributes js and css of the Media class contain a list or tuple, and not a string.

Test included.

Attachments

widget_assert_list_or_tuple.diff (2.0 kB) - added by guettli on 09/26/08 03:24:07.

Change History

09/26/08 03:24:07 changed by guettli

  • attachment widget_assert_list_or_tuple.diff added.

02/26/09 10:56:40 changed by jacob

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to wontfix.
  • needs_tests changed.
  • needs_docs changed.

isinstance() checks are not good Python -- any iterable should work for js, for example -- and this check isn't needed. If someone uses a bad type, they'll get an error. That's how Python works.

03/02/09 02:49:26 changed by guettli

Strings are iterable. But if you use a string, you won't get the expected result.

A patch like this would make django more friendly for people with little experience.

Maybe I should have done it different: Check if the object is iterable, but is not a string.


Add/Change #9216 (Forms: Assert that js and css attributes of Media contain list or tuple)




Change Properties
Action