[Tutor] Some help with properties and accessor functions....
by Mark True other posts by this author
Apr 19 2006 9:47AM messages near this date
Re: [Tutor] [Linux] open a file in any home "~" ?
|
Re: [Tutor] Some help with properties and accessor functions....
class SOFileIndexRecord(object):
def __init__(self, so):
self._so=so
def _get_code(self):
return self._so.code
def _set_code(self, value):
self._so.code=value
testCode=property(_get_code, _set_code) # What does this do?
def _get_fileName(self):
return self._so.fileName
def _set_fileName(self, value):
self._so.fileName=value
fileName=property(_get_fileName, _set_fileName) # What does this do?
I am playing with SQLobject, and I managed to cobble together some code for
it based on information in the FAQ but I am not understanding entirely what
I am doing....can someone help? I don't really understand what setting
properties does and how I access the defined get/set functions in this
object.
Any info would be wonderful, thanks in advance!
--Mark
Thread:
Mark True
Alan Gauld
|