# Path: kullanici/models.py
# class IsVeren(models.Model):
#     kullanici = models.OneToOneField(User,related_name="is_veren")
#     cinsiyetSecenekleri = (
#         ('E', 'Erkek'),
#         ('K', 'Kadın'),
#     )
#     cinsiyet = models.CharField(max_length=1, choices=cinsiyetSecenekleri,blank=True, null=True)
#     dogumGunu = models.DateField(blank=True, null=True,default=datetime.date.today)
#     telefon = models.CharField(max_length=12,blank=True, null=True)
#     fotograf = models.ImageField(blank=True, null=True,upload_to="users")
#     
#     def __str__(self):
#         return self.kullanici.username
#     
#     def getIsveren(kullaniciID):
#         return IsVeren.objects.get(pk=kullaniciID)
# 
#     class Meta:
#         verbose_name ="İş Veren Profili"
#         verbose_name_plural="İş Veren Profilleri"
# 
# Path: adres/models.py
# class Adres(models.Model):
#     kullanici = models.ForeignKey(IsVeren,related_name="adres")
#     adres_basligi = models.CharField(max_length=50)
#     adres = models.CharField(max_length=80)
#     sehir = models.CharField(max_length=40)
#     ilce = models.CharField(max_length=40,blank=True, null=True)
#     semt = models.CharField(max_length=40,blank=True, null=True)
#     mahalle = models.CharField(max_length=40,blank=True, null=True)
#     sokak = models.CharField(max_length=40,blank=True, null=True)
#     no = models.CharField(max_length=10,blank=True, null=True)
#     posta_kodu = models.CharField(max_length=40,blank=True, null=True)
# 
#     def __str__(self):
#         return self.kullanici.kullanici.username + " " + self.adres_basligi
# 
#     class Meta:
#         verbose_name ="İş Veren Adresi"
#         verbose_name_plural="İş Veren Adresleri"
# 
#     def adresSec(adresID):
#         return Adres.objects.get(pk=adresID)
# 
# Path: hizmet/models.py
# class HizmetDescription(models.Model):
#     hizmetBasligi = models.CharField(max_length=50)
#     hizmet = models.ForeignKey(Hizmet)
#     yolMasrafi = models.BooleanField(default=True)
#     yemekMasrafi = models.BooleanField(default=True)
#     calismaTipleri = (
#         ('U', 'Uzaktan'),
#         ('A', 'Çalışma Alanında'),
#     )
#     calismaTipi = models.CharField(max_length=1, choices=calismaTipleri,blank=True, null=True)
# 
#     def hizmetSec(kategoriID):
#         return HizmetDescription.objects.get(pk=kategoriID)
#     
#     def __str__(self):
#         return self.hizmetBasligi
# 
#     class Meta:
#         verbose_name ="Hizmet"
#         verbose_name_plural="Hizmetler"
# 
# class Hizmet(models.Model):
#     hizmetAdi = models.CharField(max_length=50) 
#     
#     def __str__(self):
#         return self.hizmetAdi
# 
#     class Meta:
#         verbose_name ="Hizmet Türü"
#         verbose_name_plural="Hizmet Türleri"


from django.db import models
from django.contrib.auth.models import User
from kullanici.models import IsVeren
from adres.models import Adres
from hizmet.models import HizmetDescription,Hizmet
        from register.models import Register

class Ilan(models.Model):
    kullanici = models.ForeignKey(IsVeren,related_name="is_veren")
    hizmetDescr = models.ForeignKey(HizmetDescription,related_name="hizmet_descr")
    hizmet = models.ForeignKey(Hizmet,blank=True,null=True,related_name="hizmet_tipi")

# Path: kullanici/models.py
# class IsVeren(models.Model):
#     kullanici = models.OneToOneField(User,related_name="is_veren")
#     cinsiyetSecenekleri = (
#         ('E', 'Erkek'),
#         ('K', 'Kadın'),
#     )
#     cinsiyet = models.CharField(max_length=1, choices=cinsiyetSecenekleri,blank=True, null=True)
#     dogumGunu = models.DateField(blank=True, null=True,default=datetime.date.today)
#     telefon = models.CharField(max_length=12,blank=True, null=True)
#     fotograf = models.ImageField(blank=True, null=True,upload_to="users")
#     
#     def __str__(self):
#         return self.kullanici.username
#     
#     def getIsveren(kullaniciID):
#         return IsVeren.objects.get(pk=kullaniciID)
# 
#     class Meta:
#         verbose_name ="İş Veren Profili"
#         verbose_name_plural="İş Veren Profilleri"
# 
# Path: adres/models.py
# class Adres(models.Model):
#     kullanici = models.ForeignKey(IsVeren,related_name="adres")
#     adres_basligi = models.CharField(max_length=50)
#     adres = models.CharField(max_length=80)
#     sehir = models.CharField(max_length=40)
#     ilce = models.CharField(max_length=40,blank=True, null=True)
#     semt = models.CharField(max_length=40,blank=True, null=True)
#     mahalle = models.CharField(max_length=40,blank=True, null=True)
#     sokak = models.CharField(max_length=40,blank=True, null=True)
#     no = models.CharField(max_length=10,blank=True, null=True)
#     posta_kodu = models.CharField(max_length=40,blank=True, null=True)
# 
#     def __str__(self):
#         return self.kullanici.kullanici.username + " " + self.adres_basligi
# 
#     class Meta:
#         verbose_name ="İş Veren Adresi"
#         verbose_name_plural="İş Veren Adresleri"
# 
#     def adresSec(adresID):
#         return Adres.objects.get(pk=adresID)
# 
# Path: hizmet/models.py
# class HizmetDescription(models.Model):
#     hizmetBasligi = models.CharField(max_length=50)
#     hizmet = models.ForeignKey(Hizmet)
#     yolMasrafi = models.BooleanField(default=True)
#     yemekMasrafi = models.BooleanField(default=True)
#     calismaTipleri = (
#         ('U', 'Uzaktan'),
#         ('A', 'Çalışma Alanında'),
#     )
#     calismaTipi = models.CharField(max_length=1, choices=calismaTipleri,blank=True, null=True)
# 
#     def hizmetSec(kategoriID):
#         return HizmetDescription.objects.get(pk=kategoriID)
#     
#     def __str__(self):
#         return self.hizmetBasligi
# 
#     class Meta:
#         verbose_name ="Hizmet"
#         verbose_name_plural="Hizmetler"
# 
# class Hizmet(models.Model):
#     hizmetAdi = models.CharField(max_length=50) 
#     
#     def __str__(self):
#         return self.hizmetAdi
# 
#     class Meta:
#         verbose_name ="Hizmet Türü"
#         verbose_name_plural="Hizmet Türleri"


# Path: ilan/models.py
from django.db import models
from django.contrib.auth.models import User
from kullanici.models import IsVeren
from adres.models import Adres
from hizmet.models import HizmetDescription,Hizmet
        from register.models import Register


class Ilan(models.Model):
    kullanici = models.ForeignKey(IsVeren,related_name="is_veren")
    hizmetDescr = models.ForeignKey(HizmetDescription,related_name="hizmet_descr")
    hizmet = models.ForeignKey(Hizmet,blank=True,null=True,related_name="hizmet_tipi")

    adres = models.ForeignKey(Adres,blank=True,null=True,related_name="is_veren_adresi")