intranet.apps.dataimport.management.commands package¶
Submodules¶
intranet.apps.dataimport.management.commands.delete_users module¶
intranet.apps.dataimport.management.commands.import_eighth module¶
intranet.apps.dataimport.management.commands.import_photos module¶
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
- 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
- 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.
- 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
- 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'), (', ', ' + '))¶