ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved