import - service area & purchase policy in org linked ranchers
This commit is contained in:
@@ -3,7 +3,6 @@ from multiprocessing import cpu_count, Pool
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.db import connection
|
||||
|
||||
from apps.herd.models import Rancher
|
||||
from .link_ranchers_parallel_worker import process_city
|
||||
|
||||
|
||||
@@ -18,7 +17,8 @@ class Command(BaseCommand):
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
workers = options['workers']
|
||||
from apps.herd.models import Rancher
|
||||
workers = options['worker']
|
||||
|
||||
city_ids = (
|
||||
Rancher.objects.filter(city__isnull=False)
|
||||
|
||||
@@ -44,6 +44,8 @@ class RancherOrganizationService:
|
||||
{
|
||||
"id": org.id,
|
||||
"name": org.name,
|
||||
"org_service_area": [{'name': city.name, 'id': city.id} for city in org.service_area.all()],
|
||||
"org_purchase_policy": org.purchase_policy,
|
||||
"province": org.province.name,
|
||||
"province_id": org.province.id,
|
||||
"city": org.city.name,
|
||||
|
||||
Reference in New Issue
Block a user