Skip to content

Instantly share code, notes, and snippets.

@titovanton
Last active February 19, 2019 07:21
Show Gist options
  • Save titovanton/294539dbce17e3158ddb78bf2403fc45 to your computer and use it in GitHub Desktop.
Save titovanton/294539dbce17e3158ddb78bf2403fc45 to your computer and use it in GitHub Desktop.
import sys
import os
import random
sys.path.append('/webapps/django/spitekrepko3/')
from django.apps import apps
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
application = get_wsgi_application()
Mattress = apps.get_model('catalog', 'Mattress')
for i in xrange(0, 110):
i = 900
while i > 364:
i = int(random.random() * 1000)
m = Mattress.objects.all()[i]
m.best_seller = True
m.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment