Django 3.0.x Documentationconcise way: from Django.db import models class Runner(models.Model): MedalType = models.TextChoices('MedalType', 'GOLD SILVER BRONZE') name = models.CharField(max_length=60) keywords values. • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime utils.translation import gettext_lazy as class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = 'FR', _('Freshman') SOPHOMORE = 'SO', _('Sophomore')0 码力 | 3085 页 | 2.95 MB | 2 年前3
Django 5.0.x Documentationconcise way: from Django.db import models class Runner(models.Model): MedalType = models.TextChoices("MedalType", "GOLD SILVER BRONZE") name = models.CharField(max_length=60) fspath(). • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime translation import gettext_lazy as _ class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = "FR", _("Freshman") SOPHOMORE = "SO", _("Sophomore")0 码力 | 2878 页 | 9.60 MB | 2 年前3
Django 5.1.2 Documentationconcise way: from Django.db import models class Runner(models.Model): MedalType = models.TextChoices("MedalType", "GOLD SILVER BRONZE") name = models.CharField(max_length=60) fspath(). • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime translation import gettext_lazy as _ class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = "FR", _("Freshman") SOPHOMORE = "SO", _("Sophomore")0 码力 | 2923 页 | 9.62 MB | 1 年前3
Django 5.1 Documentationconcise way: from Django.db import models class Runner(models.Model): MedalType = models.TextChoices("MedalType", "GOLD SILVER BRONZE") name = models.CharField(max_length=60) fspath(). • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime translation import gettext_lazy as _ class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = "FR", _("Freshman") SOPHOMORE = "SO", _("Sophomore")0 码力 | 2917 页 | 9.59 MB | 1 年前3
Django 5.0.x Documentationclasses to define choices in a concise way: class Runner(models.Model): MedalType = models.TextChoices("MedalType", "GOLD SILVER BRONZE") name = models.CharField(max_length=60) from html#os.fspath]. • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime to define choices in a concise way: class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = "FR", _("Freshman") SOPHOMORE = "SO", _("Sophomore")0 码力 | 3407 页 | 3.21 MB | 2 年前3
Django 3.0.x Documentationconcise way: from Django.db import models class Runner(models.Model): MedalType = models.TextChoices('MedalType', 'GOLD SILVER BRONZE') name = models.CharField(max_length=60) keywords values. • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime utils.translation import gettext_lazy as class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = 'FR', _('Freshman') SOPHOMORE = 'SO', _('Sophomore')0 码力 | 2002 页 | 6.73 MB | 2 年前3
Django 3.1.x Documentationin a concise way: from django.db import models class Runner(models.Model): MedalType = models.TextChoices('MedalType', 'GOLD SILVER BRONZE') name = models.CharField(max_length=60) medal = models.CharField(blank=True Release 3.1.15.dev • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime utils.translation import gettext_lazy as _ class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = 'FR', _('Freshman') SOPHOMORE = 'SO', _('Sophomore') JUNIOR = 'JR', _('Junior') SENIOR0 码力 | 2053 页 | 6.92 MB | 2 年前3
Django 4.1.x Documentation```python from django.db import models class Runner(models.Model): MedalType = models.TextChoices('MedalType', 'GOLD SILVER BRONZE') name = models.CharField(max_length=60) fspath( ). - LazyObject instances which wrap a serializable value. - Enumeration types (e.g. TextChoices or IntegerChoices) instances. - Any Django field - Any function or method reference (e.g. datetime0 码力 | 3240 页 | 3.13 MB | 2 年前3
Django 4.0.x Documentation```python from django.db import models class Runner(models.Model): MedalType = models.TextChoices('MedalType', 'GOLD SILVER BRONZE') name = models.CharField(max_length=60) fspath( ). - LazyObject instances which wrap a serializable value. - Enumeration types (e.g. TextChoices or IntegerChoices) instances. - Any Django field - Any function or method reference (e.g. datetime0 码力 | 3184 页 | 3.14 MB | 2 年前3
Django 3.1.x Documentationconcise way: from Django.db import models class Runner(models.Model): MedalType = models.TextChoices('MedalType', 'GOLD SILVER BRONZE') name = models.CharField(max_length=60) keywords values. • LazyObject instances which wrap a serializable value. • Enumeration types (e.g. TextChoices or IntegerChoices) instances. • Any Django field • Any function or method reference (e.g. datetime utils.translation import gettext_lazy as class Student(models.Model): class YearInSchool(models.TextChoices): FRESHMAN = 'FR', _('Freshman') SOPHOMORE = 'SO', _('Sophomore')0 码力 | 3094 页 | 3.03 MB | 2 年前3
共 18 条
- 1
- 2
相关搜索词
ASGIDjango 3.0ExclusionConstraintTextChoicesSynchronousOnlyOperationDjango框架模型层视图层模板层异步支持Djangodocumentationrelease notestutorialsreference guides查询集ORMadmintemplateformclass-based viewsstatic filesloggingORM改进模型视图URL模板模板系统数据库迁移asynchronous viewsJSONFielddeprecationPython compatibilitycaching middleware













