Changeset 4419 for waeup/branches


Ignore:
Timestamp:
23 Jul 2009, 00:47:36 (15 years ago)
Author:
uli
Message:

Remove stuff we do not need.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/widgets/table.py

    r4404 r4419  
    5757        return result
    5858
    59     def castValue(self, value, type):
    60         return value
    61         if type == 'int':
    62             return str(value)
    63         return "'%s'" % value
    64    
    65     def castRow(self, row):
    66         """Lookup type of each column and cast values to strings usable in JS
    67         code.
    68         """
    69         result = []
    70         for num, value in enumerate(row):
    71             type = self.cols[num].type
    72             result.append(self.castValue(value, type))
    73         return result
    74 
    7559    def getRows(self):
    7660        data_cols = (x.data for x in self.cols)
     
    125109
    126110   
    127 class YUIStaticTable(grok.View):
     111class YUIStaticTableView(grok.View):
    128112    grok.context(Interface)
    129113    grok.name('yuistatictables.js')
     
    134118            provider = ITableProvider(self.context)
    135119        except:
    136             # Couldn't find a table provider for the context. Okay, if
    137             # the context is a view, we try to lookup the context of
    138             # the context...
    139             if hasattr(self.context, 'context'):
    140                 try:
    141                     print self.context.context
    142                     provider = ITableProvider(self.context.context)
    143                 except:
    144                     return ''
    145             else:
    146                 return ''
     120            # No table provider for the context. Be gentle...
     121            return ''
    147122        self.response.setHeader('Content-Type',
    148123                                'text/javascript; charset=UTF-8')
Note: See TracChangeset for help on using the changeset viewer.