Tmp commit to debug
This commit is contained in:
parent
4d908d0bbb
commit
09865db08a
|
|
@ -33,6 +33,8 @@ def transfer_objects(data_type):
|
|||
# TRANSFER DATA FUNCTION
|
||||
def transfer_data(model, card):
|
||||
legacy_model_queryset = get_legacy_data(card)
|
||||
print("==============================================================================")
|
||||
print(model)
|
||||
fields_map = get_fields_map(card, legacy_model_queryset)
|
||||
|
||||
|
||||
|
|
@ -65,6 +67,9 @@ def get_fields_map(card, queryset):
|
|||
fields_list = list(card['fields'].values())[0]
|
||||
|
||||
app_queryset_list = []
|
||||
print("==============================================================================")
|
||||
pprint(card)
|
||||
print("==============================================================================")
|
||||
|
||||
for legacy_object in queryset.iterator():
|
||||
app_queryset_dict = {}
|
||||
|
|
@ -72,7 +77,8 @@ def get_fields_map(card, queryset):
|
|||
app_value = convert_field_from_legacy_to_app(legacy_object, legacy_field)
|
||||
if app_value is not None:
|
||||
app_queryset_dict[app_field] = app_value
|
||||
|
||||
print("==============================")
|
||||
pprint(app_queryset_dict)
|
||||
app_queryset_list.append(app_queryset_dict)
|
||||
|
||||
# pprint(card)
|
||||
|
|
@ -82,7 +88,7 @@ def get_fields_map(card, queryset):
|
|||
# pprint(relations)
|
||||
# print("*************************************")
|
||||
# pprint(len(queryset))
|
||||
print("==============================")
|
||||
|
||||
|
||||
return app_queryset_list
|
||||
|
||||
|
|
@ -172,7 +178,7 @@ def get_legacy_data(card):
|
|||
"""Одиночное поле"""
|
||||
legacy_fields.append(legacy_field[0])
|
||||
|
||||
queryset = legacy_model.objects.only(*legacy_fields)
|
||||
queryset = legacy_model.objects.only(*legacy_fields).limit(50) #TODO: remove after debug
|
||||
|
||||
# Возвращаем зависимости на место
|
||||
if relations:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user