[web2py] Re: Linking multiple many to many relationships

2019-07-19 Thread Dave S


On Friday, July 19, 2019 at 8:34:04 AM UTC-7, Gavin Kenny wrote:
>
>
>
> On Friday, 19 July 2019 15:26:05 UTC+1, Leonel Câmara wrote:
>>
>> You need another table which is an answer table, the answers will have a 
>> reference to the question and the team that answered.
>>
>
> Thank you,
>
> So to check my understanding, the Answer Table would have 3 fields, an 
> answer field and then two reference fields, one for question.db and one for 
> team.db?
>
>
For small tables (tens to hundreds of entries), recursive selects might be 
the practical choice.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Recursive-selects>


 

> Also,
> The questions are not uniquely numbered but as part of the round, i.e. 
> Round 1, Question 1, Q2, Q3, Q4 and Round 2, Q1, Q2, Q3.  etc
> Would I therefore link the answer table to the round table and then need 
> some kind join to allow me to get to the question?
>


Good luck!

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/4e23cfb7-8a72-41e7-b81d-1aa0c634acc4%40googlegroups.com.


[web2py] Re: Linking multiple many to many relationships

2019-07-19 Thread Gavin Kenny


On Friday, 19 July 2019 15:26:05 UTC+1, Leonel Câmara wrote:
>
> You need another table which is an answer table, the answers will have a 
> reference to the question and the team that answered.
>

Thank you,

So to check my understanding, the Answer Table would have 3 fields, an 
answer field and then two reference fields, one for question.db and one for 
team.db?

Also,
The questions are not uniquely numbered but as part of the round, i.e. 
Round 1, Question 1, Q2, Q3, Q4 and Round 2, Q1, Q2, Q3.  etc
Would I therefore link the answer table to the round table and then need 
some kind join to allow me to get to the question?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/55acb590-ea07-4657-b6ed-0018e6c88eb5%40googlegroups.com.


[web2py] Re: Linking multiple many to many relationships

2019-07-19 Thread Leonel Câmara
You need another table which is an answer table, the answers will have a 
reference to the question and the team that answered.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/02b8f337-6754-4f4c-a8dd-ceefbde63b4a%40googlegroups.com.