How about creating a _get method in your class like:

def _get_ident(self):
    return self.namespace + ':' + str(self.id)

You have to give the identifier a different name, but it does what you want in a simple way.
You now get your identifier by 'object.ident'

TiNo

2007/7/30, Oleg Broytmann <phd@phd.pp.ru>:
On Mon, Jul 30, 2007 at 01:59:26AM -0300, ?$B%D Leandro Sales wrote:
>   I use the 'id' attribute of a sqlobject object in my program to
> uniquely identify a object. But now I need to use something like
> namespace:id as an identifier. What is the best way to produce this
> output since id is integer?
>   I want something like that:
>
>   select concat(namespace, ":", id) as id from object
>
>   Suppose that I have a field named namespace. In other words, is
> there a way to overload the get method which read the attribute id and
> everytime that I read object.id , sqlobject concat namespace + ":" +
> id.

   Unfortunataely, there is no easy way. SQLObject requires a single-column
primary key. I heard rumors some people succeeded in setting up
multiple-columns keys but in a complex way:

http://sqlobject.org/SQLObject.html#workaround-for-primary-keys-made-up-of-multiple-columns

Oleg.
--
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss