blob: c736cad1a4ff7cb02ed3155274862f7de2a69096 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import sys
import os
from path import PORJECT_PATH
# Use django's model independently
pwd = os.path.dirname(os.path.realpath(__file__))
sys.path.append(pwd)
path = PORJECT_PATH
sys.path.append(path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
# Initialize django
import django
django.setup()
from test_records.models import TestBranch
from data.branch_data import row_data
for branch_item in row_data:
branch = TestBranch()
branch.branch_name = branch_item["branch_name"]
# branch.is_accept = True
# branch.is_show = True
branch.save()
|