Picture model
The Picture
model represents an image entry in the database. It includes fields to store the content type, object ID, name, and the image itself.
Fields
content_type
integer
A foreign key to the ContentType
model, limited to specific models (anime, manga, character, person).
object_id
UUID
The UUID of the related object.
content_object
GenericForeignKey
A generic foreign key linking the picture to the content type and object ID.
name
string
The name of the picture, with a default value generated by generate_random_code
.
image
image
The image file, with validations for file extension, size, and dimensions.
created_at
datetime
The date and time when the character was first created. This field is automatically populated when the entry is initially saved.
updated_at
datetime
The date and time of the last update. This field is automatically refreshed each time the entry is modified and saved.
is_available
boolean
Indicates is available or not. The default value is True
.