Django 4.0.x Documentation
supported), rather than an actual file. For example: from django.core.files.base import ContentFile f1 = ContentFile("esta frase está en español") f2 = ContentFile(b"these are bytes") The ImageFile class class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 with the result. Variable names consist of any combination of alphanumeric characters and the under- score ("_") but may not start with an underscore, and may not be a number. The dot (".") also appears in0 码力 | 2248 页 | 7.90 MB | 1 年前3Django 3.2.x Documentation
supported), rather than an actual file. For example: from django.core.files.base import ContentFile f1 = ContentFile("esta frase está en español") f2 = ContentFile(b"these are bytes") The ImageFile class both of these models use the same underlying database table: class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) (continues on next page) 6.15. Models 1315 Django Documentation previous page) class Meta: managed = False db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 = models.CharField(max_length=10) class Meta: db_table = 'app_largetable'0 码力 | 2199 页 | 7.89 MB | 1 年前3Django 5.1.2 Documentation
Returns an alternative filename based on the file_root and file_ext parameters. By default, an under- score plus a random 7 character alphanumeric string is appended to the filename before the extension. Django Documentation, Release 5.1.2.dev20240916204136 from django.core.files.base import ContentFile f1 = ContentFile("esta frase está en español") f2 = ContentFile(b"these are bytes") The ImageFile class both of these models use the same underlying database table: class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = "app_largetable" (continues0 码力 | 2923 页 | 9.62 MB | 1 年前3Django 5.1 Documentation
Returns an alternative filename based on the file_root and file_ext parameters. By default, an under- score plus a random 7 character alphanumeric string is appended to the filename before the extension. Django Documentation, Release 5.1.1.dev20240808115027 from django.core.files.base import ContentFile f1 = ContentFile("esta frase está en español") f2 = ContentFile(b"these are bytes") The ImageFile class both of these models use the same underlying database table: class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = "app_largetable" (continues0 码力 | 2917 页 | 9.59 MB | 1 年前3Django 5.0.x Documentation
Returns an alternative filename based on the file_root and file_ext parameters. By default, an under- score plus a random 7 character alphanumeric string is appended to the filename before the extension. Django Documentation, Release 5.0.2.dev20240126115907 from django.core.files.base import ContentFile f1 = ContentFile("esta frase está en español") f2 = ContentFile(b"these are bytes") The ImageFile class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = "app_largetable" class ManagedModel(models.Model): f1 = models.CharField(max_length=10)0 码力 | 2878 页 | 9.60 MB | 1 年前3Django 1.8.x Documentation
For example: from __future__ import unicode_literals from django.core.files.base import ContentFile f1 = ContentFile("esta sentencia está en español") f2 = ContentFile(b"these are bytes") The ImageFile both of these models use the same underlying database table: class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False 1106 Chapter 6. API Reference Django Documentation, Release 1.8.20.dev20180306181007 db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 = models.CharField(max_length=10) class Meta: db_table = 'app_largetable'0 码力 | 1685 页 | 6.01 MB | 1 年前3Django 2.1.x Documentation
ported), rather than an actual file. For example: from django.core.files.base import ContentFile f1 = ContentFile("esta frase está en español") f2 = ContentFile(b"these are bytes") The ImageFile class class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 consist of any letter (A-Z), any digit (0-9), an underscore (but they must not start with an under- score) or a dot. Dots have a special meaning in template rendering. A dot in a variable name signifies0 码力 | 1910 页 | 6.49 MB | 1 年前3Django 1.11.x Documentation
For example: from __future__ import unicode_literals from django.core.files.base import ContentFile f1 = ContentFile("esta sentencia está en español") f2 = ContentFile(b"these are bytes") 6.11. File handling class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 consist of any letter (A-Z), any digit (0-9), an underscore (but they must not start with an under- score) or a dot. Dots have a special meaning in template rendering. A dot in a variable name signifies0 码力 | 1878 页 | 6.40 MB | 1 年前3Django 1.10.x Documentation
For example: from __future__ import unicode_literals from django.core.files.base import ContentFile f1 = ContentFile("esta sentencia está en español") f2 = ContentFile(b"these are bytes") The ImageFile class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 consist of any letter (A-Z), any digit (0-9), an underscore (but they must not start with an under- score) or a dot. Dots have a special meaning in template rendering. A dot in a variable name signifies0 码力 | 1817 页 | 6.19 MB | 1 年前3Django 2.0.x Documentation
ported), rather than an actual file. For example: from django.core.files.base import ContentFile f1 = ContentFile("esta sentencia está en español") f2 = ContentFile(b"these are bytes") The ImageFile class CommonlyUsedModel(models.Model): f1 = models.CharField(max_length=10) class Meta: managed = False db_table = 'app_largetable' class ManagedModel(models.Model): f1 = models.CharField(max_length=10) f2 consist of any letter (A-Z), any digit (0-9), an underscore (but they must not start with an under- score) or a dot. Dots have a special meaning in template rendering. A dot in a variable name signifies0 码力 | 1880 页 | 6.41 MB | 1 年前3
共 30 条
- 1
- 2
- 3