def setField(self,name,typ=None,label=None):
        """ Create if nessessary or get the existing datafield object with name 'name' and return it.
            If created, attributes 'type' and 'label' are applied to new datafield."""
        f=self.getField(name)
        if f: return f
        return self.addChild(node=DataField(name,None,typ,0,label))
 Create if nessessary or get the existing datafield object with name 'name' and return it.
            If created, attributes 'type' and 'label' are applied to new datafield.
chrome-cordova/gcmServer/xmpp/protocol.py