first push
This commit is contained in:
19
LiveStock/LiveStoksAndPoultry/helpers.py
Normal file
19
LiveStock/LiveStoksAndPoultry/helpers.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from django.http import HttpResponse
|
||||
|
||||
from LiveStock.helpers import convert_to_miladi
|
||||
from LiveStock.models import LiveStock, LiveStockRolseProduct, LiveStockProduct, Rancher
|
||||
|
||||
|
||||
def add_birthday(reqeust):
|
||||
live_stock=LiveStock.objects.filter(trash=False,birth_day_gh__isnull=True).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')
|
||||
|
||||
def add_live_stock(request):
|
||||
rancher=Rancher.objects.get(herd_code='139894930',trash=False)
|
||||
for _i in rancher(110):
|
||||
pass
|
||||
Reference in New Issue
Block a user