Commit 69204558a718e3332c6cfa55edfc6114fe9dee1a
Committed by
mykhaly
1 parent
75c1d4a6
Replace dicts in returned value with deepcopies of dicts
In op_faker.procuringEntity and op_faker.fake_item Also add description_en and description_ru to items data
Showing
2 changed files
with
25 additions
and
4 deletions
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | from faker.providers import BaseProvider | 2 | from faker.providers import BaseProvider |
| 3 | +from copy import deepcopy | ||
| 3 | from munch import Munch | 4 | from munch import Munch |
| 4 | from json import load | 5 | from json import load |
| 5 | import os | 6 | import os |
| @@ -85,7 +86,7 @@ class OP_Provider(BaseProvider): | @@ -85,7 +86,7 @@ class OP_Provider(BaseProvider): | ||
| 85 | 86 | ||
| 86 | @classmethod | 87 | @classmethod |
| 87 | def procuringEntity(self): | 88 | def procuringEntity(self): |
| 88 | - return self.random_element(self.procuringEntities) | 89 | + return deepcopy(self.random_element(self.procuringEntities)) |
| 89 | 90 | ||
| 90 | @classmethod | 91 | @classmethod |
| 91 | def cpv(self): | 92 | def cpv(self): |
| @@ -123,6 +124,8 @@ class OP_Provider(BaseProvider): | @@ -123,6 +124,8 @@ class OP_Provider(BaseProvider): | ||
| 123 | address = self.random_element(self.addresses) | 124 | address = self.random_element(self.addresses) |
| 124 | item = { | 125 | item = { |
| 125 | "description": item_base_data["description"], | 126 | "description": item_base_data["description"], |
| 127 | + "description_ru": item_base_data["description_ru"], | ||
| 128 | + "description_en": item_base_data["description_en"], | ||
| 126 | "classification": classification["classification"], | 129 | "classification": classification["classification"], |
| 127 | "additionalClassifications": classification["additionalClassifications"], | 130 | "additionalClassifications": classification["additionalClassifications"], |
| 128 | "deliveryAddress": address["deliveryAddress"], | 131 | "deliveryAddress": address["deliveryAddress"], |
| @@ -130,4 +133,4 @@ class OP_Provider(BaseProvider): | @@ -130,4 +133,4 @@ class OP_Provider(BaseProvider): | ||
| 130 | "unit": item_base_data["unit"], | 133 | "unit": item_base_data["unit"], |
| 131 | "quantity": self.randomize_nb_elements(number=item_base_data["quantity"], le=80, ge=120) | 134 | "quantity": self.randomize_nb_elements(number=item_base_data["quantity"], le=80, ge=120) |
| 132 | } | 135 | } |
| 133 | - return item | 136 | + return deepcopy(item) |
| @@ -7901,6 +7901,8 @@ | @@ -7901,6 +7901,8 @@ | ||
| 7901 | { | 7901 | { |
| 7902 | "cpv_id": "30199000-0", | 7902 | "cpv_id": "30199000-0", |
| 7903 | "description": "Папір для офісної техніки А4", | 7903 | "description": "Папір для офісної техніки А4", |
| 7904 | + "description_ru": "Бумага для офисной техники формата А4", | ||
| 7905 | + "description_en": "Paper for office equipment А4", | ||
| 7904 | "quantity": 15, | 7906 | "quantity": 15, |
| 7905 | "unit": { | 7907 | "unit": { |
| 7906 | "code": "PK", | 7908 | "code": "PK", |
| @@ -7910,6 +7912,8 @@ | @@ -7910,6 +7912,8 @@ | ||
| 7910 | { | 7912 | { |
| 7911 | "cpv_id": "24910000-6", | 7913 | "cpv_id": "24910000-6", |
| 7912 | "description": "Клей СМ-11", | 7914 | "description": "Клей СМ-11", |
| 7915 | + "description_ru": "Клей СМ-11", | ||
| 7916 | + "description_en": "Glue SM-11", | ||
| 7913 | "quantity": 50, | 7917 | "quantity": 50, |
| 7914 | "unit": { | 7918 | "unit": { |
| 7915 | "code": "KGM", | 7919 | "code": "KGM", |
| @@ -7919,6 +7923,8 @@ | @@ -7919,6 +7923,8 @@ | ||
| 7919 | { | 7923 | { |
| 7920 | "cpv_id": "22990000-6", | 7924 | "cpv_id": "22990000-6", |
| 7921 | "description": "Вироби канцелярські, паперові", | 7925 | "description": "Вироби канцелярські, паперові", |
| 7926 | + "description_ru": "Изделия канцелярские, бумажные", | ||
| 7927 | + "description_en": "Paper stationery", | ||
| 7922 | "quantity": 116, | 7928 | "quantity": 116, |
| 7923 | "unit": { | 7929 | "unit": { |
| 7924 | "code": "H87", | 7930 | "code": "H87", |
| @@ -7928,6 +7934,8 @@ | @@ -7928,6 +7934,8 @@ | ||
| 7928 | { | 7934 | { |
| 7929 | "cpv_id": "22800000-8", | 7935 | "cpv_id": "22800000-8", |
| 7930 | "description": "Бланки та журнали відповідної форми (наведені в додатку)", | 7936 | "description": "Бланки та журнали відповідної форми (наведені в додатку)", |
| 7937 | + "description_ru": "Бланки и журналы соответствующей формы (приведены в приложении)", | ||
| 7938 | + "description_en": "Form and journals in appropriate form (listed in Annex)", | ||
| 7931 | "quantity": 5, | 7939 | "quantity": 5, |
| 7932 | "unit": { | 7940 | "unit": { |
| 7933 | "code": "LO", | 7941 | "code": "LO", |
| @@ -7936,7 +7944,9 @@ | @@ -7936,7 +7944,9 @@ | ||
| 7936 | }, | 7944 | }, |
| 7937 | { | 7945 | { |
| 7938 | "cpv_id": "30192121-5", | 7946 | "cpv_id": "30192121-5", |
| 7939 | - "description": "ручки кулькові", | 7947 | + "description": "Ручки кулькові", |
| 7948 | + "description_ru": "Ручки шариковые", | ||
| 7949 | + "description_en": "Ballpoint pens", | ||
| 7940 | "quantity": 10, | 7950 | "quantity": 10, |
| 7941 | "unit": { | 7951 | "unit": { |
| 7942 | "code": "PK", | 7952 | "code": "PK", |
| @@ -7945,7 +7955,9 @@ | @@ -7945,7 +7955,9 @@ | ||
| 7945 | }, | 7955 | }, |
| 7946 | { | 7956 | { |
| 7947 | "cpv_id": "30192130-1", | 7957 | "cpv_id": "30192130-1", |
| 7948 | - "description": "олівці прості", | 7958 | + "description": "Олівці прості", |
| 7959 | + "description_ru": "Карандаши простые", | ||
| 7960 | + "description_en": "Plain pencils", | ||
| 7949 | "quantity": 3, | 7961 | "quantity": 3, |
| 7950 | "unit": { | 7962 | "unit": { |
| 7951 | "code": "PK", | 7963 | "code": "PK", |
| @@ -7955,6 +7967,8 @@ | @@ -7955,6 +7967,8 @@ | ||
| 7955 | { | 7967 | { |
| 7956 | "cpv_id": "30197600-2", | 7968 | "cpv_id": "30197600-2", |
| 7957 | "description": "Папір офісний призначений для друку та копіювання на лазерній, струменевій техніці, формат А4 - 210 х 297 мм, щільність 80г/м2.", | 7969 | "description": "Папір офісний призначений для друку та копіювання на лазерній, струменевій техніці, формат А4 - 210 х 297 мм, щільність 80г/м2.", |
| 7970 | + "description_ru": "Бумага офисная предназначен для печати и копирования на лазерной, струйной технике, формат А4 - 210 х 297 мм, плотность 80г м2.", | ||
| 7971 | + "description_en": "Paper for office equipment А4", | ||
| 7958 | "quantity": 20, | 7972 | "quantity": 20, |
| 7959 | "unit": { | 7973 | "unit": { |
| 7960 | "code": "NMP", | 7974 | "code": "NMP", |
| @@ -7964,6 +7978,8 @@ | @@ -7964,6 +7978,8 @@ | ||
| 7964 | { | 7978 | { |
| 7965 | "cpv_id": "22200000-2", | 7979 | "cpv_id": "22200000-2", |
| 7966 | "description": "Періодичні видання оригінальні на 2016 рік (газети України, журнали України, журнали Росії)", | 7980 | "description": "Періодичні видання оригінальні на 2016 рік (газети України, журнали України, журнали Росії)", |
| 7981 | + "description_ru": "Периодические издания оригинала в 2016 году (газет Украина, журналов Украины, журналов России)", | ||
| 7982 | + "description_en": "Periodicals original in 2016 (Ukrainian newspapers, Ukrainian magazines, Russian magazines)", | ||
| 7967 | "quantity": 126, | 7983 | "quantity": 126, |
| 7968 | "unit": { | 7984 | "unit": { |
| 7969 | "code": "H87", | 7985 | "code": "H87", |
| @@ -7973,6 +7989,8 @@ | @@ -7973,6 +7989,8 @@ | ||
| 7973 | { | 7989 | { |
| 7974 | "cpv_id": "22212000-9", | 7990 | "cpv_id": "22212000-9", |
| 7975 | "description": "Додаток № 1 до документації", | 7991 | "description": "Додаток № 1 до документації", |
| 7992 | + "description_ru": "Приложение № 1 к документации", | ||
| 7993 | + "description_en": "Supplement # 1 to documentation", | ||
| 7976 | "quantity": 12, | 7994 | "quantity": 12, |
| 7977 | "unit": { | 7995 | "unit": { |
| 7978 | "code": "SET", | 7996 | "code": "SET", |
Please
register
or
login
to post a comment