<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_upserts_distinct(queryset, model_objs_updated, model_objs_created, unique_fields):
 """ Given a list of model objects that were updated and model objects that were created, fetch the pks of the newly created models and return the two lists in a tuple """


    # Keep track of the created models
    created_models = []

    # If we created new models query for them
    if model_objs_created:
        created_models.extend(
            queryset.extra(
                where=['({unique_fields_sql}) in %s'.format(
                    unique_fields_sql=', '.join(unique_fields)
                )],
                params=[
                    tuple([
                        tuple([
                            getattr(model_obj, field)
                            for field in unique_fields
                        ])
                        for model_obj in model_objs_created
                    ])
                ]
            )
        )

    # Return the models
    return model_objs_updated, created_models