Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴升宇
physical
Commits
acb3489c
Commit
acb3489c
authored
Jul 18, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Plain Diff
add
parents
b59c8d17
42847d50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
product_transfer.py
trans2es/utils/product_transfer.py
+2
-8
No files found.
trans2es/utils/product_transfer.py
View file @
acb3489c
...
...
@@ -26,16 +26,13 @@ class ProductTransfer(object):
res
[
"price"
]
=
instance
.
price
res
[
"cn_name_sort"
]
=
''
for
i
in
lazy_pinyin
(
instance
.
cn_name
):
res
[
"cn_name_sort"
]
+=
str
(
i
.
strip
())
res
[
"cn_name_sort"
]
+=
str
(
i
[
0
])
res
[
"cn_name_pre"
]
=
instance
.
cn_name
res
[
"en_name_pre"
]
=
instance
.
en_name
res
[
"alias
_pre
"
]
=
instance
.
alias
res
[
"alias"
]
=
instance
.
alias
res
[
"cn_name"
]
=
instance
.
cn_name
res
[
"en_name"
]
=
instance
.
en_name
res
[
"alias_pre"
]
=
instance
.
alias
res
[
'description'
]
=
instance
.
description
res
[
"have_image"
]
=
True
if
instance
.
image
else
False
res
[
"comment_nums"
]
=
instance
.
comment_nums
...
...
@@ -54,7 +51,6 @@ class ProductTransfer(object):
res
[
"brand_cn_name_pre"
]
=
""
res
[
"brand_en_name_pre"
]
=
""
res
[
"brand_alias_pre"
]
=
""
category_cn_name
=
instance
.
get_category_en_name
()
if
category_cn_name
:
res
[
"category_cn_name"
]
=
category_cn_name
...
...
@@ -62,7 +58,6 @@ class ProductTransfer(object):
else
:
res
[
"category_cn_name"
]
=
[]
res
[
"category_cn_name_pre"
]
=
[]
effect_cn_name
=
instance
.
get_effect_cn_name
()
if
effect_cn_name
:
res
[
'effect_cn_name'
]
=
effect_cn_name
...
...
@@ -70,7 +65,6 @@ class ProductTransfer(object):
else
:
res
[
"effect_cn_name"
]
=
[]
res
[
"effect_cn_name_pre"
]
=
[]
logging
.
info
(
"get product:
%
s"
%
res
)
return
res
except
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment