mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-13 22:09:17 +00:00
perf: 添加生成 platform
This commit is contained in:
@@ -30,9 +30,12 @@ class PlatformGenerator(FakeDataGenerator):
|
||||
def do_generate(self, batch, batch_size):
|
||||
platforms = []
|
||||
for i in batch:
|
||||
category = choice(self.categories)
|
||||
tp = choice(self.category_type[category].choices)
|
||||
data = {
|
||||
'name': forgery_py.name.company_name(),
|
||||
'category': ''
|
||||
'category': choice(self.categories),
|
||||
'type': tp
|
||||
}
|
||||
platforms.append(Platform(**data))
|
||||
Platform.objects.bulk_create(platforms, ignore_conflicts=True)
|
||||
|
Reference in New Issue
Block a user