hi, could I assign particular object for SingleJoin? I have a class
like this:

class AlbumCategory(SQLObject):
        cover = SingleJoin("AlbumPhoto", joinColumn='album_id')

class AlbumPhoto(SQLObject):
        album = ForeignKey("AlbumCategory")

# Test in shell

In [33]: a = AlbumCategory.get(1)

In [34]: a
Out[34]: <AlbumCategory 1 name=u'yuri' description=u'' userID=1
block=False>

In [35]: p = AlbumPhoto.get(2)

In [36]: p
Out[39]: <AlbumPhoto 2 real_name="u'200602270206015...'"
original_name=u'205' de
scription=u'' albumID=1 cover=False>

In [37]: a.cover
Out[37]: <AlbumPhoto 1 real_name="u'200602270204565...'"
original_name=u'1123614
046' description=u'' albumID=1 cover=False>

## I want to change the cover to another, but got traceback.
In [38]: a.cover = p
---------------------------------------------------------------------------
exceptions.AttributeError                            Traceback (most
recent call
 last)

E:\TurboGears\myrs\<console>

AttributeError: can't set attribute

any ideas? thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to