#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)
Change History (4)
by , 17 years ago
| Attachment: | widget_assert_list_or_tuple.diff added |
|---|
comment:1 by , 17 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
comment:2 by , 17 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 , 14 years ago
| Cc: | removed |
|---|---|
| Easy pickings: | unset |
| Severity: | → Normal |
| Type: | → Uncategorized |
| UI/UX: | unset |
Note:
See TracTickets
for help on using tickets.
isinstance()checks are not good Python -- any iterable should work forjs, for example -- and this check isn't needed. If someone uses a bad type, they'll get an error. That's how Python works.