intranet.apps.dataimport.management.commands package

Submodules

intranet.apps.dataimport.management.commands.delete_users module

class intranet.apps.dataimport.management.commands.delete_users.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
ask(q)[source]
handle(*args, **options)[source]
help = 'Given a list of FCPS student IDs, delete them if they exist.'
read_student_ids(filename: str, column_header: str)[source]

Read student IDs from the given filename.

Parameters:
  • filename – Filename of the CSV to read from.

  • column_header – Column header of the Student ID column.

Returns:

A list of user IDs.

intranet.apps.dataimport.management.commands.import_eighth module

class intranet.apps.dataimport.management.commands.import_eighth.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
handle(*args, **kwargs)[source]
help = 'Import Eighth Period Activities For Testing'

intranet.apps.dataimport.management.commands.import_photos module

class intranet.apps.dataimport.management.commands.import_photos.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
handle(*args, **options)[source]
help = 'Imports photos from yearbook data export'

intranet.apps.dataimport.management.commands.import_staff module

class intranet.apps.dataimport.management.commands.import_staff.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
ask(q)[source]
handle(*args, **options)[source]
help = "Given an CSV of staff, add them to Ion. Required columns include 'Username', 'First Name', 'Last Name', and 'Middle Name'. Optional columns include 'Nick Name' and 'Gender'."

intranet.apps.dataimport.management.commands.import_students module

class intranet.apps.dataimport.management.commands.import_students.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
ask(q)[source]
find_next_available_username(used_username: str, username_set: Optional[set] = None) str[source]

Find the next available username.

Parameters:
  • used_username – The used username.

  • username_set – An additional set of usernames to deduplicate against. Regardless of this argument, this method will check against the database.

Returns:

A username that has not been used. Increments the digit on the end, or tacks one on if it doesn’t exist.

generate_single_username(users_properties: {}, graduating_year: int, first_name_header: str = 'First Name', last_name_header: str = 'Last Name') str[source]

Generate a single username. Ignores the presence of other users (so duplicate usernames are not handled).

Parameters:
  • users_properties – A dictionary with users’ properties, typically a SIS export.

  • graduating_year – The graduating year of the student.

  • first_name_header – The key of the ‘first name’ field in the properties.

  • last_name_header – The key of the ‘last name’ field in the properties.

Returns:

A single username.

handle(*args, **options)[source]
help = "Given an alphabetized CSV of students from the same graduating class, add them to Ion. Required columns in the CSV include 'Student ID', 'First Name', 'Last Name', and 'Middle Name'. Optional fields include their 'Nick Name', 'Counselor' (last name), and 'Gender'."

intranet.apps.dataimport.management.commands.import_tj_star module

class intranet.apps.dataimport.management.commands.import_tj_star.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
handle(*args, **options)[source]
help = "Given a CSV of tjSTAR data, create the eighth periods in Ion. Required columns in the CSV include 'Capacity', 'Room (for Sysadmins)', 'Block {A,B,C}.{1,2} Lab', 'Block {A,B,C}.{1,2} Project', and 'Block {A,B,C}.{1,2} Student IDs'"
shorthands = (('Chemistry Analysis/Nanochemistry', 'Chemistry'), ('Astronomy and Astrophysics', 'Astronomy'), ('Engineering Design', 'Engineering'), ('Biotechnology and Life Sciences', 'Biotech'), ('Mobile and Web App Development', 'Mobile / Web'), (', ', ' + '))

intranet.apps.dataimport.management.commands.import_users module

class intranet.apps.dataimport.management.commands.import_users.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
handle(*args, **kwargs)[source]
help = 'Import User Objects'

intranet.apps.dataimport.management.commands.year_cleanup module

class intranet.apps.dataimport.management.commands.year_cleanup.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

add_arguments(parser)[source]
archive_admin_comments(*, senior_grad_year: int)[source]
ask(q)[source]
chk(q, test)[source]
clear_absences()[source]
handle(*args, **options)[source]
handle_delete(*, senior_grad_year: int)[source]
help = 'Perform end-of-year cleanup duties.'
update_welcome()[source]

Module contents