app.management.commands.merge_duplicate_positions module

class app.management.commands.merge_duplicate_positions.Command(stdout=None, stderr=None, no_color=False, force_color=False)[源代码]

基类:BaseCommand

add_arguments(parser)[源代码]

Entry point for subclassed commands to add custom arguments.

find_duplicates() dict[tuple[int, int, str, int], list[Position]][源代码]

Find groups of duplicate Position objects based on (person, org, semester, year)

Returns a dictionary that maps (person_id, org_id, semester, year) to a list of Position objects.

handle(*args, **options)[源代码]

The actual logic of the command. Subclasses must implement this method.

help = 'Merge duplicate Position objects by keeping the one with minimum position value'