# Generated by Django 2.1.3 on 2018-11-19 19:27

from django.db import migrations
from django.utils import timezone
import random

def buy_items(apps, schema_editor):
    Item = apps.get_model('marketapp', 'Item')
    items = Item.objects.all()
    for item in items:
        if random.randint(1, 100) > 65:
            item.baught = True
            item.baught_date = timezone.now()
            item.save()

class Migration(migrations.Migration):

    dependencies = [
        ('marketapp', '0008_item_baught_date'),
    ]

    operations = [
        migrations.RunPython(buy_items),
    ]
