#djangoモデルの作成
#名簿ツールなので，名前，年齢，性別，備考，登録日を定義する
from django.db import models
from django.core import validators

# Create your models here.

class Item(models.Model):

    SEX_CHOICES = (
        (1, '男性'),
        (2, '女性'),
    )

    name = models.CharField(
        verbose_name = '名前',
        max_length = 200,
    )

    age = models.IntegerField(
        verbose_name = '年齢',
        validators = [validators.MinValueValidator(1)],
        blank = True,
        null = True,
    )

    sex = models.IntegerField(
        verbose_name = '性別',
        choices = SEX_CHOICES,
        default = 1
    )

    memo = models.TextField(
        verbose_name = '備考',
        max_length = 300,
        blank = True,
        null = True,
    )

    created_at = models.DateTimeField(
        verbose_name = '登録日',
        auto_now_add = True
    )


    #管理サイト上の表示設定
    def __str__(self):
        return self.name

    class Meta:
        verbose_name = 'アイテム名'
        verbose_name_plural = 'アイテム'
aad5d4c76c1a90819f8b97d89df13d01a18e7153
<mask token>


class Item(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>


    class Meta:
        verbose_name = 'アイテム名'
        verbose_name_plural = 'アイテム'

<mask token>


class Item(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __str__(self):
        return self.name


    class Meta:
        verbose_name = 'アイテム名'
        verbose_name_plural = 'アイテム'

<mask token>


class Item(models.Model):
    SEX_CHOICES = (1, '男性'), (2, '女性')
    name = models.CharField(verbose_name='名前', max_length=200)
    age = models.IntegerField(verbose_name='年齢', validators=[validators.
        MinValueValidator(1)], blank=True, null=True)
    sex = models.IntegerField(verbose_name='性別', choices=SEX_CHOICES, default=1
        )
    memo = models.TextField(verbose_name='備考', max_length=300, blank=True,
        null=True)
    created_at = models.DateTimeField(verbose_name='登録日', auto_now_add=True)

    def __str__(self):
        return self.name


    class Meta:
        verbose_name = 'アイテム名'
        verbose_name_plural = 'アイテム'

from django.db import models
from django.core import validators


class Item(models.Model):
    SEX_CHOICES = (1, '男性'), (2, '女性')
    name = models.CharField(verbose_name='名前', max_length=200)
    age = models.IntegerField(verbose_name='年齢', validators=[validators.
        MinValueValidator(1)], blank=True, null=True)
    sex = models.IntegerField(verbose_name='性別', choices=SEX_CHOICES, default=1
        )
    memo = models.TextField(verbose_name='備考', max_length=300, blank=True,
        null=True)
    created_at = models.DateTimeField(verbose_name='登録日', auto_now_add=True)

    def __str__(self):
        return self.name


    class Meta:
        verbose_name = 'アイテム名'
        verbose_name_plural = 'アイテム'

#djangoモデルの作成
#名簿ツールなので，名前，年齢，性別，備考，登録日を定義する
from django.db import models
from django.core import validators

# Create your models here.

class Item(models.Model):

    SEX_CHOICES = (
        (1, '男性'),
        (2, '女性'),
    )

    name = models.CharField(
        verbose_name = '名前',
        max_length = 200,
    )

    age = models.IntegerField(
        verbose_name = '年齢',
        validators = [validators.MinValueValidator(1)],
        blank = True,
        null = True,
    )

    sex = models.IntegerField(
        verbose_name = '性別',
        choices = SEX_CHOICES,
        default = 1
    )

    memo = models.TextField(
        verbose_name = '備考',
        max_length = 300,
        blank = True,
        null = True,
    )

    created_at = models.DateTimeField(
        verbose_name = '登録日',
        auto_now_add = True
    )


    #管理サイト上の表示設定
    def __str__(self):
        return self.name

    class Meta:
        verbose_name = 'アイテム名'
        verbose_name_plural = 'アイテム'