# Path: app/models.py
# class Player(models.Model):
#     id = models.AutoField(primary_key=True)
#     user = models.OneToOneField(User, verbose_name="User", help_text="The user of this player.")
#     team = models.ForeignKey(Team,
#                              verbose_name="Team",
#                              help_text="The team this player belongs to.",
#                              related_name="player")
# 
#     @property
#     def points_acquired(self):
#         s = self.captured_card.filter(active=True).aggregate(models.Sum('value'))
#         if s['value__sum'] is None:
#             return 0
#         return s['value__sum']
# 
#     def __str__(self):
#         return (str(self.user.get_full_name()) + " (" +
#                 str(self.user.get_username()) + "), " + self.team.name)


from django import forms
from app.models import Player



class FastSendForm(forms.Form):
    message = forms.CharField(max_length=255, label="訊息", help_text="悄悄話", required=False)
    point = forms.IntegerField(label="價值", help_text="點數卡的價值", initial=1)

# Path: app/models.py
# class Player(models.Model):
#     id = models.AutoField(primary_key=True)
#     user = models.OneToOneField(User, verbose_name="User", help_text="The user of this player.")
#     team = models.ForeignKey(Team,
#                              verbose_name="Team",
#                              help_text="The team this player belongs to.",
#                              related_name="player")
# 
#     @property
#     def points_acquired(self):
#         s = self.captured_card.filter(active=True).aggregate(models.Sum('value'))
#         if s['value__sum'] is None:
#             return 0
#         return s['value__sum']
# 
#     def __str__(self):
#         return (str(self.user.get_full_name()) + " (" +
#                 str(self.user.get_username()) + "), " + self.team.name)


# Path: app/staff/forms.py
from django import forms
from app.models import Player




class FastSendForm(forms.Form):
    message = forms.CharField(max_length=255, label="訊息", help_text="悄悄話", required=False)
    point = forms.IntegerField(label="價值", help_text="點數卡的價值", initial=1)

    player = forms.ModelChoiceField(Player.objects.all(), label="玩家")