Hi

I need some tips on this please :)
I have a simple artist/release model with a ManyToOne relationship
(every artist publishing different pieces)

whats the best way to display this with datagrid or any other way?
The artist_fields datagrid returns a tuple or list and i couldn't find
a way to display it nicely in the template.
I'd like to have it all in one table, each artist and the matching
releases.

some guidance or reading tips would be much appreciated

TIA

model:
======
class Artist(SQLObject):
   name = StringCol(length=100, alternateID=True)
   releases = MultipleJoin('Release')


class Release(SQLObject):
   name = StringCol(length=100, alternateID=True)
   date = DateTimeCol(default=datetime.now)
   size = IntCol()
   url = StringCol()
   cover = StringCol()
   description = StringCol()
   artist = ForeignKey('Artist')


root controller:
============
def index(self):
       artist_fields = [('Name','name'),
                        ('Releases','releases')]
       release_fields = [('Name', 'name'),
                        ('Date', 'date'),
                        ('Size', 'size'),
                        ('Description', 'description')]

       return dict(artists=Artist.select(),

artist_widget=widgets.DataGrid(fields=artist_fields),
                   releases=Release.select(),

release_widget=widgets.DataGrid(fields=release_fields))


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to