On Thursday, December 19, 2013 6:29:33 PM UTC-8, Dave S wrote:
>
>
>
> On Thursday, December 19, 2013 11:30:20 AM UTC-8, Cliff wrote:
>>
>> Hello.
>>
>> General question here. Me and some friends guess who is going to win 
>> NCAAF bowl games so I thought I would try and make an app for it. So I 
>> started off making a table for users, games, picks. 
>>
>> Users -> Person name | email
>> bowls -> Bowl name | team 1 | team 2 | time | winner
>> picks - > person (reference user) | pick (reference unsure) 
>>
>
> I'd add in a table of teams -> id | school name | team name | visitor [ | 
> colors | coach name | atheletic director name | BCS rank | other trivia]
> (visitor can be a boolean, to pick which team is listed in the left drop 
> down.)
> (I don't know that you need to have a link back to the bowl in the team 
> table; I'd skip doing that unless you figured out a specific need for it.)
>
> (note, allow the DAL to setup IDs in each table, which will be referenced. 
>  For instance, team1 in db.bowls will be a reference to teams.id)
>
> db.picks.pick would also be a reference to teams.id.
>
>
>
>> What I would like to do is make a page with an arg for user where I can 
>> enter their picks and it store it in a DB for that user. An example would 
>> be Bowl game 1: Team 1 vs Team 2 then a drop down list or radio button to 
>> select the team. Bowl game 2: team 1 vs team 2 drop down list to select the 
>> team etc etc.. Then later be able to list what user is ahead by wins. What 
>> I am getting caught up with is how to setup my databases. 
>>
>>
Oops, I think you need at least 1 field in the bowls table to indicate the 
winner.  One way of doing it would be a boolean "homevictor" to indicate 
that the home team won.  Hmmm, maybe 2 booleans, the other one being 
"gameover".  I think your counting of user victories would be a join of 
their picks and the bowl victory counts, but I'm an 90 pound SQL weakling, 
so maybe Niphlod, Alan, or Anthony will provide a clearer picture of that.
 

> If someone could point me in the right direction I would greatly 
>> appreciate it. 
>>
>
> I think the extra table for teams is the main change I would make.  Sounds 
> like a fun project to do over the holiday weekend.  Be sure and let us know 
> how it turned out and how your friends reacted.
>
> (Next year's goal:  moblile app client for your friends' phones)
>
>
/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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to