from django.http import HttpResponse

from LiveStock.helpers import convert_to_miladi
from LiveStock.models import LiveStock, LiveStockRolseProduct, LiveStockProduct


def add_birthday(reqeust):
    live_stock=LiveStock.objects.filter(trash=False).only('birth_day')
    for l in live_stock:
        birth_day=l.birth_day.split('/')
        birth_day_gh=convert_to_miladi(year=int(birth_day[0]),month=int(birth_day[1]),day=int(birth_day[2]))
        l.birth_day_gh=birth_day_gh
        l.save()
    return HttpResponse('ok')