Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#9216 closed Uncategorized (wontfix)

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

Reported by: Thomas Güttler Owned by: nobody
Component: Forms Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (1)

widget_assert_list_or_tuple.diff (2.0 KB ) - added by Thomas Güttler 16 years ago.

Download all attachments as: .zip

Change History (4)

by Thomas Güttler, 16 years ago

comment:1 by Jacob, 16 years ago

Resolution: wontfix
Status: newclosed

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.

comment:2 by Thomas Güttler, 16 years ago

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.

comment:3 by Thomas Güttler, 13 years ago

Cc: hv@… removed
Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top