Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Forked from gnrfan/Populate circuits
Created June 6, 2012 00:58

Revisions

  1. PuercoPop revised this gist Jun 6, 2012. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Populate circuits
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,8 @@ countdown = 100

    while countdown > 0:
    circuit = random.choice( circuits )
    profile = random.choice( users )
    profile = random.choice( profiles )
    circuit.remix(profile.user)
    circuit.published = True
    circuit.save()
    countdown -= 1
  2. @gnrfan gnrfan revised this gist Jun 5, 2012. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Populate circuits
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,11 @@ from circuits.models import Circuit
    from user_profile.models import UserProfile

    circuits = Circuit.objects.all()
    users = UserProfile.objects.all()
    countdown = 1
    profiles = UserProfile.objects.all()
    countdown = 100

    while countdown > 0:
    circuit = random.choice( circuits )
    user = random.choice( users )
    circuit.remix(user)
    profile = random.choice( users )
    circuit.remix(profile.user)
    countdown -= 1
  3. PuercoPop created this gist Jun 5, 2012.
    13 changes: 13 additions & 0 deletions Populate circuits
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import random
    from circuits.models import Circuit
    from user_profile.models import UserProfile

    circuits = Circuit.objects.all()
    users = UserProfile.objects.all()
    countdown = 1

    while countdown > 0:
    circuit = random.choice( circuits )
    user = random.choice( users )
    circuit.remix(user)
    countdown -= 1