Thursday, July 27, 2017

Re: Django Group Models

very roughly:

User (player) table
Game table

table that has foreign keys to player and match and a number field
that has a validator it is in [1,..,4]
unique together constraint in that table for player, match, number

that way you only have to change the validator when you have a match
with another amount of players




On 26 July 2017 at 19:57, <threesixright@gmail.com> wrote:
> Very roughly.
>
> Something along the lines of this
>
> I would create a Player (players) and a Match (matches) tables.
> The match table contains 4 keys (player1, player2, player3, player4) and
> some extra fields (created, status, etc.)
> For each player you store some type of a skill (number) and a status
> (offline,lobby, playing, available), then alias, ping, etc.
> The match-making logic could search for players within a certain skill range
>
>
> On 26 Jul 2017, at 19:07, yingi keme <yingikeme@gmail.com> wrote:
>
> What will be the best approach to designing a database schema that groups
> users in a collection of 4?
>
> How will you create a model for lets say in an online game setting such that
> you want only 4 players in a single group based on thesame criteria amongst
> players?
>
> Creating this model is problematic for me.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b0856edd-1adf-44b3-b1ac-bf20c39274ac%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/BED50B18-8CF7-44E7-866D-A67854921E13%40gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don't drive species to extinction

2) Don't destroy a habitat that species rely on.

3) Don't change the climate in ways that will result in the above.

}<(((*>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABCjzWpZ42%2BX6Odv89hq%3DWueiM_vge%3DnacSg3j%3DkxkUGbH%3DTkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment