# Path: hizmet/models.py
# 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 hizmet.models import Hizmet
import datetime 
#! -*- coding:utf-8 -*-


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"

class IsArayan(models.Model):
    kullanici = models.OneToOneField(User,related_name="is_arayan")

# Path: hizmet/models.py
# 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: kullanici/models.py
from django.db import models
from django.contrib.auth.models import User 
from hizmet.models import Hizmet
import datetime 

#! -*- coding:utf-8 -*-


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"

class IsArayan(models.Model):
    kullanici = models.OneToOneField(User,related_name="is_arayan")

    hizmetler = models.ManyToManyField(Hizmet,related_name="hizmetler")