My mistake. It should be
db.define_table("Ground",
SQLField("won_by", db.Team),
SQLField("Match_ids", *"text"*))
db.define_table("Match",
SQLField("Ground_id", db.Ground),
SQLField("win_margin", "string"),
SQLField("no", "integer"))
db.Match.Ground_id.requires=
IS_IN_DB(db, 'Ground.id')
db.Ground.Match_ids.requires=IS_IN_DB(db, 'Match.id', multiple=True)
Thanks,
2009/1/3 sudhakar m <[email protected]>
> Referencing the table before definition causes error. Following test case
> fails.
>
> db.define_table("Ground",
> SQLField("won_by", db.Team),
> SQLField("Match_ids", *db.Match*))
>
> db.define_table("Match",
> SQLField("Ground_id", *db.Ground*),
> SQLField("win_margin", "string"),
> SQLField("no", "integer"))
>
> db.Match.Ground_id.requires=IS_IN_DB(db, 'Ground.id')
> db.Ground.Match_ids.requires=IS_IN_DB(db, 'Match.id', *multiple=True*)
>
> I am using many-to-many feature introduced in 1.55 rc3. I think we may have
> to scan the model file fully before creating the relationship between them.
>
> Correct me if I am wrong.
>
> Sudhakar.M
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---