# Path: characters/models.py
# class Character(models.Model):
# 
#     objects = CharacterManager()
# 
#     player = models.ForeignKey(User)
# 
#     name = models.CharField(max_length=200)
#     background = models.TextField()
# 
#     race = models.ForeignKey(Race)
#     # This name isn't ideal, but 'class' is a Python builtin, so here we are...
#     # I went with 'cclass' as short for 'character class'.
#     cclass = models.ForeignKey(Class, verbose_name="class")
# 
#     alignment = models.CharField(max_length=2, choices=Alignment.CHOICES,
#             default=Alignment.NEUTRAL)
# 
#     level = models.IntegerField(default=1)
#     experience_points = models.IntegerField(default=0)
# 
#     max_hit_points = models.IntegerField(default=10)
#     current_hit_points = models.IntegerField(default=10)
# 
#     strength = models.IntegerField(default=generate_stat)
#     dexterity = models.IntegerField(default=generate_stat)
#     constitution = models.IntegerField(default=generate_stat)
#     intelligence = models.IntegerField(default=generate_stat)
#     wisdom = models.IntegerField(default=generate_stat)
#     charisma = models.IntegerField(default=generate_stat)
# 
#     inventory = models.ManyToManyField(Item, null=True, blank=True)
# 
#     created = models.DateTimeField(auto_now_add=True)
#     modified = models.DateTimeField(auto_now=True)
# 
#     def __str__(self):
#         return self.name


from django import forms
from characters.models import Character



class CharacterForm(forms.ModelForm):

    class Meta:
        model = Character
        fields = ['name', 'background', 'race', 'cclass', 'alignment',
                'strength', 'dexterity', 'constitution', 'intelligence',

# Path: characters/models.py
# class Character(models.Model):
# 
#     objects = CharacterManager()
# 
#     player = models.ForeignKey(User)
# 
#     name = models.CharField(max_length=200)
#     background = models.TextField()
# 
#     race = models.ForeignKey(Race)
#     # This name isn't ideal, but 'class' is a Python builtin, so here we are...
#     # I went with 'cclass' as short for 'character class'.
#     cclass = models.ForeignKey(Class, verbose_name="class")
# 
#     alignment = models.CharField(max_length=2, choices=Alignment.CHOICES,
#             default=Alignment.NEUTRAL)
# 
#     level = models.IntegerField(default=1)
#     experience_points = models.IntegerField(default=0)
# 
#     max_hit_points = models.IntegerField(default=10)
#     current_hit_points = models.IntegerField(default=10)
# 
#     strength = models.IntegerField(default=generate_stat)
#     dexterity = models.IntegerField(default=generate_stat)
#     constitution = models.IntegerField(default=generate_stat)
#     intelligence = models.IntegerField(default=generate_stat)
#     wisdom = models.IntegerField(default=generate_stat)
#     charisma = models.IntegerField(default=generate_stat)
# 
#     inventory = models.ManyToManyField(Item, null=True, blank=True)
# 
#     created = models.DateTimeField(auto_now_add=True)
#     modified = models.DateTimeField(auto_now=True)
# 
#     def __str__(self):
#         return self.name


# Path: characters/forms.py
from django import forms
from characters.models import Character




class CharacterForm(forms.ModelForm):

    class Meta:
        model = Character
        fields = ['name', 'background', 'race', 'cclass', 'alignment',
                'strength', 'dexterity', 'constitution', 'intelligence',

                'wisdom', 'charisma', 'max_hit_points']