ro a écrit :
> On 5/18/07, sophana <sophana@...> wrote:
>> ro a écrit :
>> > hi all
>> > I meet a problem
>> > I write a _get_ function in my class:
>> > class Page(SQLObject):
>> > ...
>> > def _get_link_copy_by_space(self, space_id):
>> > ....
>> > return None
>> > And while I call this function by such code:
>> > page = Page.get(page_id)
>> > page.link_copy_by_space(space.id)
>> > sqlobject give me this error:
>> > TypeError: _get_link_copy_by_space() takes exactly 2 arguments (1
>> > I dont know what is the argument I missed.
>> have you tried this?
>> def link_copy_by_space(self, space_id): ...
> Yes, if define this function as a normal function is OK.
> I just want to know why deos it cause that error as a _get_ function
I think it's because the _get_ feature is to add virtual attributes, not
You are trying to add a method, not an attribute.
An _get_attribute does not get any additionnal argument I think.
You add methods the standard way.