def s3_fieldmethod(name, f, represent=None):
 from gluon import Field
 if (represent is not None):
  class Handler(object, ):
   def __init__(self, method, row):
    self.method = method
    self.row = row
   def __call__(self, *args, **kwargs):
    return self.method(self.row, *args, **kwargs)
  if hasattr(represent, 'bulk'):
   Handler.represent = represent
  else:
   Handler.represent = staticmethod(represent)
  fieldmethod = Field.Method(name, f, handler=Handler)
 else:
  fieldmethod = Field.Method(name, f)
 return fieldmethod

def s3_fieldmethod ( name , f , represent = None ) : from gluon import Field if ( represent is not None ) : class Handler ( object , ) : def __init__ ( self , method , row ) : self . method = method self . row = row def __call__ ( self , * args , ** kwargs ) : return self . method ( self . row , * args , ** kwargs ) if hasattr ( represent , 'bulk' ) : Handler . represent = represent else : Handler . represent = staticmethod ( represent ) fieldmethod = Field . Method ( name , f , handler = Handler ) else : fieldmethod = Field . Method ( name , f ) return fieldmethod
helper to attach a representation method to a field .