<file_sep>from .card import Card
from .deck import Deck
from .deckCard import DeckCard
from .discard import Discard
from .discardCard import DiscardCard
from .game import Game
from .gameType import GameType
from .hand import Hand
from .handCard import HandCard
from .playerGame import PlayerGame
from .round import Round
from .roundScore import RoundScore
<file_sep>from django.db import models

class HandCard(models.Model):
    hand = models.ForeignKey('Hand', on_delete=models.CASCADE)
    card = models.ForeignKey('Card', on_delete=models.CASCADE)
    revealed = models.BooleanField()
    <file_sep>from django.db import models
from django.contrib.auth.models import User

class PlayerGame(models.Model):
    player = models.ForeignKey(User, on_delete=models.DO_NOTHING)
    game = models.ForeignKey('Game', on_delete=models.CASCADE)
    order = models.IntegerField()<file_sep># Generated by Django 3.2.5 on 2021-07-28 22:53

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('card_golfapi', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='game',
            name='round',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='Game', to='card_golfapi.round'),
        ),
        migrations.AlterField(
            model_name='round',
            name='game',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Round', to='card_golfapi.game'),
        ),
    ]
<file_sep>from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from django.contrib.auth.models import User

class Game(models.Model):
    playerCount = models.IntegerField(validators=[MinValueValidator(2), MaxValueValidator(4)],)
    gameType = models.ForeignKey('GameType', on_delete=models.DO_NOTHING)
    needPlayers = models.BooleanField()
    complete = models.BooleanField()
    playerAction = models.ForeignKey(User, related_name='PlayerAction', on_delete=models.DO_NOTHING)
    round = models.ForeignKey('Round', related_name='Game', on_delete=models.DO_NOTHING)
    winner = models.ForeignKey(User, related_name='winner', on_delete=models.DO_NOTHING, null=True)
<file_sep>from django.db import models

class Discard(models.Model):
    game = models.ForeignKey('Game', on_delete=models.CASCADE)
    <file_sep>from django.db import models

class GameType(models.Model):
    name = models.CharField(max_length=250)
    cardCount = models.IntegerField()
<file_sep>from django.db import models

class Round(models.Model):
    open = models.BooleanField()
    name = models.IntegerField()
    game = models.ForeignKey('Game', related_name='Round', on_delete=models.CASCADE)<file_sep>from django.db import models
from django.contrib.auth.models import User

class Hand(models.Model):
    player = models.ForeignKey(User, on_delete=models.DO_NOTHING)
    game = models.ForeignKey('Game', on_delete=models.CASCADE)
    score = models.IntegerField()<file_sep># Generated by Django 3.2.5 on 2021-07-28 22:46

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Card',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('suite', models.CharField(max_length=15)),
                ('name', models.CharField(max_length=15)),
                ('score', models.IntegerField()),
                ('image', models.URLField()),
            ],
        ),
        migrations.CreateModel(
            name='Deck',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('playerCount', models.IntegerField(validators=[django.core.validators.MinValueValidator(2), django.core.validators.MaxValueValidator(4)])),
                ('needPlayers', models.BooleanField()),
                ('complete', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='GameType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('cardCount', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Hand',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.IntegerField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.game')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Round',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('open', models.BooleanField()),
                ('name', models.IntegerField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Game', to='card_golfapi.game')),
            ],
        ),
        migrations.CreateModel(
            name='RoundScore',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.IntegerField()),
                ('player', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
                ('round', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='card_golfapi.round')),
            ],
        ),
        migrations.CreateModel(
            name='PlayerGame',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.IntegerField()),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.game')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='HandCard',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('revealed', models.BooleanField()),
                ('card', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.card')),
                ('hand', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.hand')),
            ],
        ),
        migrations.AddField(
            model_name='game',
            name='gameType',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='card_golfapi.gametype'),
        ),
        migrations.AddField(
            model_name='game',
            name='playerAction',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='PlayerAction', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='game',
            name='round',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='Round', to='card_golfapi.round'),
        ),
        migrations.AddField(
            model_name='game',
            name='winner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='winner', to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='DiscardCard',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('card', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.card')),
                ('deck', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.deck')),
            ],
        ),
        migrations.CreateModel(
            name='Discard',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.game')),
            ],
        ),
        migrations.CreateModel(
            name='DeckCard',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('card', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.card')),
                ('deck', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.deck')),
            ],
        ),
        migrations.AddField(
            model_name='deck',
            name='game',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='card_golfapi.game'),
        ),
    ]
<file_sep>
from django.contrib import admin
from django.urls import path
from django.urls.conf import include
from rest_framework import routers
from card_golfapi.views import register_user, login_user

router = routers.DefaultRouter(trailing_slash=False)

urlpatterns = [
    path('register', register_user),
    path('login', login_user),
    path('', include(router.urls)),
    path('api-ath', include('rest_framework.urls', namespace='rest_framework')),
    path('admin/', admin.site.urls),
]
<file_sep>from django.db import models

class Card(models.Model):
    suite = models.CharField(max_length=15)
    name = models.CharField(max_length=15)
    score = models.IntegerField()
    image = models.URLField(blank=True)<file_sep>from django.db import models

class DeckCard(models.Model):
    deck = models.ForeignKey('Deck', on_delete=models.CASCADE)
    card = models.ForeignKey('Card', on_delete=models.CASCADE)
    <file_sep>from django.db import models
from django.contrib.auth.models import User

class RoundScore(models.Model):
    round = models.ForeignKey('Round', on_delete=models.DO_NOTHING)
    player = models.ForeignKey(User, on_delete=models.DO_NOTHING, null=True)
    score = models.IntegerField()