Changeset 860:63346a670007

Show
Ignore:
Timestamp:
03/10/10 13:39:32 (6 months ago)
Author:
johnbywater
Branch:
default
Message:

Updated license object attribute (to use normal attribute access, rather than dict key access).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ckan/model/license.py

    r858 r860  
    2727    def __getitem__(self, key, default=Exception): 
    2828        for license in self.licenses: 
    29             if key == license['id']: 
     29            if key == license.id: 
    3030                return license 
    3131        if default != Exception: 
     
    3535 
    3636    def keys(self): 
    37         return [license['id'] for license in self.licenses] 
     37        return [license.id for license in self.licenses] 
    3838 
    3939    def values(self): 
     
    4141 
    4242    def items(self): 
    43         return [(license['id'], license) for license in self.licenses] 
     43        return [(license.id, license) for license in self.licenses] 
    4444         
    4545    def __iter__(self): 

0.9.0.3 © 2008-2010 agile42 all rights reserved (this page was served in: 0.487763 sec.)