# coding=utf-8
import random

from django.core.management.base import BaseCommand

from recommend.models import ServiceHot, DeviceInterest
import random
query_list = [
    '双眼皮',
    '埋线',
    '瘦脸针',
    '丰胸',
    '玻尿酸',

]

service_list = [
4667613, 4627748, 2008, 4636677, 2094, 4667978,1665,4667840,4667968,4667904
]
tags = [
    2,3,4,5,6,22,23,24,25,26,991,992,993,994,995
]

device_ids = [
"aaaa","aaab","aaac","aaad","aabb","aabc","aabd","abbb","abbc","abbd","abca","abcb","abcc","abcd"
]

class Command(BaseCommand):
    def handle(self, *args, **options):
        for service in service_list:
            for tag in tags:
                servicehot, created = ServiceHot.objects.get_or_create(service_id=service, tag_id=tag)
                servicehot.rank =random.uniform(0, 10)
                servicehot.save()
        for device_id in device_ids:
            for tag in tags:
                device, created = DeviceInterest.objects.get_or_create(device_id=device_id, tag_id=tag)
                device.rank = random.uniform(0, 10)
                device.save()









