NotificationList has a bogus __getitem__

Bug #3450 reported by Stuart Bishop
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Won't Fix
Low
Stuart Bishop

Bug Description

In notification.py, we define a NotificationList class with an dodgy
__getitem__, in order to make things nice and usable from TALES. There are
better ways and this should be fixed.

>>It's rather odd to have __getitem__ return a list of items (sometimes)
>>>>while __iter__ generates items.
>
>>
>>
>> Indeed. It seemed the best way to expose this to TALES though. I didn't want
>> to dictate how the final rendering would look, so it could render the
>> notifications in order they are added, or group them by level,

Maybe an ITraversable adapter is the best place for this TALES support?

Or, make this class directly implement ITraversable.

 affects /products/launchpad
 assignee stub
 subscribe launchpad

--
Stuart Bishop <email address hidden> http://www.canonical.com/
Canonical Ltd. http://www.ubuntu.com/

Attachment: signature.asc
Type: application/pgp-signature; name="signature.asc"
URL: http://librarian.launchpad.net/1001438/1001471/signature.asc

Stuart Bishop (stub)
Changed in launchpad:
status: New → Accepted
Stuart Bishop (stub)
Changed in launchpad:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.