fix articles
This commit is contained in:
SDE
2023-11-30 07:41:22 +03:00
parent dcfd66324e
commit de098bdf55
6 changed files with 120 additions and 14 deletions

View File

@@ -10,8 +10,8 @@ def get_options_by_opt_types(opt_types, only_vals=False):
opts = Option.objects.filter(**kwargs)
if opts and only_vals:
opts = opts.values('name', 'value')
opts = {item['name']: item['value'] for item in opts}
opts = opts.values('opt_type', 'value')
opts = {item['opt_type']: item['value'] for item in opts}
return opts
def get_first_option_value_by_opt_type(opt_type):