摘要:
models: class Publisher(models.Model): name = models.CharField(max_length=32, verbose_name="名称",unique=True)事务: import osos.environ.setdefault("DJANGO 阅读全文
摘要:
models: class Book(models.Model): name = models.CharField(max_length=32, verbose_name="书名") #定义价格: price = models.DecimalField(max_digits=5,decimal_pl 阅读全文
摘要:
app01\models:from django.db import modelsclass MyCharField(models.Field): """ 自定义的char类型的字段类 """ def __init__(self, max_length, *args, **kwargs): self 阅读全文