Changeset 14

Show
Ignore:
Timestamp:
11/18/08 14:33:45 (7 weeks ago)
Author:
sporcari
Message:
 
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gnrjs/gnr_d11/js/genro_frm.js

    r9 r14  
    475475        } 
    476476    }, 
    477     validate_nodup: function(param, result, sourceNode){ 
     477    validate_nodup: function(param, value, sourceNode){ 
    478478        var dbfield = ((typeof(param)=='string') && param) ? param : sourceNode.getAttributeFromDatasource('dbfield'); 
    479479        if(value){ 
  • gnrpy/gnr/sql/gnrsqldata.py

    r1 r14  
    613613    def fetch(self): 
    614614        """get a cursor of current selection and fetch it""" 
    615         return self.cursor().fetchall()  
     615        return self.cursor().fetchall() 
     616         
     617    def fetchAsDict(self, key=None): 
     618        """return the fetch as a dict on the given key""" 
     619        fetch = self.fetch() 
     620        key = key or self.dbtable.pkey 
     621        return dict([(r[key],r) for r in fetch]) 
    616622 
    617623    def test(self):