mirror of
https://github.com/Dadechin/Dashboard-XRoom.git
synced 2025-07-04 01:04:33 +00:00
12 lines
534 B
Python
12 lines
534 B
Python
from django.db import models
|
|
from django.conf import settings
|
|
|
|
class Image(models.Model):
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
|
url = models.URLField(max_length=250, blank=True) # For storing external URLs
|
|
image = models.ImageField(upload_to='user_images/', blank=True, null=True) # For file uploads
|
|
name = models.CharField(max_length=100)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __str__(self):
|
|
return f"{self.name} - {self.user.username}" |