How about creating a _get method in your class like:

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

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'


2007/7/30, Oleg Broytmann <>:
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 , 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:

     Oleg Broytmann    
           Programmers don't die, they just GOSUB without RETURN.

This 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 >>
sqlobject-discuss mailing list