Files
dj52/utils/models.py
Beyhan Oğur ec28a2024d first commit
2026-04-26 22:22:29 +03:00

27 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from django.db import models
# Create your models here.
class JsonToType(models.Model):
aktif = (
(True, 'Evet'),
(False, 'Hayır'),
)
user = models.ForeignKey('accounts.CustomUser', on_delete=models.CASCADE, related_name='json_to_type_user',
verbose_name="Kullanıcı")
title = models.CharField(max_length=254, verbose_name="Başlık")
json_data = models.JSONField(verbose_name="Json Veri", unique=True)
type_data = models.TextField(verbose_name="Type Veri", unique=True)
created_at = models.DateTimeField(auto_now_add=True, editable=False, verbose_name="Oluşturulma Tarihi")
updated_at = models.DateTimeField(auto_now=True, editable=False, verbose_name="Güncelleme Tarihi")
is_active = models.BooleanField(default=False, verbose_name='Yayındamı', choices=aktif)
class Meta:
ordering = ["-updated_at"]
db_table = 'json_to_type'
verbose_name_plural = "Json To Type"
verbose_name = "Json To Type"
def __str__(self):
return self.title