Sahasranaman schrieb:
> Hello guys,
> 
> I need to create a model like this:
> 
> class team(SQLObject):
>     name = UnicodeCol(length = 30)
>     score = IntCol()
>     playingagainst = ForeignKey('team')
> 
> 
> Can I do this? Can I create a field in an sql model which is a foreign
> key to the model containing it?

Use an n:m relationship instead (and SO will create an intermediate table):

http://sqlobject.org/SQLObject.html#many-to-many-relationships

Probably teams will play against many other teams, not only against one?


Chris

--~--~---------~--~----~------------~-------~--~----~
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