Files
shopback/contact/models.py
Beyhan Oğur d9f1ea341e first commit
2026-04-26 22:27:56 +03:00

23 lines
1009 B
Python
Raw Permalink 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 Contact(models.Model):
user = models.ForeignKey('accounts.CustomUser', on_delete=models.SET_NULL, null=True, blank=True, verbose_name="Kullanıcı")
name = models.CharField(max_length=254, verbose_name="Ad Soyad ")
email = models.CharField(max_length=254, verbose_name="Eposta Adresi ")
ip = models.CharField(max_length=100, verbose_name="IP Adresi ", blank=True, null=True)
subject = models.CharField(max_length=254, verbose_name="Konu ")
message = models.TextField(verbose_name="Mesaj ")
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")
class Meta:
ordering = ["created_at"]
db_table = 'contacts'
verbose_name_plural = "Contact"
verbose_name = "Contact"
def __str__(self):
return f"Contact: {self.name}"