# Path: users/models.py
# class UserProfile(models.Model):
#     """Was here to manage m2m relation to Organization."""
#     # Keeping this, because I'll store more information about users at some point.
#     user = models.OneToOneField(User)
# 
# Path: development_resources/lorem_ipsum.py
# def get_paragraph(num_lines):
# def get_paragraphs(num_paragraphs):
# def get_words(num_words):


import os
from random import randint
from django.contrib.auth.models import User
from django.db import IntegrityError
from competencies.models import *
from users.models import UserProfile
from development_resources import lorem_ipsum as li
    #  If I keep this, that redundancy should be removed somehow.

    # Build an organization, down to the performance indicator level.
    num_elements = num_elements

    user = User.objects.filter(username=os.environ['RU_USERNAME'])[0]
    su_user = User.objects.filter(username=os.environ['SU_USERNAME'])[0]

    # Build num_elements test organizations that user 0 is associated with,
    #  num_elements the user 1 is associated with.
    test_organizations, test_sas = [], []
    for organization_num in range(6):
        name = li.get_words(2)
        if organization_num < num_elements/2:
            new_organization = Organization.objects.create(name=name, owner=user)
            new_organization.editors.add(user)
        else:
            new_organization = Organization.objects.create(name=name, owner=su_user)
            new_organization.editors.add(su_user)
        test_organizations.append(new_organization)

        # Create num_elements subject areas for each organization.
        for sa_num in range(num_elements):
            sa_name = li.get_words(2)
            new_sa = SubjectArea.objects.create(subject_area=sa_name,
                                                organization=new_organization)
            test_sas.append(new_sa)

            # Create num_elements grad standards for each subject area.
            for gs_num in range(num_elements):

# Path: users/models.py
# class UserProfile(models.Model):
#     """Was here to manage m2m relation to Organization."""
#     # Keeping this, because I'll store more information about users at some point.
#     user = models.OneToOneField(User)
# 
# Path: development_resources/lorem_ipsum.py
# def get_paragraph(num_lines):
# def get_paragraphs(num_paragraphs):
# def get_words(num_words):


# Path: competencies/my_admin.py
import os
from random import randint
from django.contrib.auth.models import User
from django.db import IntegrityError
from competencies.models import *
from users.models import UserProfile
from development_resources import lorem_ipsum as li

    #  If I keep this, that redundancy should be removed somehow.

    # Build an organization, down to the performance indicator level.
    num_elements = num_elements

    user = User.objects.filter(username=os.environ['RU_USERNAME'])[0]
    su_user = User.objects.filter(username=os.environ['SU_USERNAME'])[0]

    # Build num_elements test organizations that user 0 is associated with,
    #  num_elements the user 1 is associated with.
    test_organizations, test_sas = [], []
    for organization_num in range(6):
        name = li.get_words(2)
        if organization_num < num_elements/2:
            new_organization = Organization.objects.create(name=name, owner=user)
            new_organization.editors.add(user)
        else:
            new_organization = Organization.objects.create(name=name, owner=su_user)
            new_organization.editors.add(su_user)
        test_organizations.append(new_organization)

        # Create num_elements subject areas for each organization.
        for sa_num in range(num_elements):
            sa_name = li.get_words(2)
            new_sa = SubjectArea.objects.create(subject_area=sa_name,
                                                organization=new_organization)
            test_sas.append(new_sa)

            # Create num_elements grad standards for each subject area.
            for gs_num in range(num_elements):

                gs_body = li.get_words(randint(3,7))