Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Forked from gnrfan/Populate circuits
Created June 6, 2012 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PuercoPop/2879199 to your computer and use it in GitHub Desktop.
Save PuercoPop/2879199 to your computer and use it in GitHub Desktop.
small snippet to replicate circuits in development database
import random
from circuits.models import Circuit
from user_profile.models import UserProfile
circuits = Circuit.objects.all()
profiles = UserProfile.objects.all()
countdown = 100
while countdown > 0:
circuit = random.choice( circuits )
profile = random.choice( profiles )
circuit.remix(profile.user)
circuit.published = True
circuit.save()
countdown -= 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment