What are the Model types

__all__ = [
    'AutoField', 'BLANK_CHOICE_DASH', 'BigAutoField', 'BigIntegerField',
    'BinaryField', 'BooleanField', 'CharField', 'CommaSeparatedIntegerField',
    'DateField', 'DateTimeField', 'DecimalField', 'DurationField',
    'EmailField', 'Empty', 'Field', 'FieldDoesNotExist', 'FilePathField',
    'FloatField', 'GenericIPAddressField', 'IPAddressField', 'IntegerField',
    'NOT_PROVIDED', 'NullBooleanField', 'PositiveIntegerField',
    'PositiveSmallIntegerField', 'SlugField', 'SmallIntegerField', 'TextField',
    'TimeField', 'URLField', 'UUIDField',
**]**
Copy the code

MySql > select * from ‘MySql’

1. Define the class type, and use the object created by the type to encapsulate and manage data.

The program The database
The class type Table form
The attribute properties The field field
object Record A record or line

2. The properties of the created model object must correspond to the field types in the database.

Object property type definition The type of field in the table
AutoField() Auto_increment Indicates the automatic increment of the primary key
BooleanField() Bool Indicates the Boolean type
NullBooleanField() Bool or NULL Extends a Boolean type
CharField() Varchar string
TextField() Text long text
IntegerField() Int integer
DecimalField() Double High precision floating point number
FloatField() Float Single-precision floating point number
DateField() The date date
TimeField() Time time
DateTimeField() Datetime Date and time
FileField() A blob of binary
ImageField() A blob of binary

3. Correspond to Mongodb database fields

MongoEngine field type Django ORM equivalent
StringField CharField
URLField URLField
EmailField EmailField
IntField IntegerField
FloatField FloatField
DecimalField DecimalField
BooleanField BooleanField
DateTimeField DateTimeField
EmbeddedDocumentField None
DictField None
ListField None