List of Field Types Available in Django ORM

  • Django ORM (Object-Relational Mapping) provides a wide range of field types that you can use to define the attributes of your models.
Here is a list of some commonly used field types available in Django ORM:
  • AutoField: A field that automatically increments its value for each new object.
  • BigAutoField: Similar to AutoField but supports larger numbers.
  • BooleanField: A field that can store a True or False value.
  • CharField: A field for storing character strings with a specified maximum length.
  • TextField: A field for storing large text data.
  • DateField: A field for storing dates.
  • DateTimeField: A field for storing dates and times.
  • DecimalField: A field for storing decimal numbers with fixed precision.
  • EmailField: A field for storing email addresses.
  • FileField: A field for storing file uploads.
  • ImageField: A field for storing image uploads.
  • IntegerField: A field for storing integers.
  • FloatField: A field for storing floating-point numbers.
  • ForeignKey: A field for creating a many-to-one relationship with another model.
  • ManyToManyField: A field for creating a many-to-many relationship with another model.
  • OneToOneField: A field for creating a one-to-one relationship with another model.
  • PositiveIntegerField: A field for storing positive integers.
  • PositiveSmallIntegerField: A field for storing positive small integers.
  • SlugField: A field for storing URL-friendly strings.
  • URLField: A field for storing URLs.
  • UUIDField: A field for storing universally unique identifiers (UUIDs).
  • DurationField: A field for storing time durations.
  • BinaryField: A field for storing binary data.
  • JSONField: A field for storing JSON-encoded data.
  • IPAddressField: A field for storing IPv4 addresses.
  • GenericIPAddressField: A field for storing both IPv4 and IPv6 addresses.
  • These are just some of the field types available in Django ORM. Each field type has additional parameters and options that can be used to customize its behavior.

No comments:

Post a Comment